[mapserver-users] Ticket #3274 - !BOX! parameter handling in mapscript

Just van den Broecke just at justobjects.nl
Tue Mar 8 08:03:49 EST 2011


Hi,

I stumbled across a substitution issue with the !BOX! parameter on 
PostGIS layers when using Mapscript, but also found that it may have 
been fixed:
http://trac.osgeo.org/mapserver/ticket/3274

The related changeset is not in any release yet, or not that I found, 
using MS 5.6.6 (Mac OSX Kyngchaos version) or Ubuntu MS 5.6.3

In my case this issue only happens when doing a layer.queryByRect() 
within Python Mapscript on a layerObj. When dispatching via 
OWSDispatch() things work as expected.

For which release is ticket #3274 planned or is there some other 
workaround (other than building from SVN) ?

My Mapfile snipped is:

DATA "the_geom from (select g.id, g.point as the_geom from gw_tracepoint 
g where g.point && !BOX! order by random() limit 3000) as subquery using 
unique id using srid=4326"

MS issues the following failing query within layer.queryByRect():
"select * from (select g.id, g.point as the_geom from gw_tracepoint g 
where g.point &&!BOX! order by random() limit 3000) as subquery where 
false limit 0". This seems to be a "prequery" before doing the real 
query. Anyways, !BOX! is not substituted. Is there some way to suppress 
this prequery ?

I want to get at most 3000 points within a bbox from a points table, 
randomly spread within the bbox. Leaving out !BOX! does not work 
properly since the subquery will then get points from the entire 
collection and then apply bbox on that set.
Suggestions welcome. Best,

--Just

Just van den Broecke
www.justobjects.nl







More information about the mapserver-users mailing list