RE: [mapserver-users] Inconsistency between 5.4 and 5.2.1 concerningWhichShapes()?

2009-04-28 Thread Jim Strevinas

Steve, you are absolutely right, according to #2689 i tried commenting
out the msLayerWhichItems (layer.i) prior to msLayerWhichShapes in
the 5.4 release. The item setup is thus maintained. 
While i'm afraid to mess with maplayer.c and maybe this will sound silly
,i observed that within maplayer.c in function msLayerWhichItems()
at line 402, a cleanup of the previous item selections is performed:

msLayerFreeItemInfo(layer);
if(layer-items) {
msFreeCharArray(layer-items, layer-numitems);
layer-items = NULL;
layer-numitems = 0;
}

I commented out the whole cleanup and observed that in the whole code
below whenever needed (eg if classify is true) the elements subject to a
cleanup are just safely overwritten. Moreover, commenting out the cleanup 
fixes the problem in my humble opinion. 


  steve.l...@dnr.state.mn.us wrote:
 
 What does your layer definition look like? Probably stems from the fix
 put in
 place for ticket #2689 (http://trac.osgeo.org/mapserver/ticket/2689).
 That fix
 may need more work as I imagine the msLayerWhichItems() is clobbering
 the
 item setup done when the layer is opened.
 
 Hmmm, how to fix...
 
 Steve
 
  Jim Strevinas voas_...@hotmail.com 04/27/09 8:27 PM 
 
  Hello list, I recently migrated to 5.4. I observed the following
  inconsistency 
  and I would be grateful if someone can duplicate the problem too.
  In my (mapscript python) code i manually grab layer features using:
 
  layer.open()
  status = layer.whichShapes(map.extent)
  while (1):
 shape = layer.nextShape()
 if shape==None: 
  break
 print shape.numvalues
 
  The last print returns the number of non-spatial attributes. 
   In mapserver 5.2.1 it is returned correctly but in 5.4 is always 0
  just like all the non spatial values are all null. 



_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Inconsistency between 5.4 and 5.2.1 concerningWhichShapes()?

2009-04-27 Thread Steve Lime
What does your layer definition look like? Probably stems from the fix
put in
place for ticket #2689 (http://trac.osgeo.org/mapserver/ticket/2689).
That fix
may need more work as I imagine the msLayerWhichItems() is clobbering
the
item setup done when the layer is opened.

Hmmm, how to fix...

Steve

 Jim Strevinas voas_...@hotmail.com 04/27/09 8:27 PM 

Hello list, I recently migrated to 5.4. I observed the following
inconsistency 
and I would be grateful if someone can duplicate the problem too.
In my (mapscript python) code i manually grab layer features using:

layer.open()
status = layer.whichShapes(map.extent)
while (1):
   shape = layer.nextShape()
   if shape==None: 
break
   print shape.numvalues

The last print returns the number of non-spatial attributes. 
In mapserver 5.2.1 it is returned correctly but in 5.4 is always 0
just like all the non spatial values are all null. One could also
observer that:

layer.open()
print layer.numitems   # Return the right value always

status = layer.whichShapes(map.extent)
print layer.numitems   # Returns 0 ONLY in 5.4

My workaround now is to temporary store the whichShapes() returned
features' indexes in a list and later access using layer.getFeature(i)
which preserves
the existance of non-spatial. I don;t know yet if this problem arised
only
for me, but i thought it would be wise to inform.


_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users