Skip to main content
2 of 2
naming
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to use ogr2ogr to reproject shapefile in Python

I am trying to reproject the coordinate system of a shapefile.

I know I can do it in the OSGEO4W window as ogr2ogr -s_srs EPSG:27700 -t_srs EPSG:3857 C:/test/input.shp C:/test/output.tif

However, I want to be able to do this in Python. I found this documentation but can't figure out how to achieve what I want

https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#create-a-new-shapefile-and-add-data