I know tm_text()
uses centroids to locate labels, however when I try to run the code using the Shapefiles from this webpage (Instituto Dominicano de Datos Espaciales): (https://geoportal.iderd.gob.do/layers/geonode_data:geonode:RD_PROV/metadata_detail) the map locates the provinces names way outside. This is the map I want to replicate with the names exactly in the middle.
The code I use is:
library(tmap)
library(rgdal)
library(dplyr)
library(sf)
library(maptools)
library(rgeos)
map_prov <- readOGR("RD_PROV.shp")
map_REG <- st_read("RD_REG_20220630.shp")
tmap_mode("plot") + tm_shape(map_prov) +
tm_borders(col="blue") + tm_text("TOPONIMIA", size = "AREA")
The result I get is:(https://i.stack.imgur.com/TFUGR.png)
I need the provinces names more cleanly located as shown above. Also if you know a way to wrap text as shown in first map, it would be great.