Sunday, 29 December 2019

Using ogr2ogr to convert GML to shapefile in Python?


I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script.


I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand any details on the syntax for using ogr2ogr in python.


After importing ogr, all I have found is ogr2ogr -f "ESRI Shapefile" output.shp input.gml


How do I use this in python? Is it as simple as assigning the input and output files?


Everything I try I just get syntax errors. Any pointers in the right direction to get me started would be great.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...