Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZwZX-0007G0-En for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 13:09:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jZwZT-0006n5-MN for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 13:09:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZwZT-0006mq-Cy for pgsql-general@lists.postgresql.org; Sat, 16 May 2020 13:09:43 +0000 Received: from smtp-zimbra.meteo.fr ([137.129.16.22] helo=celebrian1.meteo.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZwZL-0000nh-My for pgsql-general@lists.postgresql.org; Sat, 16 May 2020 13:09:42 +0000 Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id 072461C21B7 for ; Sat, 16 May 2020 15:09:34 +0200 (CEST) Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id oPR-F3Y3Sr9Y for ; Sat, 16 May 2020 15:09:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id E17881C2205 for ; Sat, 16 May 2020 15:09:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at celebrian1.meteo.fr Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SADOap4JSao7 for ; Sat, 16 May 2020 15:09:33 +0200 (CEST) Received: from zumba5.meteo.fr (zumba5 [172.31.9.201]) by celebrian1.meteo.fr (Postfix) with ESMTP id C90F01C21B7 for ; Sat, 16 May 2020 15:09:33 +0200 (CEST) Date: Sat, 16 May 2020 15:09:33 +0200 (CEST) From: PALAYRET Jacques To: pgsql-general@lists.postgresql.org Message-ID: <1529649361.3955401.1589634573649.JavaMail.zimbra@meteo.fr> In-Reply-To: <1305841182.3445338.1589533315925.JavaMail.zimbra@meteo.fr> References: <1305841182.3445338.1589533315925.JavaMail.zimbra@meteo.fr> Subject: Re: Circles with circle() vs ST_Buffer() Equality equalities MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_6f5b6286-9d9a-4fa2-969e-0c91dd98a271" X-Originating-IP: [172.31.9.204] X-Mailer: Zimbra 8.7.11_GA_3822 (ZimbraWebClient - FF76 (Win)/8.7.11_GA_3822) Thread-Topic: Circles with circle() vs ST_Buffer() Equality equalities Thread-Index: GcmNfuq5AWS/GJROwfXt+fgWNaTXi9dRh+wn List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_6f5b6286-9d9a-4fa2-969e-0c91dd98a271 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello,=20 Sorry, forget my questions.=20 I checked the differences between the 2 polygons too quickly.=20 Actually, I checked only some points and some attributes :=20 SELECT ST_Area(geometry), ST_Perimeter(geometry), ST_NPoints(ST_ExteriorRin= g(geometry))=20 FROM (=20 SELECT polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::double precis= ion))::geometry=20 UNION=20 SELECT ST_Buffer('POINT(1 2)'::geometry, 0.5::double precision)=20 ) t(geometry)=20 ;=20 st_area | st_perimeter | st_npoints=20 -------------------+------------------+------------=20 0.780361288064513 | 3.13654849054594 | 33=20 0.780361288064513 | 3.13654849054594 | 33=20 ----------> exactly the same results with the 2 polygons=20 ...=20 ----------> But, NOT all the points are identical :=20 SELECT ST_AsText((g1).geom) FROM (=20 SELECT st_dumppoints(ST_ExteriorRing(geometry))=20 FROM (=20 SELECT polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::double precis= ion))::geometry=20 ) t1(geometry)=20 )t11(g1)=20 EXCEPT=20 SELECT ST_AsText((g2).geom) FROM (=20 SELECT st_dumppoints(ST_ExteriorRing(geometry))=20 FROM (=20 SELECT ST_Buffer('POINT(1 2)'::geometry, 0.5::double precision)=20 ) t2(geometry)=20 )t22(g2)=20 ORDER BY 1 ;=20 st_astext=20 -------------------------------------------=20 POINT(0.509607359798385 1.90245483899194)=20 POINT(0.509607359798385 2.09754516100806)=20 POINT(0.538060233744357 2.19134171618254)=20 POINT(0.584265193848727 1.7222148834902)=20 POINT(0.584265193848727 2.2777851165098)=20 POINT(0.646446609406726 1.64644660940673)=20 POINT(0.646446609406726 2.35355339059327)=20 POINT(0.722214883490199 1.58426519384873)=20 POINT(0.722214883490199 2.41573480615127)=20 POINT(0.808658283817455 1.53806023374436)=20 POINT(0.808658283817455 2.46193976625564)=20 POINT(0.902454838991936 1.50960735979838)=20 POINT(0.902454838991936 2.49039264020162)=20 POINT(1 2.5)=20 POINT(1.46193976625564 2.19134171618254)=20 POINT(1.49039264020162 2.09754516100806)=20 (16 lignes)=20 SELECT ST_AsText((g1).geom) FROM (=20 SELECT st_dumppoints(ST_ExteriorRing(geometry))=20 FROM (=20 SELECT ST_Buffer('POINT(1 2)'::geometry, 0.5::double precision)=20 ) t1(geometry)=20 )t11(g1)=20 EXCEPT=20 SELECT ST_AsText((g2).geom) FROM (=20 SELECT st_dumppoints(ST_ExteriorRing(geometry))=20 FROM (=20 SELECT polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::double precis= ion))::geometry=20 ) t2(geometry)=20 )t22(g2)=20 ORDER BY 1 ;=20 st_astext=20 -------------------------------------------=20 POINT(0.509607359798384 2.09754516100806)=20 POINT(0.509607359798385 1.90245483899193)=20 POINT(0.538060233744356 2.19134171618254)=20 POINT(0.584265193848726 2.2777851165098)=20 POINT(0.584265193848728 1.7222148834902)=20 POINT(0.646446609406725 2.35355339059327)=20 POINT(0.646446609406727 1.64644660940673)=20 POINT(0.722214883490197 2.41573480615127)=20 POINT(0.7222148834902 1.58426519384873)=20 POINT(0.808658283817453 2.46193976625564)=20 POINT(0.808658283817456 1.53806023374436)=20 POINT(0.902454838991934 2.49039264020161)=20 POINT(0.902454838991937 1.50960735979838)=20 POINT(0.999999999999998 2.5)=20 POINT(1.46193976625564 2.19134171618255)=20 POINT(1.49039264020161 2.09754516100807)=20 (16 lignes)=20 =3D> It is a bit weird, but it seems there are slight differences on some p= oints.=20 For example :=20 POINT(1 2.5) for polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::dou= ble precision))::geometry=20 and=20 POINT(0.999999999999998 2.5) for ST_Buffer('POINT(1 2)'::geometry, 0.5::dou= ble precision)=20 I guess it comes from rounding because the start point is not the same for = the 2 polygons.=20 ----- M=C3=A9t=C3=A9o-France -----=20 PALAYRET JACQUES=20 DCSC/MBD=20 jacques.palayret@meteo.fr=20 Fixe : +33 561078319=20 --=_6f5b6286-9d9a-4fa2-969e-0c91dd98a271 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hello,

Sorry, forget my question= s.
I checked the differences between the 2 polygons too quickly.
Actu= ally, I checked only some points and some attributes :

SELECT ST_Are= a(geometry), ST_Perimeter(geometry), ST_NPoints(ST_ExteriorRing(geometry))<= br>FROM (
SELECT polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::= double precision))::geometry
UNION
SELECT ST_Buffer('POINT(1 2)'::geo= metry, 0.5::double precision)
) t(geometry)
;
   &n= bsp;  st_area      |   st_perimeter=    | st_npoints
