Opened 9 days ago

#847 new defect

Intersection operation results in polygons with "terraced" boundaries

Reported by: bute Owned by: strk
Priority: major Milestone: 3.6.3
Component: Core Version: 3.5.0
Severity: Critical Keywords: intersection terraced steps


I suspect that this bug originates in the GEOS library since it occurs in both, PostGIS and QGIS alike.

I extracted and reduced the affected geometry data source to a clean and simple test setup that I attach to this report ( The ZIP file includes two GeoJSON files that each contains one MultiPolygon? geometry. Both geometries are valid and simple. I tested them in PostGIS 2.4.0 (GEOS version 3.4.2-CAPI-1.8.2).

It is very simple to reproduce the bug with QGIS 2.18.3 (GEOS version 3.5.0-CAPI-1.9.0): Extract the attached ZIP file, load both GeoJSON files (A.geojson and B.geojson) into QGIS and then perform the intersection operation of QGIS (=> Vector => Geoprocessing Tools => Intersection) with layers A and B ("Input layer": A, "Intersect layer": B).

The resulting MultiPolygon? geometry will have odd "steps" in its boundary e.g. at coordinates 2731740.84,1240723.47 (see attached screenshot steps.png), though these "steps" are in none of the originating geometries. Now the interesting thing about this is that the steps precisely align along a 1 meter grid (see attached screenshot steps_grid.png).

I worry that this issue will also affect other GEOS users and can cause unpredictable issues in critical scenarios.

Attachments (3) (17.3 KB) - added by bute 9 days ago.
steps.png (24.7 KB) - added by bute 9 days ago.
steps_grid.png (25.6 KB) - added by bute 9 days ago.

Download all attachments as: .zip

Change History (3)

Changed 9 days ago by bute

Attachment: added

Changed 9 days ago by bute

Attachment: steps.png added

Changed 9 days ago by bute

Attachment: steps_grid.png added
Note: See TracTickets for help on using tickets.