Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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!

Update:

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
done

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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 Aug 6 '12 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. –  lynxlynxlynx Aug 6 '12 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 Aug 7 '12 at 7:34
    
Anybody please? –  JPD Aug 10 '12 at 9:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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