Konverter JSON ke Shapefile
Gunakan pustaka Aspose.GIS untuk .NET untuk mengonversi JSON ke format file Shapefile.
Contoh Langsung
Aspose.GIS untuk .NET / C# menyajikan aplikasi “Konverter JSON ke Shapefile” gratis online, di mana Anda dapat menyelidiki fungsionalitas dan kualitas kerjanya.
Contoh Kode - Konverter JSON ke Shapefile
Cuplikan kode berikut menunjukkan cara mengimplementasikan Konverter JSON ke Shapefile. Jika Anda menentukan sistem referensi spasial untuk layer Shapefile 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 JSON to Shapefile. | |
VectorLayer.Convert("source.geojson", Drivers.GeoJson, "destination.shp", Drivers.Shapefile, 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