Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 错误:GEOSIntersects:TopologyException:侧面位置冲突_Sql_Postgresql_Geometry_Postgis - Fatal编程技术网

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

Sql 错误:GEOSIntersects:TopologyException:侧面位置冲突,sql,postgresql,geometry,postgis,Sql,Postgresql,Geometry,Postgis,我有PostgreSQL 9.2.4。下面是我用来找出一些几何相交结果的表格: Column | Type | Modifiers ---------------------------------+--------------------------+----------- id | integer |

我有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.085999999999

有人能告诉我我做错了什么吗?

我找到了“马丁·戴维斯”的答案:

发生这种情况是因为几何图形无效,并且当前 JTS/GEOS中使用的相交算法在无效时有小猫 几何图形用作输入。核心转储是不幸的(而且 显然在以后的版本中得到了修复)


显然,相同的无效数据在PostGis v1.5中导致了核心转储,但在v2.0中引发了异常这也可能是尝试运行

SELECT ST_Intersection(a.geom, b.geom)     
FROM table a, table b
WHERE ST_Intersects(a.geom, b.geom) ;

如果存在各种几何图形类型的组合,尤其是点和线串。通过在所有几何体上运行ST_MakeValid(geom),然后从查询中排除除多多边形和多边形以外的所有多边形,问题就解决了。换句话说,
ST_Isvalid(geom)='t'
不一定是避免此错误的充分条件。

使用条件“其中ST_Isvalid(feature_geom)='f'或ST_Isvalid(tile_geom)='f'”检查无效几何体。遗憾的是,它似乎也会与有效几何体引发“侧位置冲突”。同样相关的还有: