Convert and export meshcode area to geojson string.
export_mesh(code)
| code | meshcode |
|---|
sf
#> Simple feature collection with 1 feature and 1 field #> geometry type: POLYGON #> dimension: XY #> bbox: xmin: 137.05 ymin: 35.81667 xmax: 137.0625 ymax: 35.825 #> epsg (SRID): NA #> proj4string: NA #> # A tibble: 1 x 2 #> mesh_code poly #> <int> <simple_feature> #> 1 53375084 <POLYGON ((13...>library(leaflet) leaflet() %>% addTiles() %>% setView(lng = 135.0, lat = 38.0, zoom = 3) %>% addPolygons(data = export_mesh( code = c( latlong_to_meshcode(lat = 35.82083, long = 137.0563, order = 3), latlong_to_meshcode(lat = 38.40052, long = 141.0131, order = 3))))#> Warning: the condition has length > 1 and only the first element will be used