Reputation: 2661
I have PostgreSQL 9.2.4. Here is the table I am using to find out some geometrical intersection result:
Column | Type | Modifiers
---------------------------------+--------------------------+-----------
id | integer |
full_resolution | character varying(2000) |
full_resolution_path | character varying(256) |
feature_id | text |
full_resolution_initiated_order | character varying(64) |
true_image_feature_footprint_id | integer |
true_image_tile_footprint_id | integer |
full_resolution_time_created | timestamp with time zone |
feature_geom | geometry |
tile_geom | geometry |
Now the query:
create Temp table temp4_test as
select id, ST_Intersects(feature_geom,tile_geom),full_resolution
, full_resolution_path, feature_id, full_resolution_initiated_order
, true_image_feature_footprint_id, true_image_tile_footprint_id
, full_resolution_time_created
from temp3_test;
is giving me this error:
ERROR: GEOSIntersects: TopologyException: side location conflict at -122.42466 47.085999999999999
Can anyone point me what I am doing wrong here?
Upvotes: 3
Views: 13964
Reputation: 12571
This can also be the result of trying to run
SELECT ST_Intersection(a.geom, b.geom)
FROM table a, table b
WHERE ST_Intersects(a.geom, b.geom) ;
if there are combination of various geometry types, particularly points and linestrings. By running ST_MakeValid(geom) on all geometries and then excluding all but MultiPolygons and Polygons from the query, the problem goes away. In other words, ST_Isvalid(geom)='t'
is not necessarily a sufficient condition to avoid this error.
Upvotes: 5
Reputation: 656401
I found an answer by "Martin Davis" in this thread:
This occurs because the geometries are invalid, and the current intersects algorithm used in JTS/GEOS has kittens when invalid geometries are used as input. The core dump thing is unfortunate (and obviously got fixed in later versions).
Obviously, the same invalid data caused a core dump in PostGis v1.5, but raises an exception in v2.0
Upvotes: 10