[mapserver-users] Sql-Filter via URL

Jeff McKenna jmckenna at gatewaygeomatics.com
Sat Jan 23 05:59:17 PST 2010


Mehmet Sirin wrote:
> Hi,
> 
> I would like to make some user specific sql-queries via url.
> The Data line in the mapfile looks like:
> DATA "geom from (select st_setsrid(the_geom,900913) as geom, gid from 
> ways where gid in (3137, 3138, 3139) ) as a using unique gid using 
> srid=900913"
> 
> "gid" are parts of a street. These parts are chosen by the user in the 
> html-website. After that the sql-query have to be changed in mapfile. 
> But how to do that?
> 
> 
> 
> regards
> m.sirin
> 
> 
>     LAYER
>         SYMBOLSCALE 50000
>         NAME         'street'    # Layer-Name, der in OpenLayers 
> aufgerufen wird
>         TYPE         LINE
>         STATUS       DEFAULT
> 
>         CONNECTIONTYPE postgis    # Verbindung zur PostGIS-Datenbank
>         CONNECTION "user=xxx password=xxx dbname=routing host=localhost 
> port=5432"
>         DATA "geom from (select st_setsrid(the_geom,900913) as geom, gid 
> from ways where gid in (3137, 3138, 3139) ) as a using unique gid using 
> srid=900913"
>      
>         CLASSITEM    'gid'
>         DUMP TRUE       
>         CLASS
>             STYLE
>                 SYMBOL 'circle'
>                 SIZE 9
>                 MINSIZE 9
>                 MAXSIZE 15
>                 COLOR 0 0 200
>             END
>         END
>     END
> 
> 

I quickly searched the MapServer archives for this 
(http://n2.nabble.com/MapServer-f1969210.html), and one of the results 
seem to be applicable 
(http://n2.nabble.com/Dynamin-SQL-with-mapserver-CGI-td2208281.html - 
try the FILTER parameter.

-jeff


-- 
Jeff McKenna
FOSS4G Consulting and Training Services
http://www.gatewaygeomatics.com/





More information about the MapServer-users mailing list