Ticket #380 (new enhancement)

Opened 20 months ago

Last modified 11 months ago

Buffer(Geometry,0) deletes part of the polygon [JTS affected too]

Reported by: jaapdekker Owned by: geos-devel@…
Priority: minor Milestone: GEOS Future
Component: Default Version: 3.2.0
Severity: Unassigned Keywords:
Cc:

Description

Using buffer(Geometry,0) to fix wrong polygons is not always working OK The polygon that I try to fix has a Self-intersection at or near point -70 57

calling

Select AsText(Buffer(MPolyFromText('MULTIPOLYGON(((-66 58,-66 59,-64 58,-65 58,-66 58),(-70 57,-66 57,-66 58,-68 58,-68 57,-70 57)),((-70 58,-70 57,-72 57,-72 59,-71 59,-71 58,-70 58)))'),0)); 

gives as result

MULTIPOLYGON(((-70 57, -72 57, -72 59, -71 59, -71 58, -70 58, -70 57)), ((-66 58, -66 59, -64 58, -65 58, -66 58)))

it is missing the part

 (-70 57,-66 57,-66 58,-68 58,-68 57,-70 57)

in the output

I'm Using Spatialite version 2.4rc3 wich is using geos version 3.2.2-CAPI-1.6.2

Attachments

start.png Download (13.4 KB) - added by giohappy 20 months ago.
input geometries
end.png Download (12.3 KB) - added by giohappy 20 months ago.
output geometries

Change History

Changed 20 months ago by giohappy

input geometries

Changed 20 months ago by giohappy

output geometries

Changed 20 months ago by giohappy

I confirm the same behaviour with JTS 1.11 I attach input and output screenshots

Changed 20 months ago by mwtoews

See  http://trac.osgeo.org/postgis/ticket/399 for efforts to clean-up geometry and make it valid.

Changed 20 months ago by strk

ST_MakeValid gives:

GEOMETRYCOLLECTION(MULTIPOLYGON(((-66 58,-66 59,-64 58,-65 58,-66 58)),((-66 58,-66 57,-68 57,-68 58,-66 58)),((-70 58,-70 57,-72 57,-72 59,-71 59,-71 58,-70 58))),LINESTRING(-70 57,-68 57))

How do you like it ?

Changed 20 months ago by jaapdekker

Yes I like it, as it fixed a large number of problems, although it takes a lot of time. I tested it with census subdivision data for Canada and it took 7 hours to make the 5418 polygons valid. I used postgres 9.0 and postgis 2.0

Changed 16 months ago by strk

Can anyone check if JTS does a better job here ? If it does then it's a bug in GEOS, otherwise it isn't.

Changed 11 months ago by strk

  • summary changed from Buffer(Geometry,0) deletes part of the polygon to Buffer(Geometry,0) deletes part of the polygon [JTS affected too]
  • type changed from defect to enhancement
  • milestone set to GEOS Future
Note: See TracTickets for help on using tickets.