CSV to GeoJSON Converter

Aspose.GIS for .NETライブラリを使用して、CSVをGeoJSONファイル形式に変換します。

ライブサンプル

Aspose.GIS for .NET / C#は、“CSV to GeoJSON Converter”アプリケーションをオンラインで無料で提供しています。このアプリケーションを使用して、その機能と品質を調査できます。

CSV to GeoJSON Converter App

コードサンプル - CSV to GeoJSON Converter

次のコードスニペットは、CSVからGeoJSONコンバーターの実装方法を示しています。 宛先GeoJSONレイヤーに空間参照システムを指定すると、すべてのジオメトリがそれに変換されます。

// 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 CSV to GeoJSON.
VectorLayer.Convert("source.csv", Drivers.Csv, "destination.geojson", Drivers.GeoJson, options);

このサンプルは一般的な可能性を示しています。 Aspose.GIS for .NETには、ファイルを変換するための幅広いオプションがあります。 各ベクトルベースの形式には、DriverOptionsクラスから継承された独自の読み取り/書き込みオプションがあります。

プラットフォーム - .NET / C#

WindowsではFramework 4.7以降を、WindowsまたはLinuxでは.NET Core 2.0以降をサポートしています。