[postgis-users] Spatial Query - Why I cannot select geom as Iwant?

Willa WEI wwei at mdacorporation.com
Mon Nov 21 11:05:21 PST 2005


 
I checked the SRID as you suggested and it is -1. So, the query and
table are in the same units. Is there anything else I could do to make
it work?
 
Thanks,
Willa

________________________________

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Ethan Alpert
Sent: Monday, November 21, 2005 10:41 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] Spatial Query - Why I cannot select geom as
Iwant?


To check the SRID of any table's geometry do:
 
select SRID from geometry_columns where f_table_name =
'<your_table_name>'
 
Perhaps you can post the output of:
 
\d <your_table_name>
 
When the table was loaded there should be constraints wrt to SRID which
you can see with \d. \d will also show the indexes
 
-e

	-----Original Message-----
	From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Willa WEI
	Sent: Monday, November 21, 2005 11:25 AM
	To: PostGIS Users Discussion
	Subject: RE: [postgis-users] Spatial Query - Why I cannot select
geom as Iwant?
	
	
	Hi Ethan,
	 
	Thanks for your replying.
	 
	I used the spatial reference - 1 because I don't want to specify
any SRID. The spatial reference in the original shape file is WGS84 and
I picked up the point from the query output from the sample table. So,
they should have the same units. I forgot the mentioned in my original
email. I tried the queries without SRID and they didn't work either. 
	 
	By the way, do you know how to check SRID after loading of a
shape file?
	 
	Willa

________________________________

	From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Ethan Alpert
	Sent: Monday, November 21, 2005 10:06 AM
	To: PostGIS Users Discussion
	Subject: RE: [postgis-users] Spatial Query - Why I cannot select
geom as Iwant?
	
	
	 
	 
	Why is the spatial reference -1 for your GeomFromText()
constructor? What is the SRID for the table you are querying? Are you
sure they contain the same units?
	 
	-e

		-----Original Message-----
		From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Willa WEI
		Sent: Monday, November 21, 2005 10:29 AM
		To: postgis-users at postgis.refractions.net
		Subject: [postgis-users] Spatial Query - Why I cannot
select geom as I want?
		
		
		Dear PostGISs,
		 
		I downloaded Postgres 8.1 and loaded some polygon shape
files using shp2postgres tool. Then I followed the instruction to build
GIST index for the geom columns. However, when I tried to use spatial
query via JDBC to select polygons, I couldn't select any polygon with
spatial query. Here are the ways I did:
		 
		First, I use the sample code in the user manual to
select polygons from the geo table and print the geometries. then, I
pick up one point from the screen to use it as the geospatial reference
for the queries.
		 
		
		Query 1, I used the reference point as the center point
to make it as polygon. then submitted the query as follow:
		WHERE the_geom &&
GeomFromText('POLYGON((-117.05338168844499 33.0161157574187,
-117.05338168844499 33.0191157574187, -117.050381688445
33.0191157574187, -117.050381688445 33.0161157574187,
-117.05338168844499 33.0161157574187))',-1)

		The query result set returned  0 row.
		 
		Query 2, I used the reference point to make a bounding
box and submitted the spatial query as BOX3D.
		The result set still contained 0 row.

		Query 3, I used reference point and composed a query as
distance from the point. Still, I got 0 row when queried a small table
and Jave out of memory error when queried a large table (900,000 rows).

		Is there anybody who knows what is the problem?  I used
postgres query tool to create the GIST index and Maintenance tool to
VACUUM and Analyze the table (the comand VACUUM on the column didn't
work). I checked the index in the database, it is there. What else could
be go wrong in my procedures?

		 

		Thanks in advance for your help,

		Willa

		

		 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20051121/027e082b/attachment.html>


More information about the postgis-users mailing list