-------------------+------------------+-------= -----
 0.780361288064513 | 3.13654849054594 |   &nbs= p;     33
 0.780361288064513 | 3.13654849054594= |         33
----------> exa= ctly the same results with the 2 polygons
...

----------> But,= NOT all the points are identical :

SELECT ST_AsText((g1).geom) FROM= (
SELECT st_dumppoints(ST_ExteriorRing(geometry))
FROM (
SELECT p= olygon(32, circle('POINT(1 2)'::geometry::point, 0.5::double precision))::g= eometry
) t1(geometry)
)t11(g1)
EXCEPT
SELECT ST_AsText((g2).ge= om) FROM (
SELECT st_dumppoints(ST_ExteriorRing(geometry))
FROM (
= SELECT ST_Buffer('POINT(1 2)'::geometry, 0.5::double precision)
) t2(geo= metry)
)t22(g2)
ORDER BY 1 ;
      &= nbsp;          st_astext
--= -----------------------------------------
 POINT(0.509607359798385 = 1.90245483899194)
 POINT(0.509607359798385 2.09754516100806)
&nb= sp;POINT(0.538060233744357 2.19134171618254)
 POINT(0.5842651938487= 27 1.7222148834902)
 POINT(0.584265193848727 2.2777851165098)
&n= bsp;POINT(0.646446609406726 1.64644660940673)
 POINT(0.646446609406= 726 2.35355339059327)
 POINT(0.722214883490199 1.58426519384873) POINT(0.722214883490199 2.41573480615127)
 POINT(0.808658283= 817455 1.53806023374436)
 POINT(0.808658283817455 2.46193976625564)=
 POINT(0.902454838991936 1.50960735979838)
 POINT(0.902454= 838991936 2.49039264020162)
 POINT(1 2.5)
 POINT(1.46193976= 625564 2.19134171618254)
 POINT(1.49039264020162 2.09754516100806)<= br>(16 lignes)

