<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>Dear 
PostGISs,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=593100618-18112005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>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:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=593100618-18112005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=593100618-18112005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>Query 1, I used the 
reference point as the center point to make it as polygon. then 
submitted the query as follow:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff>
<P><FONT size=2>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)</FONT></P></FONT></DIV></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005><SPAN 
class=593100618-18112005>The query result set<SPAN class=004220017-21112005> 
returned</SPAN>  0 row.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005><SPAN 
class=593100618-18112005></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=593100618-18112005>Query 2, I used the 
reference point to make a bounding box and submitted the spatial query as 
BOX3D.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff><SPAN class=593100618-18112005><FONT face=Arial 
color=#000000 size=2>The result set still contained 0 row.</FONT></SPAN></DIV>
<DIV>
<P><SPAN class=593100618-18112005><FONT face=Arial><FONT color=#000000><FONT 
size=2>Query 3, I used reference point and composed a query as  
distance from the point. Still, I got 0 row<SPAN class=004220017-21112005> when 
queried a small table and Jave out of memory error when queried a large table 
(900,000 rows).</SPAN></FONT></FONT></FONT></SPAN></P>
<P><SPAN class=593100618-18112005><FONT face=Arial color=#000000 
size=2>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 <SPAN class=004220017-21112005>table (the comand VACUUM on the 
column didn't work)</SPAN>. I checked the index in the database, it is there. 
What else could be go wrong in my procedures?</FONT></SPAN></P>
<P><SPAN class=593100618-18112005><FONT face=Arial color=#000000 
size=2></FONT></SPAN> </P>
<P><SPAN class=593100618-18112005><FONT face=Arial color=#000000 size=2>Thanks 
in advance for your help,</FONT></SPAN></P>
<P><SPAN class=593100618-18112005><FONT face=Arial color=#000000 
size=2>Willa</FONT></SPAN></P></DIV></FONT></DIV><FONT color=#0000ff>
<DIV>
<P><SPAN class=593100618-18112005><FONT face=Arial color=#000000 
size=2></FONT></SPAN> </P></FONT></DIV></BODY></HTML>