I'm trying to use ogr2ogr to reproject some shapefiles. The projection I wish to use is Behrmann equal-area. I cannot find an EPSG code to use for the '-t_srs' part of the syntax. Is there any way around this? The best I can find is this - http://spatialreference.org/ref/esri/54017/

Any help much appreciated!


for file in $INPUT/*.shp ; do
ogr2ogr -t_srs PROJCS[\"World_Behrmann\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"WGS_1984  \",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Behrmann\"],PARAMETER[\"False_Easting\",0],PARAMETER[\"False_Northing\",0],PARAMETER[\"Central_Meridian\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"54017\"]] $OUTPUT/$file $file

This is now what I have. Apart from inverted commas, i'm not sure what else needs to be escaped in this statement. Any ideas?

1 Answer 1


JPD: Yes! You don't have to enter an EPSG Code in -t_srs - you can in fact enter the WKT instead. Try taking the OGC WKT String from spatialreference.org and entering that. I do recall hearing issues about properly escaping characters, so you may have some trouble with that.

  • Thanks very much for your reply. I'm now heading in the right direction. I have updated my question to show the code i'm now using. Any further comment would be much appreciated!
    – JPD
    Commented Aug 6, 2012 at 15:53
  • Try encasing the whole string in single quotes. Now you have multiple words (from the shell's and ogr's view) and with additional quoting, you can probably remove the escapes for double quotes. Commented Aug 6, 2012 at 17:02
  • I've only been using bash/ogr for a week, could you expand on where these additional quotes should go please?
    – JPD
    Commented Aug 7, 2012 at 7:34
  • Anybody please?
    – JPD
    Commented Aug 10, 2012 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.