Skip to content

Instantly share code, notes, and snippets.

@fosterbrereton
Last active June 21, 2016 20:07
Show Gist options
  • Save fosterbrereton/0236cf818f87eef89d825e9ed608f222 to your computer and use it in GitHub Desktop.
Save fosterbrereton/0236cf818f87eef89d825e9ed608f222 to your computer and use it in GitHub Desktop.
Using US Forest Service WMS servers to fetch fire maps
#!/bin/bash
# Original lat/long is near Azusa, California, the location of the 2016 Jun 20
# Fish fire.
LAT=34.177043
LON=-117.921503
LATMIN=`bc <<< $LAT-.2`
LATMAX=`bc <<< $LAT+.2`
LONMIN=`bc <<< $LON-.2`
LONMAX=`bc <<< $LON+.2`
BBOX=$LONMIN,$LATMIN,$LONMAX,$LATMAX
# echo $BBOX
# Server listings: http://activefiremaps.fs.fed.us/wms.php
# WMS specification: http://www.opengeospatial.org/standards/wms
curl "http://activefiremaps.fs.fed.us/cgi-bin/mapserv.exe?map=conus_viirs-af.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Shaded%20relief,State%20Boundaries,Cumulative%20Fire%20Detections,CONUS%20VIIRS-AF%20Fire%20Detections&STYLES=&FORMAT=jpeg&BBOX=${BBOX}&SRS=EPSG:4269&WIDTH=1000&HEIGHT=1000&BGCOLOR=0x000000" > viirs_af.jpeg
open viirs_af.jpeg
curl "http://activefiremaps.fs.fed.us/cgi-bin/mapserv.exe?map=conus_viirs_iband.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Shaded%20relief,State%20Boundaries,Cumulative%20Fire%20Detections,CONUS%20VIIRS%20I%20Band%20Fire%20Detections&STYLES=&FORMAT=jpeg&BBOX=${BBOX}&SRS=EPSG:4269&WIDTH=1000&HEIGHT=1000&BGCOLOR=0x000000" > viirs_i.jpeg
open viirs_i.jpeg
curl "http://activefiremaps.fs.fed.us/cgi-bin/mapserv.exe?map=conus.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Shaded%20relief,State%20Boundaries,Cumulative%20Fire%20Detections,CONUS%20MODIS%20Fire%20Detections&STYLES=&FORMAT=jpeg&BBOX=$BBOX&SRS=EPSG:4269&WIDTH=1000&HEIGHT=1000&BGCOLOR=0x000000" > conus.jpeg
open conus.jpeg
curl "http://activefiremaps.fs.fed.us/cgi-bin/mapserv.exe?map=conus_landsat.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Shaded%20relief,State%20Boundaries,Cumulative%20Fire%20Detections,CONUS%20Landsat%208%20Fire%20Detections&STYLES=&FORMAT=jpeg&BBOX=$BBOX&SRS=EPSG:4269&WIDTH=1000&HEIGHT=1000&BGCOLOR=0x000000" > landsat.jpeg
open landsat.jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment