- Python 100%
applecuckoo's miscellaneous data scripts
it is what it is, most of these have something to do with Wikimedia Commons but some are just there for fun. All of my wiki map scripts come with an 'unwrapped' simplestyle-only version which is then wrapped with the MediaWiki packaging for upload onto Wikimedia Commons.
Said unwrapped versions can be repurposed for use with various dataviz platforms, like Mapbox's geojson.io or Datawrapper
scripts include:
- feltrapidtosimplestyle.py - adds GeoNet-esque simplestyle-spec styling to Felt Rapid data from GeoNet
- feltrapid-to-wiki.py - same thing but takes that GeoJSON and encapsulates it in the MediaWiki map data format
- contours-to-simplestyle.py - converts styling data in contour files generated by USGS ShakeMap1 to simplestyle-spec compatible styling
- geonet-all-in-one.py - creates a file containing epicentre, felt rapid and shaking layers (if available) for an earthquake on GeoNet
flowchart TD
A[Start program with GeoNet public ID] --> B(Fetch epicentre from GeoNet quake API)
B --> C(Fetch Felt Rapid data)
C --> D{Try fetching Shaking Layers data for that particular earthquake}
D --> |404| E(Assemble *just* the epicentre and Felt Rapid data)
D --> |Everything else| F(Assemble the epicentre, Felt Rapid and contour data)
E --> G(Write to file)
F --> G
why on earth would you like to use this
these scripts could be useful for people wanting to cobble together cool visualisations. Also, it gives you a great excuse to play 'pretend journalist' by using the same tools that the mainstream media use...
-
This script works with any set of MMI contours generated by the open-source USGS ShakeMap software. As such, this script doesn't just work with contours generated by the USGS, but also those generated by Geoscience Australia, Earth Sciences New Zealand/GeoNet, and any other agencies running the software. Keep in mind other agencies may not use the ShakeMap brand in public, for example Earth Sciences New Zealand uses the name 'Shaking Layers' to refer to their ShakeMap data. ↩︎