Opened 11 years ago

Closed 11 years ago

#2378 closed defect (fixed)

ST_CollectionExtract forms invalid polygons

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.4
Component: documentation Version: 2.0.x
Keywords: Cc:

Description

ST_CollectionExtract is similarly flawed as noted in #2377 for ST_CollectionHomogenize

SELECT       
    ST_AsText(ST_CollectionExtract(ST_Split(g1.geom1, g1.geom2),3))
    As geom
FROM (SELECT 
  ST_GeomFromText('POLYGON((2 4.5,3 2.6,3 1.8,2 0,-1.5 2.2,
   0.056 3.222,-1.5 4.2,2 6.5,2 4.5))') As geom1, 
ST_GeomFromText('LINESTRING(-0.62 5.84,-0.8 0.59)') As geom2) AS g1;

return invalid multipolygon:

MULTIPOLYGON(((2 4.5,3 2.6,3 1.8,2 0,-0.760731980182196 1.73531724468595,-0.727401641068799 2.70745213549337,0.056 3.222,-0.693606166057922 3.69315348997728,-0.657240688157675 4.75381326206781,2 6.5,2 4.5)),((-0.760731980182196 1.73531724468595,-1.5 2.2,-0.727401641068799 2.70745213549337,-0.760731980182196 1.73531724468595)),((-0.693606166057922 3.69315348997728,-1.5 4.2,-0.657240688157675 4.75381326206781,-0.693606166057922 3.69315348997728)))

which is invalid because edges are shared.

Change History (3)

comment:1 by pramsey, 11 years ago

Resolution: wontfix
Status: newclosed

Save comment as homogenize. We're not going to rework the inputs to make them valid automagically, that's just too scary. We have an isvalid function so people can filter things as necessary.

comment:2 by robe, 11 years ago

Component: postgisdocumentation
Milestone: PostGIS 2.1.1PostGIS 2.1.0
Resolution: wontfix
Status: closedreopened

I guess we can at least put a notice in the docs — This will form invalid multipolygons.

comment:3 by robe, 11 years ago

Milestone: PostGIS 2.1.0PostGIS 2.0.4
Resolution: fixed
Status: reopenedclosed

documented that flawed behavior at r11646 for 2.0, r11647 at 2.1

Note: See TracTickets for help on using tickets.