JSON 到 GPX 转换器
使用 Aspose.GIS for .NET 库将 JSON 转换为 GPX 文件格式。
在线示例
Aspose.GIS for .NET / C# 在线免费提供 “JSON 到 GPX 转换器” 应用程序,您可以在其中调查其功能和质量如何运作。
代码示例 - JSON 到 GPX 转换器
以下代码片段向您展示了如何实现 JSON 到 GPX 转换器。 如果您为目标 GPX 层指定空间参考系统,则所有几何体都将转换为它。
// 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 GPX. | |
VectorLayer.Convert("source.geojson", Drivers.GeoJson, "destination.gpx", Drivers.Gpx, options); |
此示例显示了常规可能性。 Aspose.GIS for .NET 具有广泛的选项来 转换文件。 每种基于矢量的格式都有自己的读取/写入选项,它继承自 DriverOptions 类。
平台 - .NET / C#
我们支持 Windows 上的 Framework 4.7 或更高版本以及 Windows 或 Linux 上的 .NET Core 2.0 或更高版本。