12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>199 / 310This function call will automatically include a bounding box comparison that will make use of any indexes that are available onthe geometries. To avoid index use, use the function _ST_Overlaps.NOTE: this is the "allowable" version that returns a boolean, not an integer.This method implements the OpenGIS Simple Features Implementation Specification for SQL 1.1. s2.1.1.2 // s2.1.13.3This method implements the SQL/MM specification. SQL-MM 3: 5.1.32Examples--a point on a line is contained by the line and is of a lower dimension, and thereforedoes not overlap the linenor crosses←↪SELECT ST_Overlaps(a,b) As a_overlap_b,ST_Crosses(a,b) As a_crosses_b,ST_Intersects(a, b) As a_intersects_b, ST_Contains(b,a) As b_contains_aFROM (SELECT ST_GeomFromText(’POINT(1 0.5)’) As a, ST_GeomFromText(’LINESTRING(1 0, 1 1, 35)’) As b)As foo←↪a_overlap_b | a_crosses_b | a_intersects_b | b_contains_a------------+-------------+----------------+--------------f | f | t | t--a line that is partly contained by circle, but not fully is defined as intersecting andcrossing,-- but since of different dimension it does not overlapSELECT ST_Overlaps(a,b) As a_overlap_b, ST_Crosses(a,b) As a_crosses_b,ST_Intersects(a, b) As a_intersects_b,ST_Contains(a,b) As a_contains_bFROM (SELECT ST_Buffer(ST_GeomFromText(’POINT(1 0.5)’), 3) As a, ST_GeomFromText(’ ←↪LINESTRING(1 0, 1 1, 3 5)’) As b)As foo;←↪a_overlap_b | a_crosses_b | a_intersects_b | a_contains_b-------------+-------------+----------------+--------------f | t | t | f-- a 2-dimensional bent hot dog (aka puffered line string) that intersects a circle,-- but is not fully contained by the circle is defined as overlapping since they are of ←↪the same dimension,-- but it does not cross, because the intersection of the 2 is of the same dimension-- as the maximum dimension of the 2SELECT ST_Overlaps(a,b) As a_overlap_b, ST_Crosses(a,b) As a_crosses_b, ST_Intersects(a, b) ←↪As a_intersects_b,ST_Contains(b,a) As b_contains_a,ST_Dimension(a) As dim_a, ST_Dimension(b) as dim_b, ST_Dimension(ST_Intersection(a,b)) As ←↪dima_intersection_bFROM (SELECT ST_Buffer(ST_GeomFromText(’POINT(1 0.5)’), 3) As a,ST_Buffer(ST_GeomFromText(’LINESTRING(1 0, 1 1, 3 5)’),0.5) As b)As foo;a_overlap_b | a_crosses_b | a_intersects_b | b_contains_a | dim_a | dim_b | ←↪dima_intersection_b-------------+-------------+----------------+--------------+-------+-------+--------------------- ←↪t | f | t | f | 2 | 2 | 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!