[postgis-users] newbie question

Thomas Crosslin tcrosslin at integral-corp.com
Fri Jan 25 18:11:49 PST 2008


I'm a new PostGIS/PostgreSQL user.

I've successfully set up my database and uploaded a few shapefiles to
play with.

I want to do some spatial queries and I'm having some difficulty.

 

I'd like to extract the polygon that a point intersects - actually I
really want to be able to intersect several layers at once with a given
point and return the values from a particular field from each layer.
But I decided to start with one layer.  So the table is called "r_zones"
(it is an imported shapefile) and the field I want information returned
from is called "zone".  So what I want is to know what "zone" the point
falls within.  I'm using PgAdmin (v1.6.2) to query my database, Windows,
Postgres8.2, PostGIS 1.3.1.

 

So I've tried a basic query like this:

 

SELECT the_geom, zone

FROM r_zones

WHERE GeomFromText('POINT(7644373.465626 687692.342075)', 2838)

 

I know the WHERE statement is incorrect, I've tried several variants
looking at the docs (like using a distance based query and others) but
cannot make a successful query.  Where am I going wrong?

 

 

Any help appreciated.

 

-Thomas

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080125/9720f546/attachment.html>


More information about the postgis-users mailing list