Práce se soubory Open Street Map OSM v C# API
Contents
[
Hide
]
Práce se soubory XML OpenStreetMap (OSM)
Aspose.GIS vám umožňuje otevřít a číst prvky ze souborů XML OpenStreetMap (OSM). V současné době API neposkytuje možnost vytvářet nové soubory XML OSM a podporováno je pouze čtení.
Čtení prvků ze souboru XML OSM
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
using (var layer = Drivers.OsmXml.OpenLayer(dataDir + "fountain.osm")) | |
{ | |
// get feratures count | |
int count = layer.Count; | |
Console.WriteLine("Layer count: " + count); | |
// get feature at index 2 | |
Feature featureAtIndex2 = layer[2]; | |
// iterate through all features. | |
foreach (Feature feature in layer) | |
{ | |
// handle feature | |
Console.WriteLine(feature.Geometry.AsText()); | |
} | |
} |