R heatmap on ggmap from kriging data

I want to build a heat map on ggmap.

library(ggmap) turku<-get_map('turku', zoom=13) turkumap<-ggmap(turku, extent="device", legend="topleft") turkumap turkumap+geom_density2d(mapping=aes(x = lon, y = lat),data = test, ) 

We ran a measurement campaign, so I have 4460 geo-referenced points.

To have a prediction map, I created a 400 * 400 grid, for a total of 160,000 points, at which I calculate the prediction with kriging. To get a complete picture of this phenomenon on my 3 km * 3 km, I think that some kind of heat map is not needed, because it only plot points, if I am not doing something wrong plots the filled square on the map. (See file ) Code that I use to build points:

 turkumap <- turkumap + geom_point(data=temp, aes(x=lon, y=lat),size=var1.pred) 

Thus, the main problem is that the points are located along the roads, so the heat map is problematic (see here ), and there are too many of them to build them separately. Any suggestions?

Another related question is that my data refers to the classic gstat format, SpatialPointsDataFrame, which means that I have to force them to use the data to use ggplot, is there a better practice?

+1
source share
1 answer

The link provided by @SlowLearner solved my problem

0
source

Source: https://habr.com/ru/post/954136/


All Articles