[MS4W-Users] MS4W Beta 7 -- Python-Mapscript -- queryByRect strange behavior

Christian Jauvin cjauvin at gmail.com
Fri Nov 6 11:20:18 EST 2009

Hi everyone,

I am currently developing a Python-Mapscript based web-mapping
framework (http://dracones.surveillance.mcgill.ca) that worked very
well with earlier versions of MS (MS4W < 3 on Windows, and MS ~ 5.2 on
Linux). This week I started playing with Python 2.6, 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.

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 in what way is isn't right 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
objects, 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 since 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

Thanks in advance for any help,


More information about the MS4W-Users mailing list