library(tmap)
library(bangladesh)
division <- get_map("division")
tm_shape(division) +
tm_polygons()

tm_shape(division) +
tm_polygons(fill = "Division")

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh")

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division")

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
tm_compass(position = c("left", "bottom"),
type = "4star", size = 5)

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
tm_compass(position = c("left", "bottom"), type = "8star", size = 5) +
tm_scalebar(position = c("right", "bottom"), text.size = 0.7)

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
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")

tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division")
## [nothing to show] no data layers defined
tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
tm_compass(position = c("left", "bottom"),
type = "4star", size = 5)

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
tm_compass(position = c("left", "bottom"), type = "8star", size = 5) +
tm_scalebar(position = c("right", "bottom"), text.size = 0.7)

tm_shape(division) +
tm_polygons(fill = "Division") +
tm_title("Divisions of Bangladesh") +
tm_text("Division") +
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")

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
division <- get_map("division")
subset_division <- division %>%
filter(Division %in% c("Dhaka"))
plot(subset_division[1])

library(dplyr)
division <- get_map("district")
subset_division <- division %>%
filter(Division %in% c("Dhaka"))
plot(subset_division[1])

library(dplyr)
district <- get_map("district")
Dhaka_district <- district %>%
filter(Division == "Dhaka")
plot(Dhaka_district[1], col = "lightblue", main = "Dhakadistritcs")

library(dplyr)
district <- get_map("district")
subset_district <- district %>%
filter(District %in% c("Munshiganj"))
plot(subset_district[1])

library(dplyr)
district <- get_map("district")
subset_district <- district %>%
filter(District %in% c("Munshiganj"))
plot(subset_district[1])

library(dplyr)
upazila <- get_map("upazila")
Munshiganj_upazila <- upazila %>%
filter(District == "Munshiganj")
plot(Munshiganj_upazila[1], col = "lightblue", main = "MunshiganjUpazilas")

library(tmap)
library(bangladesh)
library(dplyr)
library(sf)
## Linking to GEOS 3.13.1, GDAL 3.11.0, PROJ 9.6.0; sf_use_s2() is TRUE
upazila <- get_map("upazila")
Sreenagar_map <- upazila %>%
filter(Upazila == "Sreenagar")
tm_shape(Sreenagar_map, bbox = st_bbox(Sreenagar_map)) +
tm_polygons(fill = "skyblue", border.col = "black") +
tm_text("Upazila", size = 1.2, col = "black") +
tm_title("Sreenagar Upazila Map", size = 1.5) +
tm_compass(type = "8star", position = c("right", "bottom"), size = 4) +
tm_scalebar(position = c("left", "bottom"), text.size = 1) +
tm_grid(lines = TRUE, labels.size = 1, col = "gray60")
##
## ── 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').
## This message is displayed once every 8 hours.

library(tmap)
library(bangladesh)
library(dplyr)
library(sf)
upazila <- get_map("upazila")
Gazaria_map <- upazila %>%
filter(Upazila == "Gazaria")
tm_shape(Gazaria_map, bbox = st_bbox(Gazaria_map)) +
tm_polygons(fill = "skyblue", border.col = "black") +
tm_text("Upazila", size = 1.2, col = "black") +
tm_title("Gazaria Upazila Map", size = 1.5) +
tm_compass(type = "8star", position = c("right", "bottom"), size = 4) +
tm_scalebar(position = c("left", "bottom"), text.size = 1) +
tm_grid(lines = TRUE, labels.size = 1, col = "gray60")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────

library(tmap)
library(bangladesh)
library(dplyr)
library(sf)
upazila <- get_map("upazila")
Tongibari_map <- upazila %>%
filter(Upazila == "Tongibari")
tm_shape(Tongibari_map, bbox = st_bbox(Tongibari_map)) +
tm_polygons(fill = "skyblue", border.col = "black") +
tm_text("Upazila", size = 1.2, col = "black") +
tm_title("Tongibari Upazila Map", size = 1.5) +
tm_compass(type = "8star", position = c("right", "bottom"), size = 4) +
tm_scalebar(position = c("left", "bottom"), text.size = 1) +
tm_grid(lines = TRUE, labels.size = 1, col = "gray60")
##
## ── tmap v3 code detected ───────────────────────────────────────────────────────
