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 }
TestSetup.h
lanelet::test_setup::Tempfile
Definition: TestSetup.h:124
LaneletMapPtr
std::shared_ptr< LaneletMap > LaneletMapPtr
lanelet
file
osm::File & file
Definition: OsmHandlerWrite.cpp:245
Io.h
lanelet::load
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
lanelet::Origin
Definition: Projection.h:11
lanelet::write
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
TEST
TEST(lanelet2_io, exampleUsage)
Definition: TestSimpleUsage.cpp:5


lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:26:03