Created
July 25, 2014 09:28
-
-
Save xivk/b2cd222d550fab308bc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sourceStream = new PBFOsmStreamSource( | |
new FileInfo(@"path\to\file.osm.pbf").OpenRead()); | |
foreach(var osmGeo in sourceStream) | |
{ | |
if(osmGeo.Type == Osm.OsmGeoType.Way && | |
osmGeo.Tags != null && | |
osmGeo.Tags.ContainsKey("highway")) | |
{ | |
// do something with the road here. | |
// the nodes are just ids. save them from the stream first and get their coordinates. | |
var way = (osmGeo as Way); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment