Konverter GML ke JSON
Gunakan pustaka Aspose.GIS untuk .NET untuk mengonversi file GML ke format JSON.
Contoh Langsung
Aspose.GIS untuk .NET / C# menyajikan aplikasi “Konverter GML ke JSON” gratis online, di mana Anda dapat menyelidiki fungsionalitas dan kualitas kerjanya.
Contoh Kode - Konverter GML ke JSON
Cuplikan kode berikut menunjukkan cara mengimplementasikan Konverter GML ke JSON. Jika Anda menentukan sistem referensi spasial untuk lapisan JSON tujuan, semua geometri akan dikonversi ke dalamnya.
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
// Specify conversion settings if necessary. It is optional. | |
ConversionOptions options = null; | |
// This options assigns Wgs84 to the destination layer. | |
// Conversion may throw error If destination layer does not support the Wgs84 spatial reference. So need to check. | |
if (Drivers.Shapefile.SupportsSpatialReferenceSystem(SpatialReferenceSystem.Wgs84)) | |
{ | |
options = new ConversionOptions() | |
{ | |
DestinationSpatialReferenceSystem = SpatialReferenceSystem.Wgs84, | |
}; | |
} | |
// Convert file format from GML to JSON. | |
VectorLayer.Convert("source.gml", Drivers.Gml, "destination.geojson", Drivers.GeoJson, options); |
Contoh ini menunjukkan kemungkinan umum. Aspose.GIS untuk .NET memiliki opsi luas untuk mengonversi file. Setiap format berbasis vektor memiliki opsi baca/tulis sendiri yang diwarisi dari kelas DriverOptions.
Platform - .NET / C#
Kami mendukung Framework 4.7 atau lebih baru di bawah Windows, dan .NET Core 2.0 atau lebih baru di bawah Windows atau Linux