[mapserver-users] queryByRect throws an error

Murty Maganti MMaganti at oriongis.com
Tue Jan 6 15:31:02 PST 2009


Hi Tamas

 

Thanks for reply.

 

These are extracts from my code to replicate the issue

 

//Create map object

mapObj map = new mapObj("MyMap.map");

 

//draw map

map.draw() ; 

 

//Make sure some template name is defined. Otherwise, query will not be
successful.

            for (int i = 0; i < map.numlayers; i++)

            {

                if (string.IsNullOrEmpty(m_map.getLayer(i).template))

                {

                    m_map.getLayer(i).template = "abc";

                }

            }

 

//Perform the query now

map.queryByRect(map.extents);

 

 

I think after a call to map.draw(), a new layer '__embed__scalebar' is
added to layers collection. Setting template name to it is performing
the query on scalebar layer as well. 

 

I think the scalebar layer is not satisfying these two conditions in
msQueryByRect method of mapquery.c and hence getting used for query

 

    if(!msIsLayerQueryable(lp)) continue;

    if(lp->status == MS_OFF) continue;

 

 

Please let me know if you need more info or you need any test
application.

 

 

Thanks

Murty

 

From: Tamas Szekeres [mailto:szekerest at gmail.com] 
Sent: Tuesday, January 06, 2009 3:33 PM
To: Murty Maganti
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] queryByRect throws an error

 

Hi,

Could you provide a code/mapfile sample to reconstruct the issue? I've
never experienced such a problem, I've used this function many times
though.

Best regards,

Tamas




2009/1/6 Murty Maganti <MMaganti at oriongis.com>

mapObj.queryByRect(...)  (using C# map script) is throwing following
exception when there is an embedded scale bar on map.

 

Exception message: "msShapefileOpen(): Unable to access file. No (NULL)
filename provided.;msBuildPath: Unable to access file"

 

Removing the scale bar from map file works fine. 

 


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090106/d8476b6a/attachment.htm>


More information about the MapServer-users mailing list