21
The Benefits of Publicly-Accessible Data An Open Source Interface and Reimplementation of NOHRSC SNODAS Products Thomas Horner – November 2015

The Benefits of Publicly-Accessible Data - SNODAS

Embed Size (px)

Citation preview

Page 1: The Benefits of Publicly-Accessible Data - SNODAS

The Benefits of Publicly-Accessible Data

An Open Source Interface and Reimplementation of NOHRSC SNODAS Products

Thomas Horner – November 2015

Page 2: The Benefits of Publicly-Accessible Data - SNODAS

Context• Web GIS is redefining a lot of things

• I think I have sat through this slideshow 500 times• Webmaps have become the preferred data visualization method

for the public – Google Maps changed everything in 2005• 2005: Car navigation• 2015: “Navteq/Yelp/Yellowpages/Fodor’s/Michelin Guide/Zagat/AAA all in one.”

• Popular casual apps: Waze, Strava, Weather Underground, Google Earth

• Great map-based web tools here in Colorado:• Colorado Avalanche Information Center (CAIC)• COTrip• CalTopo• 14ers.com• NWS

Page 3: The Benefits of Publicly-Accessible Data - SNODAS

Context• Not just maps but data too – web services

• Data is always up to date• Source has control over distribution and quality of data

• Govt agencies using open web services:• USGS – Dozens of vector layers and tilelayers• NOAA – Tons of layers• Dept of State – Again, tons of layers• Dept of Transportation• US EPA• …State of North Dakota

User

ServerWMSData

DataWeb

Browser

ServerWMSData

Data

Page 4: The Benefits of Publicly-Accessible Data - SNODAS

So WhatFrom just a webmap developer perspective…

1. Copy this code2. Paste into

webmap code3. Move on with your life

Adding a data layer…

Hundreds of layers

Page 5: The Benefits of Publicly-Accessible Data - SNODAS

So WhatCalTopo – Popular free tool – lots of web services consumed and distributed

Page 6: The Benefits of Publicly-Accessible Data - SNODAS

So WhatFreshyMap

Page 7: The Benefits of Publicly-Accessible Data - SNODAS

Publicly-Accessible Web Services

• Developers don’t waste their time• Layers can be added immediately• Working with the data is no mystery - standards

• Cartographers don’t waste their time• MapBox, OSM base data, so many tilelayer

choices• Choice between pre-styled layers or DIY

• Scientists, academics, professionals don’t waste their time• Real-time inputs to complicated models• Easy to procure dozens of layers and datasets• Easy to determine if dataset is useful without

downloading all the data• Work with only what you need• Always having to hunt down data and metadata

Page 8: The Benefits of Publicly-Accessible Data - SNODAS

SNODAS• SNODAS: National snowpack dataset (NWS)

• Several data layers• Updated every 24 hours• Great for water planners, but accurate enough for appropriate

use in other applications• No web service – archives uploaded to FTP

• ‘Official’ webmap interface is painful to use• Data format is ‘primitive’ – cannot natively be used• Has any of the tech been upgraded since 2003?

• So how do we use this layer in a modern webmap? (let’s see what we’re currently working with)

Page 9: The Benefits of Publicly-Accessible Data - SNODAS

SNODASOfficialSNODASInterface

To zoomand panyou haveto refreshthe map

Page 10: The Benefits of Publicly-Accessible Data - SNODAS

SNODAS“Uhhh, where exactly is Castle Creek?”

Page 11: The Benefits of Publicly-Accessible Data - SNODAS

Dealing With It• I want to use this real-time data in

webmaps• Time to write a wee bit of code…• Automate these steps:

1. Find and download latest dataset from FTP server

2. Convert to standardGeoTIFF format for GIS use

3. Stylize and/or push outas web service

Page 12: The Benefits of Publicly-Accessible Data - SNODAS

1. Automated Retrieval

Have to provide the exact, correct URL based on the current date, ex:ftp://sidads.colorado.edu/DATASETS/NOAA/G02158/masked/2015/11_Nov/SNODAS_20151117.tar

Page 13: The Benefits of Publicly-Accessible Data - SNODAS

1. Automated Retrieval• Now decompress the archive….

WHAT HAVE I DONE???

Page 14: The Benefits of Publicly-Accessible Data - SNODAS

1. Automated Retrieval• Decompress THOSE archives• Now have .hdrs and .dats• Prep for conversion• Run a regex to strip “illegal strings” from hdrs

• Rename files to match layer names”us_ssmv11034tS__T0001TTNATS2015111705HP001” -> “snow_water_equivalent”

Page 15: The Benefits of Publicly-Accessible Data - SNODAS

2. Conversion• GDAL – The ultimate open source GIS data tool• Supports SNODAS conversion in recent

versions(the files could still be read in previous versions,with a little trickery)

• Script executes ‘gdal-warp’ after data is prepared

• Data layers are converted to GeoTIFF andweb Mercator projection

• Old archives and raw data files removed

Page 16: The Benefits of Publicly-Accessible Data - SNODAS

3. Distribution• Overwrite the previous GeoTIFF outputs• MapServer consumes these files as layers for

WMS, WCS, etc.• WMS is styled to match the colors of the official

webmap• Anyone consuming the WMS is always getting the

latest uploaded SNODAS data• Can be added to any webmap with one or two

lines of code – or into GIS apps like QGIS or ArcGIS

The Web

Page 17: The Benefits of Publicly-Accessible Data - SNODAS

Slippy-SNODAS• Demo interface that consumes this

SNODAS web service• Leaflet.js – runs in browser or on mobile

phone• Demo hosted on my personal website

• Automated scripts look for new data on each page load• Will we get to see a demo?

http://alptruth-geo.com/SlippySNODAS/

Page 18: The Benefits of Publicly-Accessible Data - SNODAS

Slippy-SNODAS

Page 19: The Benefits of Publicly-Accessible Data - SNODAS

Open Source• MIT License• Hosted on GitHub – Collaborative coding,

issue tracking, documentation• Let’s get some live layers going!

• Maybe NOHRSC will upgrade their technology in the next decade

• github.com/thurs/slippy-snodas

Page 20: The Benefits of Publicly-Accessible Data - SNODAS

Conclusion• SNODAS data is provided reliably to the public

– but archaically• Difficult to immediately jump into a project that uses

SNODAS• Difficult to use the web interface to perform analysis

• But all that is required is open access and documentation

• Public is empowered to consume the data and upgrade/maintain it with newer technology

• Many web services (of public data) were started/hosted by the public -- (especially universities) – govt agencies are coming around to providing it themselves for better control

Page 21: The Benefits of Publicly-Accessible Data - SNODAS

Thanks• SNODAS Data:

• National Operational Hydrologic Remote Sensing Center. 2004. Snow Data Assimilation System (SNODAS) data products at NSIDC. Boulder, CO: National Snow and Ice Data Center. Digital media.

• Official webmap:• http://

www.nohrsc.noaa.gov/interactive/html/map.html• Slippy-SNODAS demo:

• http://alptruth-geo.com/SlippySNODAS/• Code repository:

• github.com/thurs/slippy-snodas