Conversion options

Hi,
Can you give all the conversion options for each file input , to other conversion , divide to group of family?
for example :shape file can convert to GEOJSON and…
Thanks,

@danies8

For conversion options related to GIS files, particularly Shapefiles (.shp), you can convert them to various formats using Aspose.GIS. Below are common conversion options grouped by file family:

1. Shapefile (.shp)

  • To GeoJSON:
    VectorLayer.Convert(shpPath, Drivers.Shapefile, geojsonPath, Drivers.GeoJson);
    
  • To KML:
    VectorLayer.Convert(shpPath, Drivers.Shapefile, kmlPath, Drivers.Kml);
    
  • To GML:
    VectorLayer.Convert(shpPath, Drivers.Shapefile, gmlPath, Drivers.Gml);
    

2. GeoJSON

  • To Shapefile:
    VectorLayer.Convert(geojsonPath, Drivers.GeoJson, shpPath, Drivers.Shapefile);
    
  • To KML:
    VectorLayer.Convert(geojsonPath, Drivers.GeoJson, kmlPath, Drivers.Kml);
    

3. KML

  • To Shapefile:
    VectorLayer.Convert(kmlPath, Drivers.Kml, shpPath, Drivers.Shapefile);
    
  • To GeoJSON:
    VectorLayer.Convert(kmlPath, Drivers.Kml, geojsonPath, Drivers.GeoJson);
    

4. GML

  • To Shapefile:
    VectorLayer.Convert(gmlPath, Drivers.Gml, shpPath, Drivers.Shapefile);
    
  • To GeoJSON:
    VectorLayer.Convert(gmlPath, Drivers.Gml, geojsonPath, Drivers.GeoJson);
    

Additional Notes

  • Ensure that the input Shapefile is correctly formatted and contains all necessary components, including .shp, .shx, and .dbf files.
  • If you are dealing with compressed files (e.g., .zip or .7z), consider using libraries like SharpCompress to extract them before conversion.

If you have specific file types in mind or need further details on other formats, feel free to ask!

@danies8,

I am also moving your thread to the appropriate category, where one of our colleagues from the Aspose.GIS team will review your requirements and provide assistance soon.

Can you please also make this ticket private?
Thanks in advance,

Hi, @danies8

using VectorLayer.Convert(string sourcePath, FileDriver sourceDriver, string destinationPath, FileDriver destinationDriver) API you can convert from one supported vector format to another.

VectorLayer.Convert(sourcePath, Drivers.GeoJson, destinationPath, Drivers.Kml);

In ‘Drivers’ class you can see all our supported formats:
EsriJson
GeoJson
GeoJsonSeq
Kml
Shapefile
OsmXml
Gpx
Gml
FileGdb
TopoJson
MapInfoInterchange
MapInfoTab
Csv
GeoPackage

Note about GeoPackage:
currently we can only read this format, so we can convert from GeoPackage to other, but can’t convert to GeoPackage. This task in progress now and we will soon implemented.

Regarding geopackage , you can’t convert to itself,
But all other you can convert to themselves?

Yes, all other you can convert to itself

  1. Can you please write the convert to all types?

2.Can you please state for each sourcr format which file i need to supply its destination in the source and which files are needed to be besides it?

Why to convert file to itself?
What is the motivation?

there is no sense except we can just check that everything work fine

Can you please write the code for each format which file it needs as source path , and which files i need to check it besides the main file ?
for example:
VectorLayer.Convert(shpPath, Drivers.Shapefile, geojsonPath, Drivers.GeoJson);
Ensure that the input Shapefile is correctly formatted and contains all necessary components, including .shp, .shx, and .dbf files and prj is optinal.
Thanks a lot.

in addition you state:
KML what about KMZ ?

KMZ it is zip kml file, so you can use our Kml driver

As i know you already have code to convert from shp to geojson.
Conversion for other formats absolutely the same.
for FileGdb you need (.gdbtable and gdbtablx).
For other format just only one file.