Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have thousands of shapefiles with coordinates in lat/long (-180 to +180 x, -90 to +90 y), that contain polygons of which I wish to calculate the area.

I'm using the Python GEOS/OGR/GDAL API. If I call the Area() function for each geometry, I'll get the 2D area, or the area on a Mercator projection (basically). Since the polygons are really on a sphere, I want to convert them to an equal area projection before I calculate the area. I was wondering if anyone had any experience with this on here.

Some reading of the documentation suggested there were functions somewhere in OSRSpatialReference to transform a point or geometry from one projection to another, but it wasn't quite clear to me exactly how to use this or what projection to use.

Any help would be greatly appreciated. Thanks much!

share|improve this question
up vote 2 down vote accepted

I would use org2ogr to do the reprojection of each file and wrap the command line in a for loop.

for i in *.shp
   x=`basename $i .shp`
   outfile = ${x}_eqa.shp
   ogr2ogr -t_srs epsg:xxxx $outfile $i

You'll need to go to to look up a relevant epsg code for an equal area projection for your region if you don't know one off the top of your head.

share|improve this answer
Thanks very much iant. – Ben Apr 20 '12 at 1:10

Your Answer


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.