Published
Edited
Aug 26, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
advisoryTrackShp = fetchArchiveFile(ADVISORY_TRACK_SHP_URL, { corsAnywhere: true })
Insert cell
advisoryTrack = {
const data = await shpToGeoJSON(advisoryTrackShp);
const keys = Object.keys(data);
// the layer names annoyingly change with each advisory, so we have to hunt for them
const points = keys.find(key => key.endsWith('5day_pts'));
const line = keys.find(key => key.endsWith('5day_lin'));
const watches = keys.find(key => key.endsWith('ww_wwlin'));
return {
points: data[points],
line: data[line],
watches: data[watches],
};
}
Insert cell
Insert cell
Insert cell
preliminaryBestTrackShp = fetchArchiveFile(PRELIMINARY_BEST_TRACK_SHP_URL, { corsAnywhere: true })
Insert cell
preliminaryTrack = {
const data = await shpToGeoJSON(preliminaryBestTrackShp);

const points = data[`${NOAA_HURRICANE_ID}_pts`];
const line = data[`${NOAA_HURRICANE_ID}_lin`];
const windSwath = data[`${NOAA_HURRICANE_ID}_windswath`];

return {
points,
line,
windSwath
};
}
Insert cell
Insert cell
Insert cell
advisoryWindFieldShp = fetchArchiveFile(ADVISORY_WIND_FIELD_SHP_URL, { corsAnywhere: true })
Insert cell
advisoryWindField = {
const data = await shpToGeoJSON(advisoryWindFieldShp);
const keys = Object.keys(data);
const initial = data[keys.find(key => key.endsWith('initialradii'))];
return initial;
}
Insert cell
Insert cell
Insert cell
windSpeedProbabilitiesArchive = fetchArchiveFile(WIND_SPEED_PROBABILITIES_URL, { corsAnywhere: true })
Insert cell
probabilities = ['50-60', '60-70', '70-80', '80-90', '>90%']
Insert cell
windSpeedProbabilities = {
const data = await kmzToGeoJSON(windSpeedProbabilitiesArchive);
const keys = Object.keys(data);
const knots34 = data[keys.find(key => key.endsWith('wsp34knt120hr_5km'))];
knots34.features = knots34.features.filter(({ properties }) => probabilities.includes(properties.name));
return knots34;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more