PHP/MapScript getShape() failing with an index returned by getResult() - PostGIS layer

Doug B ummmmm22 at GMAIL.COM
Tue Feb 27 11:52:53 EST 2007


var_dump($shape) displays "bool(false)" in each case.

I also noticed that the first 69 of the 88 results show different,
non-zero, result->shapeindex values, but the last 19 show zero.  Don't
know whether that indicates anything useful.

Also, just for kicks, I did a var_dump on the result objects as well,
and those show values like:

object(stdClass)(3) {
["shapeindex"]=>int(44056)["tileindex"]=>int(-1)["classindex"]=>int(-1)
}

Still searching how to enable query logging, but looking through the
docs I did find that these methods are "deprecated" in favor of some
new ones, so I might try changing to those methods.

Hmmm... interestingly, I'm seeing some significant differences between
the API documentation at
http://mapserver.gis.umn.edu/docs/reference/mapscript and at
http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/classes/layerobj
.  The former says getShape() was deprecated at 4.4 and shows an
entirely different method signature:

getShape( shapeObj shape, int tileindex, int shapeindex ) : int

vs.

shapeObj getShape(int tileindex, int shapeindex)

Do I have to use the former syntax now with my post 4.4 MapServer?

Doug

On 2/27/07, Doug B <ummmmm22 at gmail.com> wrote:
> On 2/27/07, Dirk Tilger <dirk at advtechme.com> wrote:
> > On Thu, Feb 22, 2007 at 01:49:39PM -0600, Doug B wrote:
> > > The getShape() call returns nothing.  If I try to echo the shape
> > > object itself, it's blank, and not surprisingly all of the attributes
> > > are as well, including index.
> >
> > What does var_dump($shape) have to say exactly?
>
> Ok, I'll try that.
>
> > > On an older system (MapServer 4.2, Postgres 7.4.3, PostGIS 0.9) this
> > > code works correctly, and I can't see what we could be doing wrong
> > > between asking the layer for a shapeindex and asking the layer for the
> > > shape at that shapeindex.  The database appears to contain valid data,
> > > and the query sees enough of it to find the correct number of results.
> >
> > The layer is PostGIS? If it is: how have you verified those 88 results
> > above are correct? One thing I would have tried would have been to turn
> > on query logging.
>
> Will look for that as well.  The reason I believe the 88 are correct
> is that I'm comparing them to our older system which is using a copy
> of the same data.  It also returns 88 results for the same boundary
> query and all of them are complete.
>
> > Have you tried a different PHP?
>
> Have not tried that.  Was afraid of changes that might be required on
> 5 so took the latest 4.  Would you suggest an older 4?
>
> >
> > Dirk.
>
> Thanks for the suggestions.  Any help at all at this point is welcome.
>
> Doug
>



More information about the mapserver-users mailing list