[UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] Trouble with queryby...

Frank Broniewski Frank.Broniewski at MNHA.ETAT.LU
Wed Oct 6 09:02:54 EDT 2004


Hallo

Quote: I don't know if this could be a problem but I think you have to put
the 
status of your layer to on to query it. After the query you can set it 
to off again.

Is the status of the layer not On by default when I can see it in my map?

Quote: The other thing is that you use layer->query where you get results
and 
in the other case you use map->query.

Where is the difference? Layer->query queries only one layer, map->query
queries all active layers? I want to use map->query to query all active
layers in my map instead of cycling through each layer and query it one by
one. And why does 
   $myLayer = $MapObj->getLayerByName("Points");
   $myLayer->set("status",1);
   $myLayer->queryByRect($myPixelRectObj);
return also the error "Error in msQueryByRect(): No matching record(s)
found" while the point query works?

Quote: ... the location is not in Pixel in this case instead it is in map
coords

I converted the pixel coordinates to map coordinates with a function similar
to the function found in the gmap demo. There by the way they use also
$map->query ... which does not find a result in my code (see above)

I am rather helpless here. As I searched the newsgroup archives, there seem
to be a lot of people using $map->query in their code.

I wonder if I have to "prepare" the map somehow to query it, like setting
all layers to active or something similar in advance.
                                                      
Frank Broniewski
Musée National d'Histoire et d'Art
Section Préhistoire / Projet EPC
    Tél: +352 260 281-21
241, Rue de Luxembourg
L-8077 Bertrange


-----Message d'origine-----
De : Norbert Thieme [mailto:norbert.thieme at ilmenau.baw.de] 
Envoyé : mercredi 6 octobre 2004 13:42
À : Frank Broniewski
Objet : Re: [UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] Trouble with
queryby...


I don't know if this could be a problem but I think you have to put the 
status of your layer to on to query it. After the query you can set it 
to off again.

The other thing is that you use layer->query where you get results and 
in the other case you use map->query. Like I understand:
http://mapserver.gis.umn.edu/doc42/phpmapscript-class-guide.html#MapObj
the location is not in Pixel in this case instead it is in map coords.

Regards,
Norbert



More information about the mapserver-users mailing list