Open stevenlis opened 5 years ago
Yes, geoplot.heatmap
only works on point features lacking magnitudes. If you have gridded data with magnitudes, as in the cases you mentioned, this API won't work for you.
Heatmaps based on gridded magnitude data is a generalization of heatmaps based on point data, and I'm afraid there's quite a lot of math you or I would need to chew down to work an algorithm out. I don't personally know of any way to achieve this currently in Python.
I'd recommend creating a grid of squares around each observation, and plotting that as a choropleth. You can think of this as a pixelated heatmap.
@ResidentMario Indeed...I'm looking at this API from matplotlib
and see if I can figure it out. Sadly, this heatmap thing is the only part that is missing from my complete python workflow. Thank you for your kind reply.
Very cool! Maybe an implementation is easier than I thought (just reuse this component).
@ResidentMario It would be great if there is a Python package that uses scipy
interpolation module but is designed for geospatial point pattern analysis specifically like IDW and other more advanced methods.
This is known as an isopleth in the literature.
xarray
seems to able to do this: http://xarray.pydata.org/en/stable/examples/monthly-means.html
@ResidentMario The isopleth might be very useful but might not be what I was suggesting for since there are many methods for interpolation.
I just read a book this week and the author talked about a few different types of interpolation (e.g., IDW) often used in GIS in chapter 8 and shared his code here.
Well, this feature request is for a plot function that takes point data with magnitudes as input, applies some sort of smoothing/interpolation function over it, and outputs a heatmap (which is an isopleth, in this context).
Interpolation can be tunable using a plot parameter. gplt.quadtree
already defines an agg
parameter for an aggregation function; an isopleth
function could have a similar special parameter for a smoothing function whose default argument is an idw
algorithm.
as an arg? man... I think I would like such an API design and am definitely looking forward to it!
I'm so glad to see a package that makes plotting geo heatmap this kind of easy and beautiful. After reading the API and I realize that the heatmaps produced by geoplot using seaborn represent the density of geo-events. I wonder if there is any way you can think of to use interpolation method to generate those kinds of heatmaps representing air pollution, temperature, etc.
I've been looking for a way to do this kind of plot for a white.