#4211 closed defect (fixed)
ST_Subdivide() on geometries with rings
Reported by: | morena | Owned by: | komzpa |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.5.1 |
Component: | postgis | Version: | 2.5.x -- EOL |
Keywords: | ST_Subdivide | Cc: |
Description
The ST_Subdivide() function on PostGIS 2.5.0 yields incorrect results for geometries (POLYGON) with rings (wholes).
To reproduce the issue:
DROP TABLE IF EXISTS test_geom; CREATE TABLE test_geom AS SELECT ST_GeomFromText('MULTIPOLYGON(((-88.2059 41.7325,-88.2060 41.7244,-88.1959 41.7241,-88.1959 41.7326,-88.2059 41.7325),(-88.1997 41.7289,-88.1996 41.7285,-88.1990 41.7285,-88.1990 41.7289,-88.1997 41.7289)))',4326) AS geom; DROP TABLE IF EXISTS test_geom_result; CREATE TABLE test_geom_result AS SELECT ST_Subdivide(geom) AS geom FROM test_geom;
Attached are the previews of the above.
View of test geometry (on either PostGIS 2.4.4 or PostGIS 2.5.0):
View of result on PostGIS 2.4.4:
View of result on PostGIS 2.5.0:
The two outputs were tested on following setup: PostGIS 2.4.4
SELECT PostGIS_Full_Version(); POSTGIS="2.4.4 r16526" PGSQL="100" GEOS="3.7.0dev-CAPI-1.11.0 r" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.1.2, released 2016/10/24" LIBXML="2.9.4" LIBJSON="0.12.1" RASTER
PostGIS 2.5.0
SELECT PostGIS_Full_Version(); POSTGIS="2.5.0 r16836" [EXTENSION] PGSQL="110" GEOS="3.7.0-CAPI-1.11.0 673b9939" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.3.2, released 2018/09/21" LIBXML="2.9.4" LIBJSON="0.12.1" RASTER
Attachments (3)
Change History (11)
by , 6 years ago
Attachment: | test_geom.png added |
---|
by , 6 years ago
Attachment: | postgis_2.4.4_test_geom_result.png added |
---|
by , 6 years ago
Attachment: | postgis_2.5.0_test_geom_result.png added |
---|
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Owner: | changed from | to
---|---|
Priority: | medium → high |
with ST_Subdivide(geom, 8) I am able to reproduce the issue.
comment:7 by , 6 years ago
morena, please try updating from latest branch and check that your data is all OK now. The case you reported should be OK starting from PostGIS 2.5.1.
Cannot reproduce.
Result I get:
is expected, as your geometry is already below default 256 points. What are you using for rendering? May it happen interior ring is lost somewhere else in the process?