[MapServer-users] Variables in mapfile

Andrzej Kępys jendrusk at gmail.com
Fri Nov 17 03:43:52 PST 2023


Hi All

I'm trying to deploy mapserver on kubernetes cluster, to keep 
development separation I'm using few environments, for every of them 
I've got separated database as a source for the layers. Connection 
parameters (host/port/user/pass) are common for all solution and stored 
in configmaps.

I'm looking for an option to use this enviromental variables from 
configmaps in mapfile, like:

       MAP
         LAYER
             NAME "ECA"
             STATUS ON
             TYPE POLYGON
             CONNECTIONTYPE POSTGIS
             CONNECTION "host=%PGHOST% dbname=%PGDATABASE% user=%PGUSER% 
password=%PGPASSWORD% port=%PGPORT%"
             DATA "wkb from (select * from 
mapserver.special_areas_system where type_id = 1) as subquery using 
unique id"
             CLASS
                 STYLE
                     COLOR "#ff960040"
                     OUTLINECOLOR "#ff9600ff"
                 END
             END
         END

Is it possible? Or if not - how to deal with such case?

Thanks in advance.

Andy

-- 
Pozdrawiam
Andrzej Kępys
skype: jedrus305
tel: 605 997 440




More information about the MapServer-users mailing list