TestSimpleUsage.cpp
Go to the documentation of this file.
1 #include "TestSetup.h"
2 #include "gtest/gtest.h"
3 #include "lanelet2_io/Io.h"
4 
5 TEST(lanelet2_io, exampleUsage) { // NOLINT
6  using namespace lanelet;
7  Origin origin({49, 8.4, 0});
8  std::string filenameIn = "../../lanelet2_maps/res/mapping_example.osm";
9  LaneletMapPtr laneletMap = lanelet::load(filenameIn, origin);
10 
12  lanelet::write(file.get().string(), *laneletMap, origin);
13  LaneletMapPtr laneletMapAgain = lanelet::load(file.get().string(), origin);
14 }
std::shared_ptr< LaneletMap > LaneletMapPtr
osm::File & file
std::unique_ptr< LaneletMap > load(const std::string &filename, const Origin &origin=Origin::defaultOrigin(), ErrorMessages *errors=nullptr, const io::Configuration &params=io::Configuration())
Loads a lanelet map from a file.
Definition: Io.cpp:24
void write(const std::string &filename, const lanelet::LaneletMap &map, const Origin &origin=Origin::defaultOrigin(), ErrorMessages *errors=nullptr, const io::Configuration &params=io::Configuration())
writes a map to a file
Definition: Io.cpp:61
const fs::path & get() const
Definition: TestSetup.h:141
TEST(lanelet2_io, exampleUsage)


lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Tue Jun 6 2023 02:23:45