[MapServer-dev] Remove requirement for TEMPLATE keyword?

Seth G sethg at geographika.co.uk
Mon Jan 27 04:34:10 PST 2025


Thanks Even and Jukka for the feedback,

I'd be a bit hesitant about adding a new keyword QUERYABLE as this would require updating a lot of existing Mapfiles. 

It looks like MapContext and SOS (Sensor Observation Service) both set LAYER TEMPLATE to a value if missing, so maybe this is something to consider for OGC Features API (and possibly WFS?). The LAYER would be hidden if  "gml_include_items" and "gml_featureid" aren't set (again the gml usage is somewhat confusing naming in non-GML contexts). 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
mastodon: @geographika at mastodon.social

On Sun, Jan 26, 2025, at 9:32 PM, Rahkonen Jukka wrote:
> Hi,
>
> I think that having a keyword QUERYABLE=yes/no with default value "no" 
> would be easy to understand. TEMPLATE would be preserved for the 
> text/html output.
>
> -Jukka Rahkonen-
>
>
> TEMPLATE would
> -----Alkuperäinen viesti-----
> Lähettäjä: MapServer-dev <mapserver-dev-bounces at lists.osgeo.org> 
> Puolesta Seth G via MapServer-dev
> Lähetetty: sunnuntai 26. tammikuuta 2025 10.47
> Vastaanottaja: MapServer Devs <mapserver-dev at lists.osgeo.org>
> Aihe: [MapServer-dev] Remove requirement for TEMPLATE keyword?
>
> Hi devs,
>
> One of the issues I've run into when explaining MapServer to colleagues 
> is the TEMPLATE keyword. The docs don't really explain its purpose, or 
> mention how it makes a layer "queryable" [1]. I also ran into myself 
> this week when a layer wasn't displaying in the OGC Features API as I 
> forgot to add TEMPLATE to the LAYER definition.
>
> Should dropping the requirement to add a TEMPLATE to a LAYER to make it 
> queryable be considered in a future release?
>
> There are more and more examples of the following, which is hard to 
> explain to new users:
>
> LAYER
>     TEMPLATE "ttt"
>     # or
>     # TEMPLATE VOID
>     ...
>
> There are also many cases in the codebase where this is set 
> automatically anyway:
>
>     layer->template = msStrdup("ttt");
>
> The only problem I can see is that it could accidentally allow feature 
> attributes to "leak" out, e.g. for LAYERs with a "select * from tbl", 
> but there is a prevalence of examples when TEMPLATE is set to a fake 
> value anyway.
> Are there any other side-effects if it were set to be "on" by default?
>
> Seth
>
>
> [1] https://mapserver.org/mapfile/layer.html#mapfile-layer-template
>
> --
> web:https://geographika.net/ & https://mapserverstudio.net/
> mastodon: @geographika at mastodon.social
> _______________________________________________
> MapServer-dev mailing list
> MapServer-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the MapServer-dev mailing list