OSMParser is a C++ library for reading and parsing OSM XML data. It uses tinyxml2 to read map data from a file and creates a C++ object to store all relevant data.
- extract all nodes, ways, relations from the XML file
- tag each node, way, relation accordingly
- make it easy to retrieve references (
nd
- andmember
-tags are stored as pointers)
- render map data
- assemble relations like multipolygons
- query map data
To see OSMParser in action check out my related project
- main.cc has example way of extracting number of nodes, ways, relations from an OSM file
- mkdir build
- cd build
- cmake ..
- make -j4
- ./main ../sampledata/sample.osm
- mkdir build
- cd build
- cmake ..
- cmake --build . -j4
- main.exe ../sampledata/sample.osm