[gdal-dev] Polygon area with intersection?

Frank Warmerdam warmerdam at pobox.com
Mon Jun 7 10:49:09 EDT 2010


Rudi von Staden wrote:
> Hi all,
> 
> I need to create a tool that will take a set of points (say in a csv 
> file) given in WGS84 lat/long, and work out the area of the outer hull 
> that encompasses the points. The points could be anywhere in Southern 
> Africa.
> 
> I was thinking to use the following approach (using gdal/ogr and Python, 
> since that's what I'm most familiar with):
> 1. write a function to return the outer hull as a polygon
> 2. clip to the four UTM zones covering the region (using Intersection())
> 3. reproject each sub-polygon to the appropriate utm zone using the 
> CoordinateTransformation class
> 4. return the sum of the values returned by GetArea()
> 
> Is it necessary to break up the area into UTM zones to get an accurate 
> area calculation? Is there perhaps an existing standalone tool that will 
> do this in an easier way? Would it work using Python bindings for gdal 
> and ogr?

Rudi,

The above approach would work, and would give pretty accurate results.
Depending on your need for accuracy you might find you could just
reproject the hull into some well behaved projection centered at the
centroid of the hull and compute the area on that without splitting
and summing.

This should all be doable with the python bindings for gdal/ogr (with
some of the work really being done under the covers by GEOS).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list