[MapServer-users] Variables in mapfile
Rahkonen Jukka
jukka.rahkonen at maanmittauslaitos.fi
Fri Nov 17 05:18:30 PST 2023
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 <mapserver-users-bounces at lists.osgeo.org> Puolesta Andrzej Kepys via MapServer-users
Lähetetty: perjantai 17. marraskuuta 2023 13.44
Vastaanottaja: mapserver-users at 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 at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list