[OSM-dev] Area calculation without transformation

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Mon Apr 22 16:10:35 UTC 2024


Hi,

GDAL 3.9 will have a new function OGR_G_GeodesicArea() 
https://github.com/OSGeo/gdal/pull/9552. It is using the same library 
https://geographiclib.sourceforge.io/ than Proj 
https://proj.org/en/9.4/geodesic.html and at least the results should be 
relatively accurate "The results are accurate to round-off for 
terrestrial ellipsoids (the error in the distance is less than 15 
nanometers, compared to 0.1 mm for Vincenty)". Maybe it is not the 
fastest alternative. See discussion 
https://sourceforge.net/p/geographiclib/discussion/1026620/thread/cdb8ad76/.

-Jukka Rahkonen-

Jochen Topf kirjoitti 2024-04-19 12:41:
> Hi!
> 
> I am bit late to the party... In osm2pgsql I am using boost::geometry
> for these kinds of things. I found that to be much faster than 
> GEOS/OGR.
> 
> https://github.com/osm2pgsql-dev/osm2pgsql/blob/master/src/geom-functions.cpp#L367-L379
> 
> Jochen
> 
> On Sun, Mar 24, 2024 at 03:44:24PM +0100, Florian Lohoff wrote:
>> Date: Sun, 24 Mar 2024 15:44:24 +0100
>> From: Florian Lohoff <f at zz.de>
>> To: dev at openstreetmap.org
>> Subject: [OSM-dev] Area calculation without transformation
>> 
>> 
>> Hi,
>> 
>> I am looking into performance issued with QA code of mine and i am at 
>> one
>> point i calculate the osm objects area.
>> 
>> I am using libosmium and gdal/OGR right now.
>> 
>> Now - to get a m² based area i am transforming into an planar EPSG
>> which seems to be the bottleneck of processing.
>> 
>> I now had a quick look at postgis'es lwgeom code for ST_Area using
>> a spheroid which my guess is much faster as i am on the very same 
>> spheroid
>> all the time.
>> 
>> Does anyone know of a c++ implementation nicely plugging into
>> libosmium/gdal/ogr processing just using the EPSG:4326?
>> 
>> Flo
>> --
>> Florian Lohoff                                                     
>> f at zz.de
>>   Any sufficiently advanced technology is indistinguishable from 
>> magic.
> 
> 
> 
>> _______________________________________________
>> dev mailing list
>> dev at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list