[MapServer-users] Is it possible to pass variables to a mapfile DATA parameter?

Neil Underhill neil.underhill at gmail.com
Wed Mar 8 13:46:53 PST 2023


Hi all,

I am using mapserver to allow WFS in Openlayers to access point data held
in a PostgreSQL / PostGIS database. The mapfile includes the
following statement:

...

*INCLUDE "readonly.config"DATA "geom FROM table USING srid=32636 USING
UNIQUE fid"*
...

Currently I make a new mapfile for each site visit to each project. However
this means every time a new site visit or project is made, I have to create
a new mapfile, and the only thing that changes is the "table" part of the
statement. All the styling info is in the Openlayers WFS statements.

Is it possible to get Openlayers to pass variables to the DATA parameter
(e.g. a different table name) when called so that I can reuse the same
mapfile for different WFS calls?
Or alternatively, could store the point data in the same PostgreSQL table
and have some other way of filtering the data (e.g. on timestamp)
Am I misunderstanding how I should be using mapfiles?

thanks,
Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230308/bd836aa4/attachment.htm>


More information about the MapServer-users mailing list