SV: [mapserver-users] Run time substitution - Like instead of =

Thomas Ellett Thomas.Ellett at statkart.no
Mon Feb 13 06:44:07 PST 2012


Hi Mike,

Thanks for getting back to me. Worked a treat, thanks!!

Ended up with "prosjektnu = '%pn%' or '%pn%' = '\%pn\%'" on the filter

Tom

-----Opprinnelig melding-----
Fra: Smith, Michael ERDC-CRREL-NH [mailto:Michael.Smith at usace.army.mil] 
Sendt: 3. februar 2012 17:57
Til: Thomas Ellett; mapserver-users at lists.osgeo.org
Emne: Re: [mapserver-users] Run time substitution - Like instead of =

Tom,

What I am using with a database connection is a default value of "1=1"
so
that is always true, it returns all records.

Mike

-- 
Michael Smith

Remote Sensing/GIS Center
US Army Corps of Engineers



On 2/3/12  11:30 AM, "tellett" <thomas.ellett at statkart.no> wrote:

>Hi All,
>
>I'm using runtime substitution to replace the value of an expression
and
>thats working fine, however, if I don't set the expression value in the
>url,
>I want the layer to show all the records. For example my class looks
likes
>this:
>
>CLASS
>         NAME 'FKB-A'
>         EXPRESSION '%pn%'
>         STYLE
>            COLOR 254 150 254
>            OUTLINECOLOR 1 1 1
>         END
>      END
>
>and when I use this request:
>
>.....REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=fkb_prosjektstanda
rd&
>STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&CRS=EPSG:432
6&B
>BOX=58.9930983171506,9.40049150322111,59.8470137571506,10.904184647298&
WID
>TH=1650&HEIGHT=937&pn=LACHVE11
>
>I get back 1 record which is correct. However, if I drop the
&pn=LACHVE11
>of
>course I get no results back. Is there any way of changing this so that
I
>can get all the records of the table returned?
>
>I thought about using the 'default_pn' option in the metadata and using
>wildcards but as this is an '=' expression rather than a 'LIKE'
expression
>wildcards are useless. Maybe its just because its friday afternoon, but
I
>just can't see a way of doing this, help!!!
>
>Best Regards
>
>Tom
>
>--
>View this message in context:
>http://osgeo-org.1560.n6.nabble.com/Run-time-substitution-Like-instead-
of-
>tp4362317p4362317.html
>Sent from the Mapserver - User mailing list archive at Nabble.com.
>_______________________________________________
>mapserver-users mailing list
>mapserver-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list