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()); | |
} | |
} |