简体   繁体   中英

Plot a heat map on a google map with 3d data in R

I've created a table of data which has a series of Lat/Lon coordinates and a corresponding number from 0-100+ I'm looking to somehow overlay this onto a google map and create a heatmap from it but all I can find are methods which concern 2d data ie coords but no corresponding factor.

I've been quite stuck on this for a while so if anyone knows of any functions that might do the trick or would like to have a crack at it let me know and I can post some code/data.

Simplified data

Lat Lon Value
26  -72 0
26  -73 1
26  -74 2
26  -75 3
26  -76 2
26  -77 1
26  -78 0
25  -72 0
25  -73 0
25  -74 1
25  -75 2
25  -76 1
25  -77 0
25  -78 0
24  -72 0
24  -73 0
24  -74 0
24  -75 1
24  -76 0
24  -77 0
24  -78 0
27  -72 0
27  -73 0
27  -74 1
27  -75 2
27  -76 1
27  -77 0
27  -78 0
28  -72 0
28  -73 0
28  -74 0
28  -75 1
28  -76 0
28  -77 0
28  -78 0

Somehting like this picture would be great!

Since I wrote my comment under the question, I've added this capability into my googleway package

To use Google Maps you need a valid Google Maps API key

library(googleway)

map_key <- "your_api_key"

google_map(key = map_key) %>%
    add_heatmap(data = df, weight = "Value", option_radius = 0.5)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM