[mapserver-users] Run-time Substitution and Raster file problem

thomas bonfort thomas.bonfort at gmail.com
Sat Mar 17 01:07:34 EDT 2012


first thing that comes to mind is
'fhour_validation_pattern' '^[][_a-zA-Z0-9]+$'

this should go in a VALIDATION block

VALIDATION
'fhour' '^[][_a-zA-Z0-9]+$'
END

On Sat, Mar 17, 2012 at 00:43, teknocreator <teknocreator at gmail.com> wrote:
> This is somewhat related to the post by Kathleen Hirst on Feb 27.  We're
> using MapServer 6.0.1 and I'm attempting get around the fact that one isn't
> able to change the PROCESSING "BANDS=" directive via Run-time Substitution.
> I couldn't find a way to do it through modifying the URL that's passed
> either.  As we don't have a many rasters in a file as Kathleen, I thought of
> splitting the bigger file up into individual rasters.  Then use Run-time
> Substitution and pass in either the filename or just a piece of the file
> name to the DATA portion of the mapfile.  The docs seem to indicate I should
> be able to do this.  But, I get an error with each attempt.  Here's what I
> tried first:
>
> MAP
>  NAME "testgrib"
>  IMAGETYPE      PNG
>  EXTENT         -14000000 3000000 -7000000 7000000
>  STATUS         ON
>  SIZE           2145 1377
>
>  SHAPEPATH      "../shapefiles"
>  SYMBOLSET      "../symbols/symbols35.sym"
>  FONTSET        "../fonts/fonts.list"
>  DATAPATTERN "^.*$"
>  IMAGECOLOR     255 255 255
>
>  PROJECTION
>   "init=epsg:3857"
>  END
>  WEB
>    IMAGEPATH "test/img/tmp/ms_tmp/"
>    IMAGEURL "http://localhost:8080/wxmap/test/img/tmp/ms_tmp/"
>    METADATA
>      "wms_title"                  "WMS Test " ## REQUIRED
>      "wms_onlineresource"         "http://localhost:8080/cgi-bin/mapserv?"
> ## Recommended
>      "wms_srs"                    "ESPG:3857 EPSG:4326 EPSG:4269 EPSG:3978
> EPSG:900913" ## Recommended
>      "wms_abstract"               "This text describes my WMS service." ##
> Recommended
>      "wms_enable_request" "*"
>      "ows_sld_enable" "true"
>    # testing
>      "wms_feature_info_mime_type" "text/html"
>    END
>  END
>
>  OUTPUTFORMAT
>    NAME "png"
>    DRIVER GD/PNG
>    MIMETYPE "image/png"
>    IMAGEMODE RGBA
>    EXTENSION "png"
>    TRANSPARENT ON
>  END
>
>
>  LAYER # GRIB attempt
>    NAME         mosaic
>    STATUS       ON
>    TYPE         RASTER
>
>    DATA         *../grib/ds_vis%fhour%.grb*
>
>    CLASSITEM "[pixel]"
>    METADATA
>     "gml_include_items" "all"
>     "wms_include_items" "all"
>    END
>   'fhour_validation_pattern' '^[][_a-zA-Z0-9]+$'
> # testing
>    DUMP TRUE
>    HEADER  "../templates/test_header.html"
>    TEMPLATE "../templates/test_body.html"
>    FOOTER "../templates/test_footer.html"
>
>    PROJECTION
>     "proj=lcc"
>     "lat_1=25"
>     "lat_2=25"
>     "lat_0=0"
>     "lon_0=-95"
>     "x_0=0"
>     "y_0=0"
>     "a=6371200"
>     "es=0.0"
>     "+no_defs"
>    END
>
>    PROCESSING "NODATA=32129"
>    PROCESSING "BANDS=01"
>    PROCESSING "SCALE=0,11200"
>    LABELITEM "[pixel]"
>
>    CLASS
>    NAME "< 1/4"
>    EXPRESSION ([pixel] < 400 )
>    STYLE
>        COLOR 100 0 100
>    END
>    END
> ....
>
>
>  END # End of mosaic layer
>
> END
>
> But this results in:
>
> "loadLayer(): Unknown identifier. Parsing error near (%):(line 90)
> msOutputFormatValidate():"
>
> I tried a few variations:
> - using RTS for the entire file name
> - specifying the entire path
> - quotes/no quotes around the full file path name (different error with
> quotes)
>
> to no avail.  I tried others these either ended up in other errors.  Pretty
> much hitting walls everywhere and winding up with some of the same
> variations.  So, thought it was time to ask what I might be doing wrong or
> if this is even possible.  I've used RTS successfully with Postgres/PostGIS,
> so I thought this should work as well.  And it's the DATA statement where I
> thought this would most likely work.
>
> Appreciate any thoughts/help!
>
> Dave M
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Run-time-Substitution-and-Raster-file-problem-tp4626749p4626749.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> 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