0% found this document useful (0 votes)
9 views2 pages

Intro Ruby On Rails

This document contains summaries of PostGIS functions for determining spatial relationships between geometric objects. It includes summaries of the ST_LineCrossingDirection function, which returns the direction two lines cross each other, and the ST_Disjoint function, which returns TRUE if two geometries do not share any common space. It also includes examples calls for each function using WKT geometry literals.

Uploaded by

Mathias Eder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Intro Ruby On Rails

This document contains summaries of PostGIS functions for determining spatial relationships between geometric objects. It includes summaries of the ST_LineCrossingDirection function, which returns the direction two lines cross each other, and the ST_Disjoint function, which returns TRUE if two geometries do not share any common space. It also includes examples calls for each function using WKT geometry literals.

Uploaded by

Mathias Eder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PostGIS 1.5.

1 Manual
182 / 315

Line 1 (green), Line 2 (blue) ball is start point, triangle are


end points. Query below.
SELECT
ST_LineCrossingDirection(foo. line1, foo.line2) As l1_cross_l2 ,
ST_LineCrossingDirection(foo. line2, foo.line1) As l2_cross_l1
FROM (
SELECT
ST_GeomFromText(LINESTRING(25 169,89 114,40 70,86 43)) As line1,
ST_GeomFromText(LINESTRING (20 140, 71 74, 161 53)) As line2
) As foo;
l1_cross_l2 | l2_cross_l1
-------------+-------------1 |
1

Line 1 (green), Line 2 (blue) ball is start point, triangle are


end points. Query below.
SELECT ST_LineCrossingDirection(foo.line1 , foo.line2) As l1_cross_l2 ,
ST_LineCrossingDirection(foo. line2, foo.line1) As l2_cross_l1
FROM (SELECT
ST_GeomFromText(LINESTRING(25 169,89 114,40 70,86 43)) As line1,
ST_GeomFromText(LINESTRING(2.99 90.16,71 74,20 140,171 154)) As line2
) As foo;
l1_cross_l2 | l2_cross_l1
-------------+-------------2 |
2

SELECT s1.gid, s2.gid, ST_LineCrossingDirection(s1.the_geom, s2.the_geom)


FROM streets s1 CROSS JOIN streets s2 ON (s1.gid != s2.gid AND s1.the_geom && s2.the_geom )
WHERE ST_CrossingDirection(s1.the_geom, s2.the_geom) > 0;

See Also
ST_Crosses

7.8.11 ST_Disjoint
Name
ST_Disjoint Returns TRUE if the Geometries do not "spatially intersect" - if they do not share any space together.

PostGIS 1.5.1 Manual


183 / 315

Synopsis
boolean ST_Disjoint( geometry A , geometry B );

Description
Overlaps, Touches, Within all imply geometries are not spatially disjoint. If any of the aforementioned returns true, then the
geometries are not spatially disjoint. Disjoint implies false for spatial intersection.

Important
Do not call with a GEOMETRYCOLLECTION as an argument

Performed by the GEOS module

Note
This function call does not use indexes

Note
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.3 a.Relate(b, FF*FF****)
This method implements the SQL/MM specification. SQL-MM 3: 5.1.26

Examples
SELECT ST_Disjoint(POINT(0 0)::geometry, LINESTRING ( 2 0, 0 2 )::geometry);
st_disjoint
--------------t
(1 row)
SELECT ST_Disjoint(POINT(0 0)::geometry, LINESTRING ( 0 0, 0 2 )::geometry);
st_disjoint
--------------f
(1 row)

See Also
ST_IntersectsST_Intersects

You might also like