[mapserver-dev] MS 5.4 - Python-MS - queryByRect strange behavior

Christian Jauvin cjauvin at gmail.com
Fri Nov 6 13:00:37 EST 2009

Hi everyone,

I am currently developing a Python-MapScript based web-mapping
framework (http://dracones.surveillance.mcgill.ca) that worked fairly
well with earlier versions of MS (MS4W < 3 on Windows, and
package-based MS ~ 5.2 on Linux). This week I started playing with
Python 2.6 (looking, among other things, to port my framework from
mod_python to WSGI), and so it lead me to the latest beta of MS4W,
which I read has a version of Python-MS built for it. I am currently
using the Beta 7 of MS4W 3. I originally posted this to the MS4W-users
list only, suspecting that my problem was specific to it, but I was
then advised to post here as well, as it could point to a deeper MS

I have noticed a strange behavior with the queryByRect function,
different than what was before: when I programmatically add features
to a point layer and then try to retrieve a subset of them with
queryByRect, getNumResults gives the correct number of retrieved
features, but then the set of shapes returned by
layer.getFeature(layer.getResult(i).shapeindex) is not right. The best
way to explain the problem is this example: when I query for three
very distinct features, what I get is this:

 [<mapscript.shapeObj; proxy of <Swig Object of type 'shapeObj *' at
0x01EC71E0> >,
  <mapscript.shapeObj; proxy of <Swig Object of type 'shapeObj *' at
0x01EC71C0> >,
  <mapscript.shapeObj; proxy of <Swig Object of type 'shapeObj *' at
0x01EC71E0> >]

The first and third objects seem to be the same, according to their
pointers. No matter what query I try to perform, there is always a
similar problem occurring: some pointers seem to be pointing to shared
features, whereas they shouldn't (at least from what I understand).

I understand that this problem description may not be terribly helpful
since it may be hard to reproduce, but given that it would take time
to abstract away the suspicious code in my framework, I thought that I
would go for the high-level first, in case I am missing something
obvious. I am ready to try building a more thorough test case and file
it, if needed however.

Thanks in advance for any help,


More information about the mapserver-dev mailing list