Ah HA! I just clued into the fact that the parameters for getShape() are in the opposite order from those in getFeature(). Doh! When I pass them in the proper order getShape works fine. Damn computers; they're just so picky about the details...

Steve Lime wrote:
Keeping the SWIG and PHP versions of MapScript sync'd has always been a 
challenge so it's possible
it didn't get added until 4.10.1 or later. At 4.10.0 you should have getShape 
which works the same
as getFeature (they wrap the same C code) but with getShape you must pass a 
tile index in addition
to the shape index. Usually it's just:

  $shape = $layer->getShape(-1, $shpindex);

Steve

Bill Thoen <[EMAIL PROTECTED]> 10/31/07 5:48 PM >>>
getFeature doesn't seem to be defined in version 4.10.0. When I try to use it I get an error message that says it's undefined. Is this a recent change, or should it be there?

Steve Lime wrote:
getFeature is the method to use to retreive a feature from a layer. It is a 
layer method and
exists for both PHP and the SWIG-based bindings. It replaces the getShape 
method which
I created with stupid parameter orderings that made it impossible to not pass a 
tile index.

I see that it is missing from the PHP/MapScript docs but is present in the Swig 
docs. I'll file
a ticket on that one... There's already a note at the bottom of the page but it 
hasn't been
noticed.


Reply via email to