[postgis-users] ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses equator

Peter Schmitt pschmitt at gmail.com
Mon Aug 21 13:31:04 PDT 2017


Hi,

The following query:

>  SELECT ST_Area(ST_GeographyFromText('POLYGON((40 0.009,40.1 0.009,40.1
0,40 0,40 0.009))'));

returns the error:

> ptarray_area_spheroid: cannot handle ptarray that crosses equator

I am using Postgis-2.3 provided by https://hub.docker.com/r/mdillon/postgis/

postgis_full_version =  POSTGIS="2.3.2 r15302" GEOS="3.4.2-CAPI-1.8.2
r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released
2013/08/26" LIBXML="2.9.1" LIBJSON="0.11.99" RASTER

I believe the geometry is valid.  I can pass the error by
setting use_spheroid=false, like so:

> SELECT ST_Area(ST_GeographyFromText('POLYGON((40 0.009,40.1 0.009,40.1
0,40 0,40 0.009))'), false);

However, I would like to use the sphere everywhere else in my application.
Can anyone provide some insight?  I found something reporting this should
not hapen on Postgis >= 2.2:
https://gis.stackexchange.com/questions/169436/postgis-polygons-lying-on-the-equator/169482#169482

Thanks!
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170821/e6fe2458/attachment.html>


More information about the postgis-users mailing list