错误: GEOSIntersects: TopologyException: 侧面位置冲突。

3
我有一个PostgreSQL 9.2.4。以下是我用来查找某些几何交集结果的表格:
             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                 | 

现在来看这个查询:
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;

我遇到了这个错误:

错误: GEOSIntersects: TopologyException: 在-122.42466 47.085999999999999处发生了边界冲突

有谁能指出我在这里做错了什么吗?

2个回答

10

我在这个帖子中找到了Martin Davis的答案:

这是因为几何图形无效,当无效的几何图形作为输入时,JTS/GEOS当前使用的相交算法会出现问题。核心转储的问题是不幸的(并且显然在后来的版本中得到了修复)。

显然,同样的无效数据导致PostGis v1.5崩溃,但在v2.0中引发异常。


3
检查无效几何体,条件为“where st_isvalid(feature_geom)='f' OR st_isvalid(tile_geom)='f'”。 - VictorGram
遗憾的是,它似乎也对有效几何图形抛出“侧面位置冲突”的错误。 - Eric Duminil
同样相关:https://gis.stackexchange.com/a/387105/158056 - Marcus Junius Brutus

5
这也可能是尝试运行的结果。
SELECT ST_Intersection(a.geom, b.geom)     
FROM table a, table b
WHERE ST_Intersects(a.geom, b.geom) ;

如果有各种几何类型的组合,特别是点和线串。通过在所有几何图形上运行ST_MakeValid(geom),然后从查询中排除除MultiPolygons和Polygons之外的所有内容,问题就消失了。换句话说,ST_Isvalid(geom)='t'不一定是避免此错误的充分条件。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接