Hi,
That is an old but still relevant idea
https://github.com/MapServer/MapServer/issues/408.
For your use case it could be enough to store the connection into a text file
and read it with INCLUDE https://mapserver.org/mapfile/include.html.
-Jukka Rahkonen-
-Alkuperäinen viesti-
Lähettäjä: MapServer-users Puolesta
Andrzej Kepys via MapServer-users
Lähetetty: perjantai 17. marraskuuta 2023 13.44
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [MapServer-users] Variables in mapfile
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
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users