Plotting the density of latitude and longitude points as a heat map on geographic data

12 views (last 30 days)
Hello, I have tried posting this elsewhere with no luck.
In continuation with my project for plotting lightning over the territory of Poland, I would like to plot the density of latitude and longitude points. So, areas which have more latitude & longitude points over the territory will have a different colour to areas with less latitude & longitude points. Currently I am able to plot latitude and longitude on a map; however, I would like the plots to have different colours depending on their density on this map:
https://imgur.com/a/OqcGq
I have tried many approaches but I have not found anything that works for my case.
I have tried creating a heatmap of points using the hist3 command; whilst this creates a heatmat with respect to density of points. It is a square grid and I cannot transpose this onto my map. I also tried downloading some functions from mathsworks such as this one: https://uk.mathworks.com/matlabcentral/fileexchange/8577-scatplot This is the closest I have gotten to somewhat plotting what I want: https://imgur.com/a/hn9uc using the command: scatplot(perun10_16.longitude, perun10_16.latitude, 'circles') Unfortunately, I do not know of a way to transfer this graph as spatial data onto my map of Poland using command: h = worldmap([48 57], [13 26]) % S = shaperead('POL_adm0.shp', 'UseGeoCoords', true); geoshow(h, S, 'Facecolor',[0.5 0.8 0.7])
% hold on
scatplot(perun10_16.latitude, perun10_16.longitude, 'circles')
% perun10_16.latitude and longitude represents the month of october, 2016.
I am aware that simply slapping on the scatplot function onto my map is not enough to get my idea working. If there was also a way to import a polygon outline of the map of Poland onto the figure I have created, that would also be acceptable; however, I am not sure how to do that either.
I hope this is enough information to know what I am doing. Does anyone have any suggestions as to what I should try now?

Answers (1)

Sean de Wolski
Sean de Wolski on 9 Jan 2020
Look at geodensityplot
https://www.mathworks.com/help/releases/R2019b/matlab/ref/geodensityplot.html

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!