从PostGIS的文档中
http://postgis.net/docs/ST_Intersects.html
如果几何或地理共享空间的任何部分,则它们相交。重叠,触摸,所有暗示空间相交。如果上述任何一项返回true,则几何形状也会在空间上相交。
http://postgis.net/docs/ST_Overlaps.html
如果几何“空间重叠”,则返回TRUE。我们的意思是它们相交,但是一个并不完全包含另一个。
区别是:如果两个几何重叠100%,则它们不再重叠。
这是一个POSTGIS示例:
SELECt ST_Overlaps(a,b) As a_overlap_b, ST_Intersects(a, b) As a_intersects_b, ST_Contains(b, a) As b_contains_aFROM (SELECt ST_Polygon(ST_GeomFromText('LINESTRING(1 1,3 1,3 3,1 1)'), 4326) As a, ST_Polygon(ST_GeomFromText('LINESTRING(1 1,3 1,3 3,1 1)'), 4326) As b) As foo; -- INTERSECT is TRUE, OVERLAP is FALSE because B equals A SELECt ST_Overlaps(a,b) As a_overlap_b, ST_Intersects(a, b) As a_intersects_b, ST_Contains(b, a) As b_contains_aFROM (SELECt ST_Polygon(ST_GeomFromText('LINESTRING(1 1,3 1,3 3,1 1)'), 4326) As a, ST_Polygon(ST_GeomFromText('LINESTRING(1 1,4 1,4 4,1 1)'), 4326) As b) As foo; -- INTERSECT is TRUE, OVERLAP is FALSE because B contains A SELECt ST_Overlaps(a,b) As a_overlap_b, ST_Intersects(a, b) As a_intersects_b, ST_Contains(b, a) As b_contains_aFROM (SELECt ST_Polygon(ST_GeomFromText('LINESTRING(0 0,2 0,2 2,0 0)'), 4326) As a, ST_Polygon(ST_GeomFromText('LINESTRING(1 1,3 1,3 3,1 1)'), 4326) As b) As foo; -- INTERSECT is TRUE, OVERLAP is TRUE because not all of A intersects B and not all of B intersects A


