Bộ chuyển đổi JSON sang Shapefile

Sử dụng thư viện Aspose.GIS for .NET để chuyển đổi JSON sang định dạng tệp Shapefile.

Ví dụ trực tiếp

Aspose.GIS for .NET / C# trình bày ứng dụng “Bộ chuyển đổi JSON sang Shapefile” miễn phí trực tuyến, nơi bạn có thể khám phá chức năng và chất lượng hoạt động của nó.

Ứng dụng Bộ chuyển đổi JSON sang Shapefile

Mẫu mã - Bộ chuyển đổi JSON sang Shapefile

Đoạn mã sau đây cho thấy cách triển khai Bộ chuyển đổi JSON sang Shapefile. Nếu bạn chỉ định hệ tham chiếu không gian cho lớp Shapefile đích, tất cả các hình học sẽ được chuyển đổi sang nó.

// 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);

Mẫu này thể hiện các khả năng tổng quát. Aspose.GIS for .NET có nhiều tùy chọn để chuyển đổi tệp. Mỗi định dạng dựa trên vector có các tùy chọn đọc / ghi riêng, kế thừa từ lớp DriverOptions.

Nền tảng - .NET / C#

Chúng tôi hỗ trợ Framework 4.7 trở lên trên Windows và .NET Core 2.0 trở lên trên Windows hoặc Linux