Posts Tagged ‘coordinate system’

Using OGR2OGR to re-project a shape file

Friday, May 30th, 2008

OGR2OGR is a great command line tool for GIS format conversions providing support for all the ‘mainstream’ formats as well as plenty of more obscure ones.  It is also useful for changing the projection & coordinate system of a map layer.  The syntax for this is :

ogr2ogr -f "ESRI Shapefile" original.shp wgs84.shp -s_srs EPSG:27700 -t_srs EPSG:4326

where in this case we are re-projecting ‘original.shp’ from OSGB36 British National Grid to Longitude / Lattitude WGS84 and called ‘wgs84.shp’.

The re-projection can also be invoked as part of a format conversion also, like this :

ogr2ogr -f "MapInfo File" original.tab wgs84.shp -s_srs EPSG:27700 -t_srs EPSG:4326

where we convert the file from a MapInfo file to a Shapefile.