Ticket #1884 (new defect)

Opened 12 months ago

Last modified 12 months ago

st_centroid fails on a small polygon [fixed by GEOS-3.3.5]

Reported by: csandor Owned by: pramsey
Priority: medium Milestone: PostGIS GEOS
Component: postgis Version: 1.5.X
Keywords: Cc:

Description

When I do this select on a very small polygon made of 3 points I get an empty collection:

select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.5286666667
25.2101666667,56.529 25.2105,56.5288333333 25.2103333333,56.5286666667
25.2101666667))')));

st_astext


GEOMETRYCOLLECTION EMPTY

(1 row)

If I modify one value just a little bit (56.529=>56.529000000001) I get correct results:

select ST_AsText(ST_Centroid(ST_GeomFromText('POLYGON((56.5286666667
25.2101666667,56.529000000001 25.2105,56.5288333333
25.2103333333,56.5286666667 25.2101666667))')));

st_astext


POINT(56.5288333333337 25.2103333333333)

(1 row)

Sandro Santilli confirmed it is bug.

Change History

Changed 12 months ago by strk

  • milestone changed from PostGIS 1.5.4 to PostGIS GEOS

Changed 12 months ago by strk

  • summary changed from st_centroid fails on a small polygon to st_centroid fails on a small polygon [fixed by GEOS-3.3.5]

GEOS-3.3.5 (to be released within a week) will contain a fix for this

Note: See TracTickets for help on using tickets.