[postgis-users] ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses equator
Paul Ramsey
pramsey at cleverelephant.ca
Fri Aug 25 10:24:14 PDT 2017
I think at proj 4.9 we flip over to using the geodetic functions in proj,
which are more robust and have fewer failure modes.
P
On Mon, Aug 21, 2017 at 2:33 PM, Peter Schmitt <pschmitt at gmail.com> wrote:
> Thanks Regina! Yes, it must be something with the version of GEOS, PROJ
> or GDAL. The query works fine on a AWS RDS instance with
>
> POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08
> September 2015" GDAL="GDAL 2.0.3, released 2016/07/01" LIBXML="2.9.1"
> LIBJSON="0.12" RASTER
>
> but failed with this Docker image: https://hub.docker.com/
> r/mdillon/postgis/
>
> 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
>
> Thanks again!
> Pete
>
> On Mon, Aug 21, 2017 at 3:05 PM, Regina Obe <lr at pcorp.us> wrote:
>
>> 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/md
>> illon/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
>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
>
>
>
> --
> Pete
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170825/f98780a1/attachment.html>
More information about the postgis-users
mailing list