محول KML إلى Shapefile
استخدم مكتبة Aspose.GIS for .NET لتحويل KML إلى تنسيق ملف Shapefile.
مثال حي
تقدم لك Aspose.GIS for .NET / C# تطبيق “محول KML إلى Shapefile” مجاني عبر الإنترنت، حيث يمكنك استكشاف الوظيفة والجودة التي يعمل بها.
نموذج التعليمات البرمجية - محول KML إلى Shapefile
يوضح مقتطف التعليمات البرمجية التالي كيفية تنفيذ محول KML إلى Shapefile. إذا حددت نظام إسناد مكاني للطبقة Shapefile الوجهة، فسيتم تحويل جميع الهندسات إليه.
// 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 KML to Shapefile. | |
VectorLayer.Convert("source.kml", Drivers.Kml, "destination.shp", Drivers.Shapefile, options); |
يعرض هذا النموذج إمكانيات عامة. لدى Aspose.GIS for .NET خيارات واسعة لتحويل الملفات. لكل تنسيق يعتمد على المتجهات خيارات القراءة / الكتابة الخاصة به والتي يتم توريثها من الفئة DriverOptions.
المنصة - .NET / C#
نحن ندعم Framework 4.7 أو أحدث على نظام Windows، و .NET Core 2.0 أو أحدث على نظام Windows أو Linux.