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

Possible Duplicate:
What is the most accurate coordinate system for calculating areas of polygons?

In our Postgres/Postgis database we store polygons in a column defined as lonlat/EPSG:4326, as it may contain data from anywhere in the world.

We have a requirement to calculate the surface area (i.e. in square meters or hectares). The method ST_Area can perform the calculation but returns the answer in the used coordinate systems units. That is, it returns the area as what I believe is "square degrees". As the size of a degree is variable depending on the location in the world, this does not make much sense.

One solution is to transform (ST_Transform) the polygon to another crs before calculating the area, perhaps the appropriate UTM32 zone, but that will require us to dynamically determine the zone first. Alternatively we could always transform to the Google Mercator (EPSG:900913), but we fear for the precision.

Any inputs?

share|improve this question

marked as duplicate by whuber May 30 '12 at 15:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

try SELECT ST_Area(geom::geography) – Mike T May 30 '12 at 19:40
up vote 7 down vote accepted

I found a function to return the UTM zone for any point on the PostGIS wiki: utmzone()

Using that you could do:

ST_Transform(the_geom, utmzone(ST_Centroid(the_geom))
FROM polygons

HTH, Micha

share|improve this answer
Could you tell me what unit the result is? (km^2, or hecta, or m^2) Thanks! – Jackie Dec 3 '14 at 10:05
The calculations of ST_Area (and other functions) will always be in the same units as the Coordinate System. The above refers to UTM, with units in meters, so the area will be sq meters. – Micha Dec 4 '14 at 12:31

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