[mapserver-users] dynamically changing data path and calculating scales
Smith, Michael ERDC-CRREL-NH
Michael.Smith at usace.army.mil
Fri Feb 17 12:34:19 PST 2012
Punnet
You could use runtime substitution for this.
DATA "path/to/%month%/my.img"
And then send &month=11 in the URL.
You will also need a VALIDATION block for the substitution string.
VALIDATION
"month" "/^(0?[1-9]|1[0-2])$/"
END
The VALIDATION block would be at the LAYER level.
Mike
--
Michael Smith
Remote Sensing/GIS Center
US Army Corps of Engineers
On 2/17/12 3:25 PM, "Puneet Kishor" <punk.kish at gmail.com> wrote:
>I have a layer like so that works very well (snipped for brevity)
>
> LAYER
> TYPE RASTER
> DATA "path/to/data/my.img"
> PROCESSING "SCALE=-24.403,-1.483"
> CLASS
> STYLE
> COLORRANGE 46 154 88 251 255 128
> DATARANGE -24 0
> END
> END
> END
>
>Now, I want to dynamically change the "path/to/data" via a web query.
>Basically, I have img files for different months, and I want the user to
>be able to choose a specific month and have MapServer deliver that data.
>So, for January, I want "path/to/1/my.img" and for November it would be
>"path/to/11/my.img".
>
>Additionally, that "SCALE=-24.403,-1.483" above... well, I used one of
>them gdal utils to determine that, but I would like to do that
>automagically. Needless to say, "SCALE=AUTO" does not work.
>
>Suggestions?
>
>
>
>--
>Puneet Kishor_______________________________________________
>mapserver-users mailing list
>mapserver-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list