[postgis-users] WMSGetFeatureInfo query just hangs in the database
P Kishor
punk.kish at gmail.com
Mon Sep 21 13:52:34 PDT 2009
Following up with some forensics of my own, I have found the following.
I have a 1 km. sq. grid layer. If I query for WMSGetFeatureInfo while
zoomed out, the following queries run in the backend, and xmin, xmax,
ymin, ymax values are returned to the user and presented in a popup
window by OpenLayers.
statement 1a: select
encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64')
as geom,"gid" from grid_1km_cnnf where the_geom &&
GeomFromText('POLYGON((630976.809608983
585638.303216044,630976.809608983 587492.192802734,632291.577207376
587492.192802734,632291.577207376 585638.303216044,630976.809608983
585638.303216044))',find_srid('','grid_1km_cnnf','the_geom'))
statement 1b: select * from grid_1km_cnnf where false limit 0
statement 1c: select
"gid","ID","XMIN","XMAX","YMIN","YMAX",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64')
as geom,"gid" from grid_1km_cnnf where "gid" = 31437
My sense is that statement 1a finds the actual grid square containing
my click, statement 1b returns no rows at all so I don't know what it
does, and statement 1c returns the actual attributes. All this happens
successfully.
Now, if I zoom in quite a bit and click for WMSGetFeatureInfo, the
only statement that runs is statement 2a below.
statement 2a: select
encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64')
as geom,"gid" from grid_1km_cnnf where the_geom &&
GeomFromText('POLYGON((630616.805138803
580174.87136618,630616.805138803 580290.724370171,630699.037346471
580290.724370171,630699.037346471 580174.87136618,630616.805138803
580174.87136618))',find_srid('','grid_1km_cnnf','the_geom'))
Now, statement 2a runs fine and fast in Pgadmin3, returns a gid, and I
can then use that gid to run the equivalent of statement 1c above and
get back the xmin, ymin, xmax, ymax attributes, but only through
pgadmin3. Through my map interface I get nothing back because nothing
happens after statement 2a.
I don't even know where the problem is -- doesn't seem like a problem
with OpenLayers because all it does is send a query. Doesn’t seem to
be a problem with Pg because if it actually got the query it would
return a result, as it does in Pgadmin3. But, why should it be a
problem with MapServer as all MapServer would do, if it got back a
result from 2a, it would run the equivalent of 1b and 1c.
As is, my query just hangs. Any idea what is going on?
By the way, per an earlier suggestion, I don't have TOLERANCE and
TOLERANCEUNITS set in my mapfile, as, from their description, they
don't seem to apply. In any case, if not provided, TOLERANCE defaults
to 0 for poly layers which restricts poly searches so that point falls
within the polygon, which is what I want.
I am stumped.
--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, WI, United States
More information about the postgis-users
mailing list