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

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

问题描述

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

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?

我认为他们必须在我的传单地图上覆盖一个shapefile(透明),然后在该shapefile上绘制3D Barplot.但是,这似乎是一个混乱的解决方法.但是,我没有找到有关该主题的任何网站.有提示吗?

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?

推荐答案

library(mapdeck)上的几年时间可以让您在地图上绘制3D条形图

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"
  )

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

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

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

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