<title>Geometry Relationship Functions</title>
<variablelist>
- <varlistentry>
- <term>ST_Equals(geometry, geometry)</term>
-
- <listitem>
- <para>Returns TRUE if the given Geometries are "spatially
- equal". Use this for a 'better' answer than '='.
- equals('LINESTRING(0 0, 10 10)','LINESTRING(0 0, 5 5, 10 10)') is
- true. Note by spatially equal we also mean ordering of points can be different but
- represent the same geometry structure. To verify the order of points is consistent, use
- ST_OrderingEquals.</para>
-
- <para>Performed by the GEOS module</para>
-
- <para>OGC SPEC s2.1.1.2</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>ST_Touches(A geometry, B geometry)</term>
</listitem>
</varlistentry>
- <varlistentry>
- <term>ST_Equals</term>
-
- <listitem>
- <para>Test if an ST_Geometry value as spatially equal to another
- ST_Geometry value.</para>
-
- <para>SQL-MM 3: 5.1.24</para>
- </listitem>
- </varlistentry>
-
<varlistentry>
<term>ST_ExteriorRing</term>
FROM schools s
LEFT JOIN hospitals h ON ST_DWithin(s.the_geom, h.the_geom, 3000)
ORDER BY s.gid, ST_Distance(s.the_geom, h.the_geom);
+
+--The schools with no close hospitals
+--Find all schools with no hospital within 3000 units
+--away from the school. Units is in units of spatial ref (e.g. meters, feet, degrees)
+SELECT s.gid, s.school_name
+ FROM schools s
+ LEFT JOIN hospitals h ON ST_DWithin(s.the_geom, h.the_geom, 3000)
+ WHERE h.gid IS NULL;
</programlisting>
</refsection>
<ulink url="http://www.opengeospatial.org/standards/sfs">OpenGIS Simple
Features Implementation Specification for SQL OGC SPEC s2.1.1.2</ulink>
</para>
+
+ <para><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/check.png" />
+ </imageobject>
+ </inlinemediaobject> This method implements the SQL/MM specification:
+ SQL-MM 3: 5.1.24
+ </para>
</refsection>