[OpenLayers-Dev] geodesic measures

Tim Schaub tschaub at opengeo.org
Tue Nov 11 16:02:29 EST 2008


Hey-

A contributor (mwa at sourcepole.ch?) posted a patch for approximating 
geodesic areas for polygons [1].

I have used this algorithm to give geometries a getGeodesicArea method. 
  In a similar way, I added a getGeodesicLength method using the 
Vincenty algorithm already in Util.

Combined, these give us handy methods for calculating metrics from our 
geometries as if they were projected onto the earth's surface.  Both of 
these calculations require that a projection is provided 
(Geographic/WGS84 is assumed if none is given).

This functionality allows a "geodesic" property to be added to the 
measure control.  So, if your map projection is properly set, and if you 
have provided the appropriate definition for that projection so a 
transform to Geographic/WGS84 can be done, you can use the measure 
control to do geodesic measures.

All this is wrapped up in a new patch for ticket 1819 [2].  If anybody 
cares to comment or test it out, that would be appreciated.

Tim

[1] http://trac.openlayers.org/attachment/ticket/1819/area_measurement.patch

[2] http://trac.openlayers.org/ticket/1819

-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list