Open tbonfort opened 12 years ago
Author: sgillies@frii.com Date: 2004/09/22 - 17:17
Adding y'all for your feedback. To this point, feedback from the users list
and on #mapserver has been 100% in favor of this change.
Author: dmorissette Date: 2004/09/22 - 22:38
I wonder if the people on the users list and IRC realize the impact of this
change on existing scripts.
I'd rather go with getShape(tileindex, shapeindex) for compatibility with PHP
MapScript. I understand the reasons why tileindex could have been optional in
the first place, but it's too late to go back and unfortunately we cannot adjust
PHP MapScript (i.e. flip tileindex and shapeindex) to follow your suggestion
without opening the risk for existing scritps to break for no apparent reason.
If the two arguments had been of different type then we could have used type
validation to produce an error if the script doesn't pass the arguments in the
right order, but that won't be possible in this case. (I'm not sure if I'm
explaining things well here).
We could say that it's OK for PHP to use a different order from SWIG, but that's
just opening the door to confusion in users minds.
BTW, in many cases, we won't benefit that much from the tileindex being optional
since the application code doesn't know whether the layer is tiled or not: it
just reads the tileindex and shapeindex values from the query result cache and
passes them directly to the getShape() call. The fact that tileindex is unused
by postgis and regular shapefiles is not that big a deal IMHO: let's just
declare that there is always a single "universe" tile with index of -1 in those
layers and then the consistency issue is solved.
So I'd vote for either getShape(tileindex, shapeindex) or finding a new name for
the new function and deprecating the old one... if someone can find a nice name
for the new function.
Author: dmorissette Date: 2004/09/22 - 22:42
BTW, I think this issue should be brought up on the -dev list. Most of the
developers aren't regularily on IRC, and many of us don't follow the -users list
any more because it has too much traffic.
Author: sgillies@frii.com Date: 2004/09/22 - 23:09
Maybe the better thing to do is to implement this as "getFeature". Has a
symmetry with the existing "addFeature" method.
Author: dmorissette Date: 2004/09/22 - 23:44
It might be a bit odd that getFeature returns a shapeObj, but I could live with
that as a compromise if everybody else agrees. I personally see Features and
Shapes as the same thing, but maybe Steve sees them as meaning different things
in the context of MapServer. Let's see what he thinks.
Adding Frank to the CC as he may have some thoughts too.
Author: fwarmerdam Date: 2004/09/23 - 00:01
I agree that changing the old getShape() could be quite disruptive. Better
to deprecate it, and provide a new method. Calling it getFeature() is much
better than "getShape2()", which was my first thought.
Author: sgillies@frii.com Date: 2004/09/23 - 00:03
Cool.
There's precedence for "feature" in map.h -- layerObj.features
and layerObj.currentfeature.
Author: sgillies@frii.com Date: 2004/09/25 - 18:16
Tests pass, documented in mapscript/doc/mapscript.txt. Committed in CVS HEAD.
Author: dmorissette Date: 2004/09/26 - 14:31
Created bug 878 about doing the same for PHP MapScript.
Author: dmorissette Date: 2004/09/26 - 14:32
Doh! I meant bug 900!
Reporter: sgillies@frii.com Date: 2004/09/20 - 19:00