AW: [Mapserver-users] itemquery on Mapserver 3.6

Michael Schulz mschulz at webgis.de
Mon Mar 10 09:07:46 EST 2003


Thomas,

> the layer is defined by the qlayer-statement, and that seems to work since the selected (wrong) feature is a feature of this layer.

is there a special need for you to do this kind of query with a filter? As i understand filters,  they reduce the basic (also geometric) data for this layer to the result of the given filterexpression, i.e. when you set your filterstring to "Munich" then only the polygon with the attribute "Munich" would be in the data for this layer and subsequently an itemquery would yield the
information for Munich, but only because it is the only data in this layer. Is that what you want?
I assume you want your complete layer data, let's say all german towns, queried by the name attribute, right? You could do that by using the cgi-parameters: qlayer, item (the attribute-column in your shp-file you want to query) and value (the actual value you want to do the query with).

If you want to work with the filter, you will definitely have to use the "map_layername_filterstring" syntax, where _layername_ would be the same as your qlayer value.

Cheers, Michael


> The regex stuff might be the problem, since in the doku they say the filter string must be a Mapserver regular expression. However, I tried it with  document.mapserv.filter.value="/Munich/" which didn't help. Is there an error in my regular expression?
>
> -----Ursprüngliche Nachricht-----
> Von: Michael Schulz [mailto:mschulz at webgis.de]
> Gesendet: Montag, 10. März 2003 12:25
> An: MapServer Userlist
> Betreff: Re: [Mapserver-users] itemquery on Mapserver 3.6
>
> Hi Thomas,
>
> > The javascript executed for example on the onClick-event of a button looks like this:
> >         function startquery()  {
> >                 document.mapserv.target="_self";
> >                 document.mapserv.mode.checked=true;
> >                 document.mapserv.mode.value="itemquery";
> >                 document.mapserv.qlayer.value="cityareas";
> >                 document.mapserv.filteritem.value="NAME";
> >                 document.mapserv.filter.value="Munich";
>
> I think the problem is that you don't refer to a layer specific filter. If you want to assign a filter via URL use this syntax "map_layername_filter=yourfiltervalue". It might also be important to include in your filterstring how to query for results (string, logical, regex
> comparison), for regex comparisons you should enclose your statement in //, e.g. "/your_regex/", for logical expression in () for string expressions in "".
>
> HTH, Michael
>
> --
> -----------------------------------------------------------
> Michael Schulz                                in medias res
> Dipl.-Geologe                              Gesellschaft für
>                                 Informationstechnologie mbH
>                              Sautierstr. 38, 79104 Freiburg
>                                      0761 55695-95 (Fax 96)
> mschulz at webgis.de                             www.webgis.de
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

--
-----------------------------------------------------------
Michael Schulz                                in medias res
Dipl.-Geologe                              Gesellschaft für
                                Informationstechnologie mbH
                             Sautierstr. 38, 79104 Freiburg
                                     0761 55695-95 (Fax 96)
mschulz at webgis.de                             www.webgis.de





More information about the mapserver-users mailing list