[mapserver-users] Can the PROCESSING layer attribute be set dynamically through (PHP) MapScript?
Jorrit Goddijn
Jorrit.Goddijn at meteogroup.com
Tue May 27 02:50:32 PDT 2014
Hi all,
I'm drawing layers based on GRIB data files. Each file contains several bands (datasets). I can access these datasets by setting the PROCESSING attribute on the LAYER object. As in this example:
#########################
LAYER
NAME "current_grid"
TYPE POINT
CONNECTIONTYPE uvraster
DATA "/var/www/mapserver/data/grib/routeguard/4nwwin99_2013110412.grb2" #v and u-component of current
PROCESSING "BANDS=1,2"
PROCESSING "UV_SPACING=20"
CLASS
STYLE
SYMBOL "arrow"
ANGLE [uv_angle]
SIZE [uv_length]
COLOR 255 0 0
END # style
END # class
PROJECTION
#"init=epsg:4326"
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +pm=-360"
END
END # layer
####################
This works fine. But I need to set the PROCESSING values dynamically through mapscript. If I add this code to my script (which works fine without these lines):
####################
$map = ms_newMapObj($_GET['MAP']);
$current_layer = $map->getlayerbyname('current_grid');
// both of these do not work
//$current_layer->set('processing', 'BANDS=1,2'));
//$current_layer->setprocessing('BANDS=1,2'));
$request = createRequest("");
$result = $map->owsdispatch($request);
####################
I get an internal server error (500). It seems that setting any attribute via the layer->set() method causes this behavior. I'm migrating from MS 5.4, does the set method still work as expected?
Thank you
Jorrit Goddijn
jorrit.goddijn at meteogroup.com
MeteoGroup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140527/9455169a/attachment.htm>
More information about the MapServer-users
mailing list