Simple proof-of-concept for mashing up different sources of geo data onto a single map. The motivating example is plotting popular ski destinations and layering on the latest snow depth data. This prototype currently supports adding points of interest data via KML files and additional data via GeoJSON files.
California SNO-Parks combined with current snow depth: https://cloudkj.github.io/snowpack/examples/ca_sno_parks/
US national parks combined with seasonal visitor data: https://cloudkj.github.io/snowpack/examples/nps_heatmap/
import { initMap, loadKML, loadGeoJSON } from './src/snowpack.js';
initMap('map', { centerCoords: [39.5, -120.5], zoomLevel: 8 });
const kmlUrl = ...;
await loadKML(kmlUrl, {
popupProperty: '<property name for popup text>'
});
const geoJsonUrl = ...;
await loadGeoJSON(geoJsonUrl, {
colorProperty: '<property name for feature color>',
popupProperty: '<property name for popup text>'
});
await loadHeatmap(geoJsonUrl, {
singleton: <true | false>, // display a single heatmap layer at a time
smooth: <true | false>, // apply log-smoothing to intensity values
normalize: <true | false> // normalize intensity values based on maximum value
});- Points of interest
- Heatmaps
- National Snow and Ice Data Center (NSIDC) Snow Data: https://nsidc.org/data/g02158/versions/1
- USGS Earthquakes: https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php
For points of interest, a common source of user-generated data is the My Maps interface within Google Maps, which allows users to create custom maps and export markers as KML/KMZ files.
For heatmaps, some data sources require custom adapter logic to parse, format, and convert the data into the GeoJSON format.
As part of the prototype for displaying snow depth data from NSIDC, we provide an example adapter that is able to download and convert NSIDC Snow Data Assimilation System (SNODAS) data into GeoJSON files.