library(bangladesh)
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)
library(sf)
## Linking to GEOS 3.13.1, GDAL 3.11.4, PROJ 9.7.0; sf_use_s2() is TRUE
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
union <- get_map("union")
transport_hub <- district %>%
filter(District %in% c("Dhaka", "Chittagong" ,"Rajshahi"))
plot(transport_hub[1])

transport_hub <- st_transform(transport_hub, crs = 32646)
tm_shape(transport_hub) +
tm_polygons(
col = "blue",
border.col = "black"
) +
tm_text("District", size = 0.8) +
tm_title("Major Transport Hub of Bangladesh (Dhaka, Chittagong & Rajshahi)") +
tm_compass(position = c("left", "bottom"), type = "8star", size = 5) +
tm_scalebar(position = c("right", "bottom"), text.size = 0.7) + 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').
## [plot mode] fit legend/component: Some legend items or map compoments do not
## fit well, and are therefore rescaled.
## ℹ Set the tmap option `component.autoscale = FALSE` to disable rescaling.
## This message is displayed once every 8 hours.

ttmp()
## ℹ tmap modes "plot" - "view"
## ℹ toggle with `tmap::ttm()`
##
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────