Difference between two curvepolygon with same coordinates but not the same order
MONTICOLO Julien
Julien.MONTICOLO at strasbourg.eu
Mon Jul 27 08:16:03 PDT 2026
Hello everyone,
I find a difference (ST_DIFFERENCE) between two curvepolygons and the only difference is the order of the coordinates.
Bellow my configuration and how to reproduce.
-- configuration
SELECT version() ; -- PostgreSQL 16.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-26), 64-bit
SELECT postgis_version(); -- 3.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
-- how to reproduce
I have 4 coordinates A, B, C, D in EPSG=3948, RGF93 / Lambert-93, one of french main CRS zone.
They describe a pseudo-circle (that isn't a perfect circle) : A is the West point, B the North point, C the East point and D the South point.
A = 2039857.003 7263858.968
B = 2039857.799 7263859.772
C = 2039858.603 7263858.976
D = 2039857.807 7263858.172
I have a Curvepolygon ABCDA and a Curvepolygon inner ring ADCBA.
I tried to compute the difference between this two (I converted the inner ring hole into a Curvepolygon but always counterclockwise) :
SELECT
ST_AREA(
ST_DIFFERENCE(
ST_GeomFromEWKT('SRID=3948;
CURVEPOLYGON(
CIRCULARSTRING(
2039857.003 7263858.968, -- A
2039857.799 7263859.772, -- B
2039858.603 7263858.976, -- C
2039857.807 7263858.172, -- D
2039857.003 7263858.968 -- A
)
)'
),
ST_GeomFromEWKT('SRID=3948;
CURVEPOLYGON(
CIRCULARSTRING(
2039857.003 7263858.968, -- A
2039857.807 7263858.172, -- D
2039858.603 7263858.976, -- C
2039857.799 7263859.772, -- B
2039857.003 7263858.968 -- A
)
)'
)
)
)
;
-- result : 9.023311828629255e-10
I suspected 0.
I reduced the precision to 0 so no flotting point and then the difference gave 0.
I tried to get the difference between the circularstrings, nothing.
I think I missing something. Have you some explanations ?
Thank you in advance,
Best regards,
Julien Monticolo
-------------- next part --------------
Ce message est ?tabli ? usage exclusif de son destinataire.
Toute utilisation ou diffusion, partielle ou totale, doit ?tre pr?alablement autoris?e.
Tout message ?lectronique est susceptible d'alt?ration et son int?grit? ne peut ?tre assur?e.
L'exp?diteur d?cline toute responsabilit? au titre de ce message s'il a ?t? modifi? ou falsifi?.
Si vous n'?tes pas destinataire de ce message, merci de le d?truire et d'avertir l'exp?diteur.
Ville et Eurom?tropole de Strasbourg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20260727/b6b8523e/attachment.htm>
More information about the postgis-users
mailing list