[postgis-tickets] [PostGIS] #2918: Use GeographicLib functions for ST_Azimuth, ST_Distance and ST_Project

PostGIS trac at osgeo.org
Tue Sep 9 05:30:08 PDT 2014


#2918: Use GeographicLib functions for ST_Azimuth, ST_Distance and ST_Project
---------------------+------------------------------------------------------
 Reporter:  mwtoews  |       Owner:  pramsey
     Type:  patch    |      Status:  new    
 Priority:  medium   |   Milestone:         
Component:  postgis  |     Version:  trunk  
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by mwtoews):

 ST_Area has been updated to use GeographicLib, changes in GitHub PR.

 We can now do area calculations like this:
 {{{
 select ST_Area('POLYGON((0 0, 1 1, 1 0, 0 0))'::geography);
 -[ RECORD 1 ]-------------
 st_area | 6154854786.72143
 }}}
 whereas with trunk, it cannot do this:
 > ERROR:  ptarray_area_spheroid: cannot handle ptarray that crosses
 equator


 I've checked areas for various countries with
 [http://thematicmapping.org/downloads/TM_WORLD_BORDERS_SIMPL-0.3.zip this
 shapefile], and compared old and new results

 Picking a few countries with high/mid/low differences of areas, in terms
 of percent:
  * -0.48811% MB Martinique
  * -0.15857% SC Saint Kitts and Nevis
  * -0.00061% CA Canada
  * -0.00005% CH China
  * 0.00000% BR Brazil
  * 0.00000% RS Russia
  * 0.00015% US United States
  * 0.23673% AV Anguilla
  * 0.34825% BD Bermuda

 And as a difference of areas in km²:
  * -78.9457 km² ML Mali
  * -59.2028 km² CA Canada
  * -4.7327 km² CH China
  * 0.0000 km² BR Brazil
  * 0.00000 km² RS Russia
  * 14.3232 km² US United States
  * 48.1370 km² ET Ethiopia
  * 50.1431 km² NI Nigeria

 So this means that both results are <1% apart, but can be tens of km²
 difference for larger nations. Countries like Brasil and Russia, however,
 happen to calculate very similar areas.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2918#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list