[postgis-users] TR: strange behavior of ST_Area(geography)

Paul Ramsey pramsey at cleverelephant.ca
Mon Oct 16 05:48:37 PDT 2017


Werks fer me also:

 st_equals | eq_area | geog1 | geog2 | geog3 | geom
-----------+---------+-------+-------+-------+------
 t         | t       | t     | t     | t     | t


On Sun, Oct 15, 2017 at 6:07 AM, IIDA Tetsushi <hogeman at gmail.com> wrote:

> thank you, Olivier.
>
> sorry, i forgot to describe my environment.
> ----------------------------------------------------------------
>  PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (Debian
> 4.9.2-10) 4.9.2, 64-bit
>  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
>
> (docker image "mdillon/postgis")
>
>
> 2017-10-15 21:34 GMT+09:00 Olivier Leprêtre <o.lepretre at gmail.com>:
> > 9.6 and
> > "POSTGIS="2.3.2 r15302" GEOS="3.6.1-CAPI-1.10.1 r4317" PROJ="Rel. 4.9.1,
> 04 March 2015" GDAL="GDAL 2.1.3, released 2017/20/01" LIBXML="2.7.8"
> LIBJSON="0.12" TOPOLOGY RASTER"
> >
> > -----Message d'origine-----
> > De : Olivier Leprêtre [mailto:o.lepretre at gmail.com]
> > Envoyé : dimanche 15 octobre 2017 14:33
> > À : 'PostGIS Users Discussion'
> > Objet : RE: [postgis-users] strange behavior of ST_Area(geography)
> >
> > I tested your query with 9.6 all tests return true.
> >
> > Olivier
> >
> > -----Message d'origine-----
> > De : postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] De la
> part de IIDA Tetsushi Envoyé : dimanche 15 octobre 2017 13:42 À :
> postgis-users at lists.osgeo.org Objet : [postgis-users] strange behavior of
> ST_Area(geography)
> >
> > Hi,
> >
> > These polygons have the same shape but orientation.
> >
> > --- my query -----
> > WITH poly AS (
> >  SELECT
> >   ST_SetSRID(ST_GeomFromText(
> >    'POLYGON((138.002 37.001, 138.003 37.0010, 138.003 37.0013, 138.002
> 37.001))'
> >    ),4326) g1,
> >   ST_SetSRID(ST_GeomFromText(
> >    'POLYGON((138.002 37.001, 138.003 37.0013, 138.003 37.0010, 138.002
> 37.001))'
> >    ),4326) g2
> > )
> > SELECT ST_Equals(g1,g2),
> >  ST_Area(g1)                     = ST_Area(g2) AS eq_area,
> >  ST_Area(g1::geography)          = ST_Area(g2::geography) AS geog1,
> >  ST_Area(g1::geography, false)   = ST_Area(g2::geography, false) AS
> geog2,
> >  ST_Area(g1::geography)          = ST_Area(ST_Reverse(g2)::geography)
> AS geog3,
> >  ST_Area(ST_Transform(g1,32654)) = ST_Area(ST_Transform(g2,32654)) AS
> geom  FROM poly;
> >
> > ----- output -----
> >
> >  st_equals | eq_area | geog1 | geog2 | geog3 | geom
> > -----------+---------+-------+-------+-------+------
> >  t         | t       | f     | t     | t     | t
> >
> >
> > I expected all these tests return true.
> > Is this behavior by spec?
> >
> > Thanks
> >
> > --
> > hogeman
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-users
> >
> >
> > ---
> > L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> > https://www.avast.com/antivirus
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-users
>
>
>
> --
> Iida, Tetsushi
> 飯田 哲士
> _______________________________________________
> 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/20171016/083bfef1/attachment.html>


More information about the postgis-users mailing list