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(sf)
## Linking to GEOS 3.13.1, GDAL 3.11.4, PROJ 9.7.0; sf_use_s2() is TRUE
library(tmap)
country <- get_map("country")
division <- get_map("division")
district <- get_map("district")
upazila <- get_map("upazila")
union <- get_map("union")
# Create subset for Ramna and Jatrabari
subset_upazila <- upazila %>%
  filter(Upazila %in% c("Ramna", "Jatrabari"))

plot(subset_upazila[1])

tm_shape(subset_upazila) +
  tm_polygons(col = "yellow",
              border.col = "pink") +
  tm_text("upazila", size = 1) +
  tm_layout(title = "Major Transport Hub Upazila 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.