[postgis-users] ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses equator
Regina Obe
lr at pcorp.us
Mon Aug 21 14:05:47 PDT 2017
Hmm something seems a little fishy with this. I'm running 2.3.3 so I guess it's possible it's something we fixed in PostGIS 2.3.3.
When I run:
SELECT ST_Area(ST_GeographyFromText('POLYGON((40 0.009,40.1 0.009,40.1 0,40 0,40 0.009))'));
I get:
11078167.65815
I think since version 2.2.0 or 2.3, I forget which, the geographicLab library (which requires Proj 4.9+) kicks in so it's possible I'm not having the same issue because I'm using a newer Proj version so I'm using the improved calc stuff.
This is the version I'm using.
POSTGIS="2.3.3 r15473" GEOS="3.6.1-CAPI-1.10.1 r4317" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.2.1, released 2017/06/23" LIBXML="2.7.8" LIBJSON="0.12" RASTER
From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Peter Schmitt
Sent: Monday, August 21, 2017 4:31 PM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses equator
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/10b59b53/attachment.html>
More information about the postgis-users
mailing list