Skip to content

Instantly share code, notes, and snippets.

@brucecrevensten
Created September 12, 2013 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brucecrevensten/6542449 to your computer and use it in GitHub Desktop.
Save brucecrevensten/6542449 to your computer and use it in GitHub Desktop.
Mapserver configuration to connect to PostGIS data source for EPSG:3338 data
MAP
NAME "Sea Ice Atlas"
IMAGECOLOR 0 0 0
TRANSPARENT ON
SIZE 256 256
STATUS ON
CONFIG "MS_ERRORFILE" "/var/www/html/ms_error.txt"
DEBUG 5
OUTPUTFORMAT
NAME png
DRIVER "AGG/PNG"
MIMETYPE "image/png"
IMAGEMODE RGBA
EXTENSION "png"
END
PROJECTION
"init=epsg:3338"
END
WEB
METADATA
"wms_title" "Historical Sea Ice Atlas"
"wms_srs" "EPSG:3338"
"wms_enable_request" "*"
END
END
LAYER
NAME seaiceatlas
TYPE raster
STATUS ON
PROJECTION
"proj=aea"
"lat_1=55"
"lat_2=65"
"lat_0=50"
"lon_0=-154"
"x_0=0"
"y_0=0"
"ellps=GRS80"
"datum=NAD83"
"units=m"
"no_defs"
END
# Unused for now, will be integrated into the DATA query when working
VALIDATION
'date' '^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$'
'default_date' '1953-01-01'
END
METADATA
"title" "Historical Sea Ice Atlas"
"author" "SNAP"
END
DATA "PG:host=hermes.snap.uaf.edu port=5432 dbname='sea_ice_atlas' user='sea_ice_atlas_user' password='*' schema='public' table='rasters' where='date=\\\'1953-01-01\\\''"
# Black = no ice = transparent
OFFSITE 0 0 0
CLASS
NAME "gray1"
EXPRESSION ([pixel] < 20)
COLOR 8 81 156
END
CLASS
NAME "gray2"
EXPRESSION ([pixel] < 40)
COLOR 43 130 189
END
CLASS
NAME "gray3"
EXPRESSION ([pixel] < 60)
COLOR 107 174 214
END
CLASS
NAME "gray4"
EXPRESSION ([pixel] < 80)
COLOR 189 215 231
END
CLASS
NAME "gray5"
EXPRESSION ([pixel] <= 100)
COLOR 239 243 255
END
END
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment