@MichaelMiles-Stimson suggested OGR2OGR, which is packed with QGIS. One option is to use it through command line, with the following command:
ogr2ogr -t_srs epsg:32633 new.shp old.shp
You might prefer to call this command directly from python. Elevine's answer elsewhere shows how:
download http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and store it somewhere in your python import path (
/usr/lib/pythonX.X/dist-packages
or/usr/local/lib/pythonX.X/dist-packages
on Linux, not sure about Windows)write following code:
import ogr2ogr
ogr2ogr.main(["","-f", "ESRI Shapefile", "-s_srs", "epsg:4326", "-t_srs", "epsg:32633", "new.shp", "old.shp"])
In case of bugs you might need to add full paths to the file names.
EDIT: alternative way, less bug-prone:
from os import system
#define oldPath and newPath
cmd = 'ogr2ogr -f ESRI Shapefile -s_srs epsg:4326 -t_srs epsg:32633 '+newPath+' '+oldPath
os.system(cmd)
Perhaps you can use system(cmd)
instead, not sure which syntax is "better".
EDIT2: now I think the better way is to write the command and the call it, but function call()
is prefered for it. See a detailed post on SO on this topica detailed post on SO on this topic.