简体   繁体   中英

How to create a weighted heatmap using R Leaflet?

I am attempting to create a heatmap using a data set that has only one value per coordinate, with that value being a continuous variable. All of the examples I have found using leaflet.extras::addHeatmap() use data that can have multiple values per coordinate, and create the heatmap based on the density of counts in an area. There doesn't seem to be a way to pass a weight instead.

My ultimate goal is to have something that looks like a raster based on these values:

在此处输入图像描述

However I don't want to use a raster due to the pixelation along the coasts.

When I pass the data to addHeatmap() and include the argument intensity = ~my_weighted_value , I get something like this:

在此处输入图像描述

And at increased zoom levels, it just ends up being a bunch of circles:

在此处输入图像描述

What is the proper way to take weighted spatial data and add a heatmap that looks like the raster?

Try to scale my_weighted_value back by *.00001 or something. Your weighted value appears to be exceeding the max.

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