R 中传单地图上的 3D 条形图可视化 [英] 3D Barplot visualization on leaflet map in R

查看:31
本文介绍了R 中传单地图上的 3D 条形图可视化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 R 和 Leaflet(在一个闪亮的应用程序中).我有我想通过地图上的 3D 图可视化的点数据 - 像这样:

从 v0.2.1006 开始,您可以使用 add_column() 函数

I am using R and Leaflet (in a shiny app). I have point data which I want to visualize through a 3D plot on a map - like this: https://slipiste.wordpress.com/2015/09/29/3d-bar-plot-on-a-map-in-r/ Understandable how to do that if not done on leaflet. But how to do plot that on a leaflet map? Is there a way to do that?

They way I see it would have to overlay a shapefile (transparent) over my leaflet map and plot the 3D Barplot on that shapefile. However, that seems like a messy workaround. But, I did not find any websites on that topic. Any hints?

解决方案

A few years on library(mapdeck) lets you plot a 3D bars on a map

library(mapdeck)

set_token("MAPBOX_TOKEN") ## you'll need an API token

df <- read.csv(paste0(
  'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/',
  'examples/3d-heatmap/heatmap-data.csv'
))

mapdeck(
  style = mapdeck_style('dark')
  , pitch = 45 
  ) %>%
  add_grid(
    data = df[1:30000, ]
    , lat = "lat"
    , lon = "lng"
    , cell_size = 1000
    , elevation_scale = 50
    , layer_id = "grid_layer"
  )

And from v0.2.1006 you can use the add_column() function

这篇关于R 中传单地图上的 3D 条形图可视化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