Vadeen OSM
Vadeen OSM is a library for reading and writing Open Street Map files.
Currently support xml and o5m. Pbf in the near future.
Examples
To run the examples in the examples/ folder run cargo build --examples and look in the
target/debug/examples/ folder for the binaries.
Simple read and write
use ;
// Read from file, format is determined from path.
let osm = read?;
// ...render or modify the map.
// Write to file, format is determined from path.
write?;
Create a map with the builder
The OsmBuilder has an abstraction to make it easy to build maps from other map data. It uses
terms as polygon (for areas), polyline (for lines) and points.
// Create a builder.
let mut builder = default;
// Add a polygon to the map.
builder.add_polygon;
// Add polyline to the map.
builder.add_polyline;
// Add point
builder.add_point;
// Build into Osm structure.
let osm = builder.build;
// Write to file in the xml format.
write?;
// Write to file in the o5m format.
write?;
Create a map without builder
When not using the builder you have to keep track of all the ids your self.
let mut osm = default;
// Add a node
osm.add_node;
// Add a way with no tags or nothing.
osm.add_way;
// Add a relation with no tags or nothing.
osm.add_relation;
// ...etc