Opened 10 years ago

Closed 10 years ago

#2549 closed defect (wontfix)

ST_Intersection throws error when ST_IsValid returns true

Reported by: nightdrift Owned by: pramsey
Priority: high Milestone: PostGIS 2.1.2
Component: postgis Version: 2.1.x
Keywords: Cc:


ST_Intersection() throws an error on two polygons which both return true for ST_IsValid()

Here are the Postgres and PostGIS version details: PostgreSQL 9.3.1 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit POSTGIS="2.1.0 r11822" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.8.0" LIBJSON="UNKNOWN" TOPOLOGY RASTER

I will also attach a text file with the specific SQL and output I have used to step through isolating the issue as much as I know how. Please advise if there is any further information required.

Attachments (1)

PostGIS error.txt (3.8 MB ) - added by nightdrift 10 years ago.

Change History (2)

by nightdrift, 10 years ago

Attachment: PostGIS error.txt added

comment:1 by pramsey, 10 years ago

Resolution: wontfix
Status: newclosed

Using your WKT representations (your WKB seem to be muddled) I do get validity errors

postgis22=# select st_isvalid(g) from inter;
NOTICE:  Ring Self-intersection at or near point 139.456321226 -20.897800989

probably your WKB don't have the errors, but the WKT errors are pointing up that the coordinates are a hair's breadth away from having them (and the slight rounding that the WKT caused is showing them up). Try a very very very fine snap to grid, followed by a call to makevalid. Might not work, but also might. Also consider some simplification and makevalid, since probably you aren't that concerned about an "exact" answer.

This is yet another case where GEOS snap rounding would be nice to have.

Note: See TracTickets for help on using tickets.