library(bangladesh)
library(sf)
## Linking to GEOS 3.13.1, GDAL 3.11.4, PROJ 9.7.0; sf_use_s2() is TRUE
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tmap)
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
union <- get_map("union")
district <- get_map("district")
transport_hub <- district %>%
filter(District %in% c("Rajshahi", "Dhaka", "Chittagong"))
transport_hub <- st_transform(transport_hub, WGS84 = 4326)
tmap_mode("plot")
## ℹ tmap modes "plot" - "view"
## ℹ toggle with `tmap::ttm()`
tm_shape(transport_hub) +
tm_polygons(col = "blue",
border.col = "black") +
tm_text("District", size = 1) +
tm_layout(title = "Major Transport Hub Districts of Bangladesh") +
tm_scale_bar(position = c("left", "bottom")) +
tm_compass(position = c("right", "top"))+
tm_grid(lines = TRUE, labels.size = 0.8, col = "gray90")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
## [v3->v4] `tm_polygons()`: use 'fill' for the fill color of polygons/symbols
## (instead of 'col'), and 'col' for the outlines (instead of 'border.col').
## [v3->v4] `tm_layout()`: use `tm_title()` instead of `tm_layout(title = )`
## ! `tm_scale_bar()` is deprecated. Please use `tm_scalebar()` instead.
## This message is displayed once every 8 hours.
