Fun with Python for Geodata
Personal practices in geodata analysis with python.
- 1.1 covid-19 and Benford’s law
- 1.2 data visualization exercise
- 1.2.1 Global Annual Temperature Anomaly Interactive scatter plots with lowess trendlines
- 1.2.2 COVID-19 related spatial visualization (time slider map, ridgeline plot, multi tooltip graph)
- 1.2.3 Time series plots (drought, glaicer massbalance)
- 1.2.4 Mapping the World (global airport connection, power plant)
- 1.3 Raster Data Visualization
1. Data Visulization
1.1 covid-19 and Benford’s law
Benford’s law is an interesting theory so I did some experiment with covid-19 data. It’s out of my specialization so there’s no gurantee in the accuracy and quality of this analysis. Be doubtful and just for fun. Here the screenshot is confirmed cases from three countries that I had lived.
Note: After made the first test in April, I later found a correspondence article that support my assumption in May. (Sambridge, M. and Jackson, A., 2020. National COVID numbers-Benford’s law looks for errors. Nature, 581(7809), pp.384-384. doi: 10.1038/d41586-020-01565-5).
1.2 data visualization exercise
Scripts (part1) or jupyter notebooks for processing, visualizing and analyzing data.Some are exported as interactive html files in dataVisualization folder or for preview in the links given.
The raw ipynb file contains contents of custom JavaScript plots will be rendered as static html (see GitHub help), same for exported html files.
Interactive figures or maps for:
1.2.1 Global Annual Temperature Anomaly Interactive scatter plots with lowess trendlines
1.2.2 COVID-19 related spatial visualization
- Ridgeline Plot of COVID-19 Daily Cases
New Cases | New Deaths
1.2.3 Time series plots
- Time series bubble plots
- time series heatmap of drought condition
- Mass Balance of Storglaciären
1.2.4 Mapping the World
- Global Airports Connection Interactive Map, inspired by altair template and OpenFlights.org.
- Global Power Plant, mixed subplots treemaps with plotly.
1.3 Raster Data Visualization
1.3.1 Interactive DEM viewer
rapid flood spreading method (RFSM) practice
2. Automation
2.1 EarthdataDownload.py
This is used to bulk download data from earthdata.nasa.gov. Input required is the link list.
2.2 mosaic.py
This is practice to do mosaic and subset by roi for geotiff data. The process is done with rasterio library.
3. geopyfsn
This is a collection of some functions used for myself.
- getxy: This can be used to obtain the x, y coordinates of a tiff file.
import rasterio
from geopyfsn import getxy
src = rasterio.open('image.tif')
x, y = getxy(src)
###