时空维度挖掘(二)之 leaflet
|
今朝 leaflet.extras 也支持更多的插件中的变乱。好比可以通过多边形的编辑实现地理围栏: leaflet::leaflet() %>%
leafletCN::amap()%>%
leaflet::setView(lng = 116,lat = 39,zoom = 12) %>%
addDrawToolbar(
targetGroup='draw',editOptions = editToolbarOptions(selectedPathOptions = selectedPathOptions())) %>%
addLayersControl(overlayGroups = c('draw'),options =
layersControlOptions(collapsed=FALSE)) %>%
addStyleEditor()
# 通过 input$MAPID_draw_all_features 会返回地理围栏的相干信息
# input$MAPID_draw_start 返回 绘制开始 信息
# input$MAPID_draw_stop 返回 绘制遏制 信息
# input$MAPID_draw_new_feature 返回 建设绘制 信息
# input$MAPID_draw_edited_features 返回 编辑绘制 信息
# input$MAPID_draw_deleted_features 返回 删除绘制 信息
observeEvent(input$map_draw_all_features,{
#print("All Features")
num_features <- length(input$map_draw_all_features$features)
if (is.null(unlist(input$map_draw_all_features$features[num_features]))){
return(NULL)
}#判空
if(input$map_draw_all_features$features[[num_features]]$properties$feature_type != 'polygon') {
return(NULL)
}
cords_list <- input$map_draw_all_features$features[[num_features]]$geometry$coordinates[[1]]
})
数据布局这里有一个用于表述地理数据的非凡数据框,被称为 SpatialPointsDataFrame,通过它可以实现空间几许中点、线、面的表达。 它首要有下面5个部门构成:
算法空间计较中点、线、面的数据 一、叠置说明二、邻域说明三、窗口说明案例参考资料
相干产物
|