SELECT ST_AsText((g1).geom) FROM (
SELECT st_dumpp= oints(ST_ExteriorRing(geometry))
FROM (
SELECT ST_Buffer('POINT(1 2)'= ::geometry, 0.5::double precision)
) t1(geometry)
)t11(g1)
EXCEPT<= br>SELECT ST_AsText((g2).geom) FROM (
SELECT st_dumppoints(ST_ExteriorRi= ng(geometry))
FROM (
SELECT polygon(32, circle('POINT(1 2)'::geometry= ::point, 0.5::double precision))::geometry
) t2(geometry)
)t22(g2)ORDER BY 1 ;
         &nbs= p;       st_astext
-----------------------= --------------------
 POINT(0.509607359798384 2.09754516100806)
=  POINT(0.509607359798385 1.90245483899193)
 POINT(0.5380602337= 44356 2.19134171618254)
 POINT(0.584265193848726 2.2777851165098) POINT(0.584265193848728 1.7222148834902)
 POINT(0.646446609= 406725 2.35355339059327)
 POINT(0.646446609406727 1.64644660940673)=
 POINT(0.722214883490197 2.41573480615127)
 POINT(0.722214= 8834902 1.58426519384873)
 POINT(0.808658283817453 2.46193976625564= )
 POINT(0.808658283817456 1.53806023374436)
 POINT(0.90245= 4838991934 2.49039264020161)
 POINT(0.902454838991937 1.50960735979= 838)
 POINT(0.999999999999998 2.5)
 POINT(1.46193976625564 = 2.19134171618255)
 POINT(1.49039264020161 2.09754516100807)
(16 = lignes)

=3D> It is a bit weird, but it seems there are slight dif= ferences on some points.
For example :
POINT(1 2.5)   for&n= bsp;  polygon(32, circle('POINT(1 2)'::geometry::point, 0.5::double pr= ecision))::geometry
and
POINT(0.999999999999998 2.5)   for&= nbsp;  ST_Buffer('POINT(1 2)'::geometry, 0.5::double precision)
I guess it comes from rounding because the start point is not the same for= the 2 polygons.


----- M=C3=A9t=C3=A9o-France -----
PA= LAYRET JACQUES
DCSC/MBD
jacques.palayret@meteo.fr
Fixe : +33 561= 078319

--=_6f5b6286-9d9a-4fa2-969e-0c91dd98a271--