[Mapserver-users] PostGIS Spatial Query - Completely Within

Benjamin Wragg bwragg at tpg.com.au
Sun Jun 1 15:47:58 PDT 2003


Heiko Kehlenbrink suggested the truly_inside(geometryA,geometryB)
function. Why won't this work for me?

Cheers,

Benjamin

-----Original Message-----
From: David Blasby [mailto:dblasby at refractions.net] 
Sent: Saturday, 31 May 2003 1:44 AM
To: bwragg at tpg.com.au; mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] PostGIS Spatial Query - Completely Within


Benjamin Wragg wrote:

> What I need to do now is alter this query slightly and only find
> polygons that are completely within the country selected.

You can do this, but you have to have the GEOS (JTS for C++) extension. 
  cf. geos.refractions.net  and postgis.refractions.net  See recent 
messages in the mailing list archive.

The first [experimental] version of GEOS for PostGIS has been released, 
but not for general consumption.

Your query would be something like:

SELECT * FROM <table> WHERE contains(g1,g2)

See http://www.opengis.org/techno/specs/99-049.pdf for the OGC 
definition of 'contains' and other spatial operators.

dave




More information about the MapServer-users mailing list