Opened 8 days ago

Last modified 6 days ago

#3984 new defect

intersections between valid geometry and raster throw TopologyException

Reported by: turntwo463 Owned by: pramsey
Priority: critical Milestone: PostGIS GEOS
Component: postgis Version: 2.3.x
Keywords: intersections, Cc:

Description

A significant proportion of intersections between polygons and raster often fail with ERROR: GEOSIntersects: TopologyException?: side location conflict. The polygons are valid when checked with ST_IsValid.

An example query that can reproduce this is the following:

SELECT rid, rast, filename, ST_Intersection(rast,

ST_GeomFromText('MULTIPOLYGON (((586930.2651485216 4532526.288145695, 586929.162455693 4532515.09231752, 586919.2106084262 4532516.072488924,

586920.6808655312 4532531.000259823, 586926.9007700728 4532530.387652696, 586930.2651485216 4532526.288145695)))', 26918))

FROM processing.dem where ST_Intersects(rast,

ST_GeomFromText('MULTIPOLYGON (((586930.2651485216 4532526.288145695, 586929.162455693 4532515.09231752, 586919.2106084262 4532516.072488924,

586920.6808655312 4532531.000259823, 586926.9007700728 4532530.387652696, 586930.2651485216 4532526.288145695)))', 26918))

The dem table was loaded using the following:

raster2pgsql -c -I -s 26918 "C:\temp\USGS_NED_one_meter_x58y454_NJ_SdL5_2014_IMG_2015.img" -F -t 25x25 processing.dem | psql -d mydb -h 127.0.0.1 -p 5432 -U the_admin

The dem table can be downloaded from:

https://prd-tnm.s3.amazonaws.com/StagedProducts/Elevation/1m/IMG/USGS_NED_one_meter_x58y454_NJ_SdL5_2014_IMG_2015.zip

Version information for PostGIS is:

POSTGIS="2.3.2 r15302" GEOS="3.6.1-CAPI-1.10.1 r4317" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.3, released 2017/20/01" LIBXML="2.7.8" LIBJSON="0.12" TOPOLOGY RASTER

Change History (1)

comment:1 Changed 6 days ago by robe

Component: rasterpostgis
Milestone: PostGIS 2.3.6PostGIS GEOS
Owner: changed from Bborie Park to pramsey

hmm this sounds more like a GEOS problem than a raster one.

If both pass ST_ISValid, then raster has done it's job. I'm going to flip this to GEOS and try to test with 3.6.2 to see if it has same issue.

Note: See TracTickets for help on using tickets.