This is a repo to store and sometimes update geojson file that contains any state and cities in Indonesia
- You have to download the geojson files
- Plot as usual
- I also put sample value for plotting example
library(sf)
library(leaflet)
province = readOGR("provinsi/all_maps_state_indo.geojson")
## Leaflet
pal = colorNumeric("viridis", province$sample_value)
leaflet(province) %>%
addTiles() %>%
addPolygons(stroke = FALSE, smoothFactor = 0.3, fillOpacity = 0.7,
fillColor = ~pal(sample_value),
label = ~paste0(name, ": ", prettyNum(sample_value, ","))
) %>%
addLegend("topright", pal = pal, values = ~sample_value,
title = "Populasi (Ribu Jiwa)",
opacity = 0.5, na.label = "")
library(sf)
library(leaflet)
cities = readOGR("kota/all_maps_city_indo.geojson")
pal = colorNumeric("viridis", cities$sample_value)
leaflet(cities) %>%
addTiles() %>%
addPolygons(stroke = FALSE, smoothFactor = 0.3, fillOpacity = 0.7,
fillColor = ~pal(sample_value),
label = ~paste0(name, ": ", prettyNum(sample_value, ","))) %>%
addLegend("topright", pal = pal, values = ~sample_value,
title = "Populasi (Ribu Jiwa)",
opacity = 0.5, na.label = "")
- Province - contains of 34 state multipolygon
- Cities - contains of 514 cities/regency multipolygon
I use geojson.io to create some additional geometry and this very helpful website that post some shapefile
file.
I used Thiessen polygon
to divide the area of the village geojson into a number of hamlet areas. The pedukuhan coordinates are temporarily generated randomly from the village map polygon.