[postgis-users] Loading only data that intersects another feature

Randall, Eric ERandall at eriecountygov.org
Mon Apr 7 16:49:10 PDT 2008


select condors.*
from condors, boundary
where st_within(condors.the_geom,boundary.the_geom)

or 

select condors.*
from condors, boundary
where st_intersects(condors.the_geom,boundary.the_geom)


I would suggest that you download and install OpenJump and the dbquery plugin.
That way you can experiment with ad hoc spatial queries
using the many postgis functions and visually see the results of each.
A great way to see postgis functionality.  Mezogis is also good for this but I like OpenJump.

-Eric

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of
Marcus C. England
Sent: Monday, April 07, 2008 7:23 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Loading only data that intersects another
feature


Hi all,

I have a postgis polygon layer representing a site boundary (we will 
call the layer "boundary") and another postgis point layer with a larger 
extent representing California condor observations (we will call the 
layer "condors"). I am using gvSIG which allows SQL restrictions of 
layer loads from postgis. What SQL statement would I use (keep in mind 
the above layer names) to only load the "condors" data that intersects 
"boundary"?

-Marcus
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list