[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses equator
From:       Paul Ramsey <pramsey () cleverelephant ! ca>
Date:       2017-08-25 17:24:14
Message-ID: CACowWR1HwLBtp_=B9zGhi4d33scgZNGj2JJwbyzP=7+=+CCmzQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@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@lists.osgeo.org] *On
>> Behalf Of *Peter Schmitt
>> *Sent:* Monday, August 21, 2017 4:31 PM
>> *To:* postgis-users@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@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
>
>
>
> --
> Pete
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>

[Attachment #5 (text/html)]

<div dir="ltr">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.<div><br></div><div>P</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Mon, Aug 21, 2017 at 2:33 PM, Peter Schmitt <span \
dir="ltr">&lt;<a href="mailto:pschmitt@gmail.com" \
target="_blank">pschmitt@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div>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  </div><div><br></div>POSTGIS=&quot;2.2.2 r14797&quot; \
GEOS=&quot;3.5.0-CAPI-1.9.0 r4084&quot; PROJ=&quot;Rel. 4.9.2, 08 September \
2015&quot; GDAL=&quot;GDAL 2.0.3, released 2016/07/01&quot; LIBXML=&quot;2.9.1&quot; \
LIBJSON=&quot;0.12&quot; RASTER<br><div class="gmail_extra"><br></div><div \
class="gmail_extra">but failed with this Docker image:  <a \
href="https://hub.docker.com/r/mdillon/postgis/" style="font-size:12.8px" \
target="_blank">https://hub.docker.com/<wbr>r/mdillon/postgis/</a></div><span \
class=""><div class="gmail_extra"><br></div><div class="gmail_extra"><span \
style="font-size:12.8px">POSTGIS=&quot;2.3.2 r15302&quot; GEOS=&quot;3.4.2-CAPI-1.8.2 \
r3921&quot; PROJ=&quot;Rel. 4.8.0, 6 March 2012&quot; GDAL=&quot;GDAL 1.10.1, \
released 2013/08/26&quot; LIBXML=&quot;2.9.1&quot; LIBJSON=&quot;0.11.99&quot; \
RASTER</span><br></div><div class="gmail_extra"><br></div></span><div \
class="gmail_extra">Thanks again!</div><div class="gmail_extra">Pete</div><div \
class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Aug 21, \
2017 at 3:05 PM, Regina Obe <span dir="ltr">&lt;<a href="mailto:lr@pcorp.us" \
target="_blank">lr@pcorp.us</a>&gt;</span> wrote:<br></div></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div lang="EN-US"><div \
class="m_2044473527310521993gmail-m_1891356602349389848WordSection1"><p \
class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hmm \
something seems a little fishy with this.   I&#39;m running 2.3.3 so I guess it&#39;s \
possible it&#39;s something we fixed in PostGIS 2.3.3.<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">When I \
run:<u></u><u></u></span></p><span class="m_2044473527310521993gmail-"><p \
class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">SELECT \
ST_Area(ST_GeographyFromText(&#39;<wbr>POLYGON((40 0.009,40.1 0.009,40.1 0,40 0,40 \
0.009))&#39;));<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p></span><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I \
get:<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">11078167.65815<u></u><u></u></span></p><p \
class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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&#39;s possible I&#39;m not having the same issue because \
I&#39;m using a newer Proj version so I&#39;m using the improved calc \
stuff.<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">This is \
the version I&#39;m using.<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">POSTGIS=&quot;2.3.3 \
r15473&quot; GEOS=&quot;3.6.1-CAPI-1.10.1 r4317&quot; PROJ=&quot;Rel. 4.9.1, 04 March \
2015&quot; GDAL=&quot;GDAL 2.2.1, released 2017/06/23&quot; LIBXML=&quot;2.7.8&quot; \
LIBJSON=&quot;0.12&quot; RASTER<u></u><u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal"><span \
style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u>  \
<u></u></span></p><p class="MsoNormal" style="margin-left:0.5in"><b><span \
style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span \
style="font-size:11pt;font-family:Calibri,sans-serif"> postgis-users [mailto:<a \
href="mailto:postgis-users-bounces@lists.osgeo.org" \
target="_blank">postgis-users-bounces@<wbr>lists.osgeo.org</a>] <b>On Behalf Of \
</b>Peter Schmitt<br><b>Sent:</b> Monday, August 21, 2017 4:31 PM<br><b>To:</b> <a \
href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br><b>Subject:</b> [postgis-users] \
ST_Area(geog): ptarray_area_spheroid: cannot handle ptarray that crosses \
equator<u></u><u></u></span></p><div><div class="m_2044473527310521993gmail-h5"><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p><div><p \
class="MsoNormal" style="margin-left:0.5in">Hi,<u></u><u></u></p><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in">The following \
query:<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in">&gt;   SELECT \
ST_Area(ST_GeographyFromText(&#39;<wbr>POLYGON((40 0.009,40.1 0.009,40.1 0,40 0,40 \
0.009))&#39;));<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in">returns the error:  <u></u><u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in">&gt;  ptarray_area_spheroid: cannot \
handle ptarray that crosses equator<u></u><u></u></p><div><p class="MsoNormal" \
style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in">I am using Postgis-2.3 provided by  <a \
href="https://hub.docker.com/r/mdillon/postgis/" \
target="_blank">https://hub.docker.com/r/md<wbr>illon/postgis/</a><u></u><u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in">postgis_full_version =    \
POSTGIS=&quot;2.3.2 r15302&quot; GEOS=&quot;3.4.2-CAPI-1.8.2 r3921&quot; \
PROJ=&quot;Rel. 4.8.0, 6 March 2012&quot; GDAL=&quot;GDAL 1.10.1, released \
2013/08/26&quot; LIBXML=&quot;2.9.1&quot; LIBJSON=&quot;0.11.99&quot; \
RASTER<u></u><u></u></p></div><div><div><p class="MsoNormal" \
style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in">I believe the geometry is valid.   I can pass the error by \
setting  use_spheroid=false, like so:<u></u><u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in">&gt; SELECT \
ST_Area(ST_GeographyFromText(&#39;<wbr>POLYGON((40 0.009,40.1 0.009,40.1 0,40 0,40 \
0.009))&#39;), false);<u></u><u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in"><u></u>  <u></u></p></div><div><p class="MsoNormal" \
style="margin-left:0.5in">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 &gt;= 2.2:  <a \
href="https://gis.stackexchange.com/questions/169436/postgis-polygons-lying-on-the-equator/169482#169482" \
target="_blank">https://gis.stackexchange<wbr>.com/questions/169436/postgis-<wbr>polygons-lying-on-the-equator/<wbr>169482#169482</a><u></u><u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  <u></u></p></div><p \
class="MsoNormal" style="margin-left:0.5in">Thanks!<u></u><u></u></p><div><p \
class="MsoNormal" style="margin-left:0.5in">Pete<u></u><u></u></p></div><div><p \
class="MsoNormal" style="margin-left:0.5in"><u></u>  \
<u></u></p></div></div></div></div></div></div></div></div><br></div></div>______________________________<wbr>_________________<br>
 postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/postgis-users</a><span \
class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span \
class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div \
class="m_2044473527310521993gmail_signature">Pete</div> </font></span></div></div>
<br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>



[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic