[postgis-users] ST_Centroid error on very small polygon
Hi List, I cannot find answer to this phenomenon: When I do this select on a very small polygon made of 3 points I get an empty collection: VT=# select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.528667 25.210167,56.529 25.2105,56.528833 25.210333,56.528667 25.210167))'))); st_astext -- GEOMETRYCOLLECTION EMPTY (1 row) If I modify one value just a little bit (56.529=56.5291) I get correct results: VT=# select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.528667 25.210167,56.5291 25.2105,56.528833 25.210333,56.528667 25.210167))'))); st_astext -- POINT(56.52887 25.21033) (1 row) Any of you seen such thing? Thank you very much for your help! Csaba Versions: POSTGIS=1.5.2 GEOS=3.2.2-CAPI-1.6.2 PROJ=Rel. 4.7.1, 23 September 2009 LIBXML=2.7.6 USE_STATS PostgreSQL 8.4.11 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit -- Sándor Csaba szolgáltatási vezető ViaMap Kft. Székhely/postacím: 2176 Erdőkürt, Téglaház utca 4. Iroda: 1076 Budapest, Garay u. 29-31. I. 1. (EMLA Környezeti Management és Jog Egyesület) Tel: +3630/9605853 Fax: +3617002542 ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] ST_Centroid error on very small polygon
On Fri, Jun 22, 2012 at 11:39:52AM +0200, Sandor Csaba wrote: VT=# select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.528667 25.210167,56.529 25.2105,56.528833 25.210333,56.528667 25.210167))'))); st_astext -- GEOMETRYCOLLECTION EMPTY (1 row) ... Any of you seen such thing? I can reproduce this. The polygon is valid. Definitely a bug. Could you file a ticket please ? --strk; Sent from our free software http://www.gnu.org/philosophy/free-sw.html ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] ST_Centroid error on very small polygon
Sorry for mixing threads up in the conversation. I will try to file the ticket Csaba On 22 June 2012 12:30, Sandro Santilli s...@keybit.net wrote: On Fri, Jun 22, 2012 at 11:39:52AM +0200, Sandor Csaba wrote: VT=# select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.528667 25.210167,56.529 25.2105,56.528833 25.210333,56.528667 25.210167))'))); st_astext -- GEOMETRYCOLLECTION EMPTY (1 row) ... Any of you seen such thing? I can reproduce this. The polygon is valid. Definitely a bug. Could you file a ticket please ? --strk; Sent from our free software http://www.gnu.org/philosophy/free-sw.html ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -- Sándor Csaba szolgáltatási vezető ViaMap Kft. Székhely/postacím: 2176 Erdőkürt, Téglaház utca 4. Iroda: 1076 Budapest, Garay u. 29-31. I. 1. (EMLA Környezeti Management és Jog Egyesület) Tel: +3630/9605853 Fax: +3617002542 ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users