[mapserver-users] Passing an additional parameter via URL, for WMS request - doesn't work anymore with new mapserver?

Humberto Cereser Ibanez humberto at pastoraldacrianca.org.br
Tue Aug 21 10:52:23 PDT 2012


Stef,

I don't know noting about DATAPATTERN, but you can try this:

On 21-08-2012 12:55, mapserver-users-request at lists.osgeo.org wrote:
> Date: Tue, 21 Aug 2012 16:41:17 +0200
> From: Stefan Schwarzer<stefan.schwarzer at unep.org>
> To:mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Passing an additional parameter via URL
> 	for	WMS request - doesn't work anymore with new mapserver?
> Message-ID:<0DB5AEEA-5530-4630-B26C-7FCB8678AED3 at unep.org>
> Content-Type: text/plain; charset=windows-1252
>
> Thanks so much for the quick responses!
>
> If I understand it correctly, I need to specify "DATAPATTERN" in the MAP part, in order to use the parameter in the DATA request:
>
> 	Doc is saying: LAYER: DATA (must validate against DATAPATTERN)
>
>
> which would look like this:
>
> 	SHAPEPATH '/www/xxx/data'
SHAPEPATH is not taken into account for layers that use database 
connection, however you need this if you have any layer that uses SHAPEFILE.
> 	FONTSET '/www/xxx/htdocs/mod_map/etc/fonts.txt'
> 	SYMBOLSET '/www/xxx/htdocs/mod_map/etc/symbols.sym'
> 	DATAPATTERN '^[0-9]'
>
>
> with the DATA request like:
>
> 	DATA "the_geom FROM (SELECT xxx FROM capitals WHERE capitals.id_country<>  %id_country%) AS foo USING UNIQUE gid USING srid=4326"
Try change "<>" by "!="

DATA "the_geom FROM (SELECT xxx FROM capitals WHERE capitals.id_country != %id_country%) AS foo USING UNIQUE gid USING srid=4326"

>
>
> Hmmm?. But that doesn't work.
>
> msDrawMap(): Image handling error. Failed to draw layer named'capitals_mask'.
> msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  syntax error at or near")"
> LINE 1: ...capitals WHERE capitals.id_country<> %id_country%) AS foo w?
>
>
> Can you shed some light on it? I am not really familiar with the regular expressions. I am just passing an integer.
>
> Thanks for any hints!
>
> Stef
>
Let me know if this was useful for you.

Humberto Cereser Ibanez


More information about the mapserver-users mailing list