Hi All,
This is slightly related to my previous thread today, but more general.

I want to gauge interested in this idea.
I want to be able to use Runtime Substitution mechanisms to do something like 
this:

MAP
  ...
  VALIDATION
    "datetime" "^([0-9]{4})[-_]([0-9]{2})[-_]([0-9]{2})$" # <- 3 capture groups
  END

  LAYER
    DATA "/mnt/dataset/%datetime_1%/%datetime_2%/%datetime_3%.tif"
    ...
  END
  ...
END

Where the query with &datetime=2018-01-29 is split into parts using capture 
groups 1, 2, and 3 from the validation regex, and stored as new runtime 
substitution variables: %datetime_1%, %datetime_2%, and %datetime_3%.
Then using these values, substitute them into the DATA string (or any other 
valid substitution point).
Substituted:
DATA "/mnt/dataset/2018/01/29.tif"

The regex mechanism to validate the incoming parameter value is already in 
place, and it seems like just one more little step is needed to save the 
captured groups into new runtime substitution variables.

- Ashley Sommer
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to