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