You can find detailed information at: Read Features from OpenStreetMap (OSM) Files using C#
Last active
August 25, 2021 11:26
-
-
Save aspose-com-gists/3d8540271b8374fb14e0e1a0e0fb69dc to your computer and use it in GitHub Desktop.
Read Features from OpenStreetMap (OSM) Files using C# | https://blog.aspose.com/2021/08/23/read-features-from-open-street-map-osm-files-using-csharp/
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
using (var layer = Drivers.OsmXml.OpenLayer(dataDir + "fountain.osm")) | |
{ | |
// Get features count | |
int count = layer.Count; | |
Console.WriteLine("Layer count: " + count); | |
// Iterate through all the features. | |
foreach (Feature feature in layer) | |
{ | |
// Print to the console | |
Console.WriteLine(feature.Geometry.AsText()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment