I'm trying to draw a combination of layers with MapServer. One of the layer takes a shapefile as input and the other one is based on GRIB data.
The issue is that the GRIB layer (in green) is drawn from 0 deg to 360 deg. The shapelayers draws from -180 to 180. And indeed, when I examine the GRIB file in Panoply, the meta data of sample shows, among other things, this:
netcdf file:/D:/gribs/sample.grb {
dimensions:
lon = 360;
lat = 181;
isobaric = 4;
time = 3;
variables:
float lat(lat=181);
:units = "degrees_north";
float lon(lon=360);
:units = "degrees_east";
...
other variables
...
}
Which leads me to conclude that the coordinate system runs from 0 to 360 degrees in the east ward direction and from 0 to 180 in the north direction. So MapServer is correct when it draws this image:
So my question is how can I wrap the GRIB image so that the right half is placed over the left half of the earth?
The url with parameters i use:
My mapfile:
MAP
EXTENT -180 -90 360 90 #max x should be only 180, but then only half of the grib layer is drawn
CONFIG "CPL_DEBUG" "ON"
CONFIG "MS_ERRORFILE" "/var/www/mapserver/routeguard/poc.log"
SYMBOLSET "symbols.sym"
FONTSET "../fonts/fonts.txt"
IMAGETYPE PNG8
IMAGECOLOR 255 255 255
SIZE 1600 900
# ------------------------------------------------------------------------------
# the Map Projection
# ------------------------------------------------------------------------------
PROJECTION
#which to use????
"init=epsg:4326" #54004 #4326
"units=m"
END
# ------------------------------------------------------------------------------
# the Web object
# ------------------------------------------------------------------------------
WEB
IMAGEURL '/mapserver/routeguard/' #do not include the the var/www
TEMPLATE 'poc_template.html'
END
#--------------------------------------------------------------------------------
# the country mask
#--------------------------------------------------------------------------------
#red world, defined in shp file
LAYER
NAME "world_outline_red"
TYPE POLYGON
DATA "/var/www/mapserver/data/routeguard/static/world_outline.shp"
CLASS
COLOR 255 0 0
END
PROJECTION
"init=epsg:4326"
END
END
#----------------------------------------------------------------------------
#grib example
#----------------------------------------------------------------------------
LAYER
NAME "grib_sample"
TYPE LINE
CONNECTIONTYPE CONTOUR
DATA "/var/www/mapserver/data/grib/routeguard/sample.grb"
PROCESSING "BANDS=2"
CLASS
STYLE
WIDTH 1
COLOR 0 100 0
END
END
PROJECTION
"init=epsg:4326"
END
METADATA
#"wms_srs" "epsg:54004"
END
END
END #end map file