Opened 6 years ago

Last modified 4 years ago

#4158 new defect

ST_Subdivide unable to subdivide isochrone

Reported by: komzpa Owned by: komzpa
Priority: medium Milestone: PostGIS GEOS
Component: postgis Version: 2.4.x
Keywords: Cc:

Description

21:16:53 [kom] > select distinct ST_IsValid(geom) from eventspace_isochrones;
┌────────────┐
│ st_isvalid │
├────────────┤
│ t          │
└────────────┘
(1 row)

Time: 1575,341 ms (00:01,575)
21:17:00 [kom] > with complex_areas_to_subdivide as (delete from eventspace_isochrones
where ST_NPoints(geom) > 255
returning minute, geom)
insert into eventspace_isochrones (minute, geom)
select minute,
    ST_Subdivide(geom, 255) geom
from complex_areas_to_subdivide;
ERROR:  XX000: lwcollection_construct: mixed dimension geometries: 0/2
LOCATION:  pg_error, lwgeom_pg.c:128
Time: 1227,466 ms (00:01,227)
21:18:56 [kom] > select postgis_full_version();
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                  postgis_full_version                                                                                                   │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ POSTGIS="2.5.0rc1 r16698" [EXTENSION] PGSQL="110" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.3, released 2017/11/20" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" RASTER │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
(1 row)

Time: 15,055 ms

Change History (9)

comment:1 by komzpa, 6 years ago

Issue is that POLYGON Z cannot be subdivided. If we clamp it to 2D it works:

21:18:59 [kom] > update eventspace_isochrones set geom = ST_Force2D(geom);
UPDATE 31
Time: 551,953 ms
21:20:26 [kom] > with complex_areas_to_subdivide as (delete from eventspace_isochrones
where ST_NPoints(geom) > 255
returning minute, geom)
insert into eventspace_isochrones (minute, geom)
select minute,
    ST_Subdivide(geom, 255) geom
from complex_areas_to_subdivide;
INSERT 0 9304
Time: 9014,916 ms (00:09,015)

comment:2 by robe, 6 years ago

Milestone: PostGIS 2.5.0PostGIS 3.0.0

comment:3 by pramsey, 5 years ago

Is this still active? You did a lot of subdivide work since, has it changed anything?

comment:4 by komzpa, 5 years ago

This one is technically more complex manifestation of #4471. We're intersecting 2D box with 3D geometries and get mixed outputs. A workaround is to ST_Force2D it before feeding into ST_Subdivide.

comment:5 by pramsey, 5 years ago

Owner: changed from pramsey to komzpa

comment:6 by pramsey, 5 years ago

I couldn't replicate #4471 against GEOS 3.8. Has this resolved in current version?

comment:7 by komzpa, 5 years ago

Milestone: PostGIS 3.0.0PostGIS 3.1.0

comment:8 by komzpa, 4 years ago

Going to be fixed with GEOS 3.9.

comment:9 by pramsey, 4 years ago

Milestone: PostGIS 3.1.0PostGIS GEOS
Note: See TracTickets for help on using tickets.