# The annotated map file (sort of) # Created by Pericles S. Nacionales for the MapServer tutorial # 2005-06-23 # Maintained & enhanced since by Jeff McKenna, GatewayGeo # 2023-04-19 last updated # # Map files begin with map keyword to signify the start of the map object. # Well, the entire map file is THE map object. Enclose between MAP and END # at the very bottom of this map file, are keyword/value pairs and other # objects. MAP NAME EX2_ IMAGETYPE png24 EXTENT 166221 -371954 1505849 632767 # LAEA #EXTENT -97.5 41.619778 -82.122902 49.38562 # Geographic SIZE 400 300 SHAPEPATH "../data" SYMBOLSET "../symbols/symbols.txt" FONTSET "../fonts/fonts.txt" # When changing mapfile parameters via the CGI interface, you # can use Run-time Substitution, but be aware that not all mapfile parameters # are exposed for this (see current list at # https://mapserver.org/cgi/runsub.html#parameters-supported ) # Note that you must setup a VALIDATION pattern in your mapfile, # as this is required for security reasons. # Since the example filenames in section 2 begin with "example2" (as in # example2-1.html or example2-2.html), you can use it as the pattern. # The validation pattern is a regular expression used by MapServer to match # the value of the '&template=' variable passed in the URL. # Notice the line "TEMPLATE '%template%'" in the WEB object below, and its # VALIDATION object. # The web object is defined at the level below the map object. All # web-related parameters (we interchange "parameters" and "keyword/value # pairs" quite frequently, sorry about that) are defined in this object. WEB TEMPLATE '%template%' IMAGEPATH '/mapserver/ms_tmp/' IMAGEURL '/ms_tmp/' VALIDATION "template" "example2*" END END # Every object in MapServer must have an END.;) # The projection object is typically used within the map and the layer # objects. You only define it once within the map object and this definition # becomes your output projection--MapServer will render your maps in this # projection. You also use the projection object within the layer object to # define your input projection. Your layers can be in different # projections--MapServer will reproject them into your output projection. # If no projection is defined within the layer object, MapServer assumes # your input projection is the same as your output projection. This is not # a required object unless you're creating a map file that supports one of # the OGC interoperability web services specifications (WMS/WFS/WCS). PROJECTION # Projection parameters can be defined in two ways... # This is the traditional PROJ definition of Lambert Azimuthal Equal-Area # projection for the Continental U.S. # "proj=laea" # "ellps=clrk66" # "lat_0=45" # "lon_0=-100" # # Alternatively, you can specify an EPSG code. # This is the EPSG code for Lambert Azimuthal Equal-Area # projection for the U.S. "init=epsg:2163" END # This is the ending of the output projection # # Start of legend # LEGEND KEYSIZE 12 12 LABEL TYPE BITMAP SIZE MEDIUM COLOR 0 0 89 END STATUS ON END # The reference object is used to define a reference map for your mapping # application. This typically involves defining a small image that covers # the entire area of the map and defining a box that represents the current # view on in relation to the entire area. REFERENCE IMAGE '../images/ugl_ref1.png' # The reference image SIZE 155 105 # The size of the reference image in pixels EXTENT 201621.496941 -294488.285333 1425518.020722 498254.511514 # The extent of the reference image in map units STATUS ON MINBOXSIZE 10 # How small can the reference box be before it gets drawn as a point, in pixels MAXBOXSIZE 150 # The maximum size of the reference box, in pixels COLOR -1 -1 -1 # The reference box fill color, negative numbers mean transparent OUTLINECOLOR 128 0 0 # The reference box outline color MARKERSIZE 8 # The size of the point marker MARKER 'star' # The marker symbol END # A scalebar object is defined one level below the map object. This object # controls how a scalebar is drawn by MapServer. Scalebars can be embedded # in the map itself or can be created as a separate image. It has an # associated MapServer CGI variable called "scalebar" (or [scalebar] when # used in the HTML template). SCALEBAR IMAGECOLOR 255 255 255 LABEL COLOR 0 0 0 SIZE TINY END STYLE 1 SIZE 100 2 COLOR 0 0 0 UNITS MILES INTERVALS 2 TRANSPARENT FALSE STATUS ON END # Scalebar object ends # Layer objects, too, are defined beneath the map object. Be mindful of the # order of your layer objects. MapServer "stacks them" in reverse # order--that is, the last layer you define (at the bottom of the map file) # will be drawn on top and the first layer you define (right after this # comment), will be drawn at the bottom. Here's my rule: rasters and # polygons are defined first, followed by the line layers, and point # layers are defined last. You can play around with the ordering # of your layers until you're satisfied. # Start of LAYER DEFINITIONS --------------------------------------------- LAYER # States polygon layer begins here NAME "states" DATA "states_ugl.shp" STATUS DEFAULT TYPE POLYGON REQUIRES "![modis] OR ![modis_nasa]" # Here's an example of the input projection definition. # EPSG:4326 is code for geographic (latlong) projection # using the WGS84 datum PROJECTION "init=epsg:4326" END CLASSITEM "CLASS" LABELITEM "STATE" # The class object is defined within the layer object. You can define as # many classes as you need. CLASS EXPRESSION 'land' # There are styles in a class, just like there are classes in a layer, # just like there are layers in a map. STYLE SYMBOL 0 COLOR 232 232 232 END # And they all must come to an end. LABEL COLOR 132 31 31 OUTLINECOLOR 128 128 128 SHADOWCOLOR 218 218 218 SHADOWSIZE 1 1 TYPE TRUETYPE FONT arial-bold SIZE 12 ANTIALIAS TRUE POSITION CL PARTIALS FALSE MINDISTANCE 200 BUFFER 4 END # end of label END # End of this class. END # States polygon layer ends here LAYER # MODIS raster layer begins here NAME "modis" DATA "raster/mod09a12003161_ugl_ll_idxa.tif" STATUS OFF TYPE RASTER OFFSITE 70 74 66 #167 151 152 PROJECTION "init=epsg:4326" END CLASS NAME 'MODIS Image' KEYIMAGE 'graphics/modis_keyimage.png' END END # MODIS raster layer ends here LAYER # MODIS WMS map from NASA NAME "modis_nasa" TYPE RASTER OFFSITE 0 0 0 STATUS OFF CONNECTIONTYPE WMS CONNECTION "https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi?" METADATA "wms_srs" "EPSG:4326" "wms_name" "Blue Marble" "wms_server_version" "1.1.1" "wms_format" "image/jpeg" END PROJECTION "init=epsg:4326" END CLASS NAME 'MODIS NASA WMS' KEYIMAGE 'graphics/landsat_keyimage.png' END END # Modis WMS image ends here LAYER # Hydrography layer begins here NAME "hydro" TYPE POLYGON STATUS OFF DATA "hydrop_ugl.shp" PROJECTION "init=epsg:4326" END CLASSITEM 'FEATURE' CLASS NAME 'Lakes' EXPRESSION /(^B|^C|^L|^R)./ STYLE COLOR 72 64 254 END END # CLASS CLASS NAME 'Rivers' EXPRESSION 'Stream' STYLE COLOR 136 128 255 END END # CLASS CLASS NAME 'Wetlands' EXPRESSION 'Swamp or Marsh' STYLE COLOR 195 252 255 #OUTLINECOLOR 195 252 255 #SYMBOL 'circle' #SIZE 1 END END # CLASS END # LAYER LAYER # ROADS LAYER NAME "cty_roads" GROUP "roads" TYPE LINE STATUS OFF DATA "roads_ugl.shp" MAXSCALE 750000 PROJECTION "init=epsg:4326" END LABELITEM 'SIGN' CLASSITEM 'CLASS1' CLASS NAME 'Minor Arterial Road' EXPRESSION '3' STYLE COLOR 165 165 165 END LABEL STYLE #shield SYMBOL '../symbols/sthwy.png' SIZE 20 END # end of style COLOR 0 0 0 TYPE TRUETYPE FONT vera_sans SIZE tiny ANTIALIAS TRUE POSITION CC PARTIALS FALSE MINDISTANCE 150 MINFEATURESIZE 50 BUFFER 4 END # end of label END # CLASS CLASS EXPRESSION '4' STYLE COLOR 210 210 210 END END # CLASS END # ROADS LAYER LAYER # state highways begin here NAME "state_hwy" GROUP "roads" MAXSCALE 1500000 STATUS OFF DATA "roads_ugl.shp" TYPE LINE FILTERITEM 'CLASS1' FILTER '2' LABELITEM 'SIGN' CLASS NAME 'Principal Arterial Road' STYLE COLOR 255 0 0 SIZE 1 SYMBOL 'circle' END LABEL STYLE #shield SYMBOL '../symbols/ushwy.png' SIZE 20 END # end of style COLOR 0 0 0 TYPE TRUETYPE FONT vera_sans SIZE tiny ANTIALIAS TRUE POSITION CC PARTIALS FALSE MINDISTANCE 150 MINFEATURESIZE 50 BUFFER 4 END # end of label END PROJECTION "init=epsg:4326" END END # highways LAYER # interstate highways begin here NAME "interstate" GROUP "roads" # MAXSCALE 22500000 STATUS OFF DATA "roads_ugl.shp" TYPE LINE FILTERITEM 'CLASS1' FILTER '1' LABELITEM 'SIGN' CLASS NAME "Interstate Highway" STYLE COLOR 128 0 0 END LABEL STYLE #shield SYMBOL '../symbols/interstate.png' SIZE 20 END # end of style COLOR 255 255 255 TYPE TRUETYPE FONT vera_sans SIZE tiny ANTIALIAS TRUE POSITION CC PARTIALS FALSE MINDISTANCE 150 MINFEATURESIZE 20 BUFFER 4 END # end of label END PROJECTION "init=epsg:4326" END END # highways LAYER # States line layer begins here NAME "states" DATA "states_ugl.shp" STATUS OFF TYPE LINE PROJECTION "init=epsg:4326" END CLASSITEM "CLASS" CLASS NAME 'State Boundary' EXPRESSION 'land' STYLE SYMBOL 'line5' COLOR 32 32 32 SIZE 1 END END END # States line layer ends here # End of LAYER DEFINITIONS ------------------------------- END # end of map file