bug in msquery.c msQueryByShape()
Bart van den Eijnden
bartvde at XS4ALL.NL
Mon May 16 07:33:02 PDT 2005
Hi Phil,
this has already been fixed recently by Assefa.
See:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1335
Best regards,
Bart
On Mon, 16 May 2005 16:18:11 +0200, Phill W <phill.watson at SCISYS.CO.UK>
wrote:
> Hi,
>
> First of all. Thanks to all for the effort put into MapServer.
>
> I've been attempting to get "imgshape" nquery working with PostGIS tables
> and come across a bug I thought I would share with whoever's listening. I
> wasn't sure where to post this, so here it is.
>
> The bug definitely affects postGIS layers, but may affect others.
>
> Within the function msQueryByShape() a local shapeObj is used to iterate
> the results of the search. This should be initialised (cleared) before
> the
> loop. The postGis driver calls msAddLine during its processing of
> msLayerNextShape(), and this attempts to free the reference pointed to be
> shape->line.
>
> The snippet of msQueryByShape() to change below:
>
> lp->resultcache = (resultCacheObj *)malloc(sizeof(resultCacheObj)); //
> allocate and initialize the result cache
> lp->resultcache->results = NULL;
> lp->resultcache->numresults = lp->resultcache->cachesize = 0;
> lp->resultcache->bounds.minx = lp->resultcache->bounds.miny = lp-
>> resultcache->bounds.maxx = lp->resultcache->bounds.maxy = -1;
>
> msInitShape(&shape); // initialise shape object
> while((status = msLayerNextShape(lp, &shape)) == MS_SUCCESS) { // step
> through the shapes
> shape.classindex = msShapeGetClass(lp, &shape, map->scale);
>
>
> Thanks again,
> Phill
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the MapServer-users
mailing list