C# API で Open Street Map OSM ファイルを操作する
Contents
[
Hide
]
OpenStreetMap (OSM) XML ファイルの操作
Aspose.GIS では、OpenStreetMap (OSM) XML ファイルからフィーチャを開いて読み取ることができます。 現在、API は新しい OSM XML ファイルを作成する機能を提供していません。読み取りのみがサポートされています。
OSM XML ファイルからフィーチャを読み取る
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()); | |
} | |
} |