Difference between two curvepolygon with same coordinates but not the same order

MONTICOLO Julien <[email protected]> Mon, 27 Jul 2026 15:16:03 +0000
Newsgroups gmane.comp.gis.postgis
Message-ID <[email protected]>
--===============1656853369615149175==
Content-Language: fr-FR
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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=3D1 USE_PROJ=3D1 USE_STATS=3D1

-- how to reproduce

I have 4 coordinates A, B, C, D in EPSG=3D3948, 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 =3D 2039857.003 7263858.968
B =3D 2039857.799 7263859.772
C =3D 2039858.603 7263858.976
D =3D 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 r=
ing hole into a Curvepolygon but always counterclockwise) :

SELECT
    ST_AREA(
        ST_DIFFERENCE(
            ST_GeomFromEWKT('SRID=3D3948;
                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=3D3948;
                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 g=
ave 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


--===============1656853369615149175==
Content-Type: multipart/alternative; boundary="===============8609504108435013743=="
MIME-Version: 1.0
Content-Disposition: inline

--===============8609504108435013743==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Ce message est =C3=A9tabli =C3=A0 usage exclusif de son destinataire.
Toute utilisation ou diffusion, partielle ou totale, doit =C3=AAtre pr=C3=
=A9alablement autoris=C3=A9e.

Tout message =C3=A9lectronique est susceptible d'alt=C3=A9ration et son int=
=C3=A9grit=C3=A9 ne peut =C3=AAtre assur=C3=A9e.
L'exp=C3=A9diteur d=C3=A9cline toute responsabilit=C3=A9 au titre de ce mes=
sage s'il a =C3=A9t=C3=A9 modifi=C3=A9 ou falsifi=C3=A9.

Si vous n'=C3=AAtes pas destinataire de ce message, merci de le d=C3=A9trui=
re et d'avertir l'exp=C3=A9diteur.

Ville et Eurom=C3=A9tropole de Strasbourg
--===============8609504108435013743==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<br><br>

<div style=3D"font-size:8pt; line-height:10pt; font-family: 'Calibri','Aria=
l','sans-serif'; background-color:#D5EAFF; border:1px dotted #003333; paddi=
ng:.6em; ">

Ce message est =C3=A9tabli =C3=A0 usage exclusif de son destinataire.<br>

Toute utilisation ou diffusion, partielle ou totale, doit =C3=AAtre pr=C3=
=A9alablement autoris=C3=A9e.<br>

<br>

Tout message =C3=A9lectronique est susceptible d'alt=C3=A9ration et son int=
=C3=A9grit=C3=A9 ne peut =C3=AAtre assur=C3=A9e.<br>

 L'exp=C3=A9diteur d=C3=A9cline toute responsabilit=C3=A9 au titre de ce me=
ssage s'il a =C3=A9t=C3=A9 modifi=C3=A9 ou falsifi=C3=A9.<br>

<br>

Si vous n'=C3=AAtes pas destinataire de ce message, merci de le d=C3=A9trui=
re et d'avertir l'exp=C3=A9diteur.<br>

<br>

<span style=3D"padding-top:10px; font-weight:bold; font-size:10pt; font-fam=
ily: 'Calibri','Arial','sans-serif'; ">Ville et Eurom=C3=A9tropole de Stras=
bourg</span>
--===============8609504108435013743==--

--===============1656853369615149175==--