[postgis-users] strange behavior of ST_Area(geography)
Olivier Leprêtre
o.lepretre at gmail.com
Sun Oct 15 05:32:47 PDT 2017
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
More information about the postgis-users
mailing list