Questions tagged [tmap]

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on the Layered Grammar of Graphics, and resembles the syntax of ggplot2, a popular R-library for drawing charts.

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on A Layered Grammar of Graphics by Hadley Wickham and resembles the syntax of , a popular R-library for drawing charts.

Repositories

Vignette

Presentation

Other resources

487 questions
1
vote
1 answer

Calculating the maximum/(or minimum) distance between each polygons within a shapefile

I would like to calculate the distances between each polygon in a shapefile using the sf package (or other packages that potentially works). I prefer the distance to be the maximum or minimum distance (as I don't know how to set up these…
Jingjun
  • 177
  • 7
1
vote
1 answer

st_geometry<-.data.frame(*tmp*, value = value) : inherits(value, "sfc") || is.character(value) is not TRUE

I am trying to plot a percentile map with the following data frame DF1 - Covid_DF - [Province, City, District, Sub_District, Cases, Death, Month, ID] DF2 - DKI_Jakarta- [Object_ID, Village_Code, Village, ID, Province, City, District, Sub_District,…
Lostguy97
  • 9
  • 3
1
vote
0 answers

spatio-temporal distribution animation. Add time axis for better visualization

I have added an animation to see spatio-temporal distribution of crashes for a day in region of London. How can I see the time of crash to better appreciate the animation? A simpler method is to plot crash number and time as text on heading or…
SiH
  • 1,378
  • 4
  • 18
1
vote
1 answer

How to change the order of legend elements in tmap

Does anyone have experience of changing the order of legend elements when using tm_fill? I created a map using tm_polygon and tried breaks and labels to change the order. Both of them failed. Please see examples below. gov_reg_update is the sf…
Yabin Da
  • 553
  • 5
  • 11
1
vote
1 answer

converting sf to raster using predefined cell size and plot it

nz_height and nz are present in spData package. nz_height - sf class dataset - Top 101 highest points in New Zealand. nz - sf class data - Polygons representing the 16 regions of New Zealand. Below is the plot for visualization using tmap() Can…
SiH
  • 1,378
  • 4
  • 18
1
vote
0 answers

Why does tmap not produce earth shaped/round plots with tmap_style("natural") anymore?

When I'm using the tmap style "natural" or "classic" the map is not earth shaped anymore. I am using the same code that created the earth shaped plots. I tried closing all packages restarting R dev.off() setting all options manually instead of…
Sarah
  • 11
  • 2
1
vote
1 answer

How to get a static tmap with shiny as show in rstudio?

I'm learning shiny and tmap. I'm able to get the map I want on Rstudio (a static tmap). But when I try a similar tmap code with shiny, I always get an interactive map. From this reprex, I try to get the same map I get on Rstudio. I try to add…
hugo-lep
  • 11
  • 2
1
vote
1 answer

sp::proj4string(obj) : CRS object has comment, which is lost in output in R

I am trying to plot a map using tmap library: library("rgdal") library("tmap") area_dnipro <- readOGR("dnipro.shp", encoding = "UTF-8", use_iconv=TRUE) tm_shape(area_dnipro) + tm_polygons() But during plotting I am getting this message: Warning…
Helios
  • 141
  • 1
  • 2
  • 10
1
vote
1 answer

Transform sql query to talend job

I have this sql query that I would like to transform to a talend job. Been looking around but I'm not sure how this should be interpreted efficiently in talend. Below is the query: SELECT p.DISPLAYNAME, T1.DESIGNTL, p2.DISPLAYNAME,…
Savvy
  • 11
  • 1
1
vote
1 answer

Side by side maps with tmap in Shiny

I am trying to compare two thematic maps using tmap package in Shiny. However I got an error argument length zero. Also I want to plot these two maps from selecting Shinyinput panel.I mean from 4 inputs 2 combinations of 4 plot can be drawn.The plot…
Cengover
  • 89
  • 13
1
vote
2 answers

How to calculate the area of a geospatial ZIP code polygon extracted from the US Census using tidycensus

I would like to calculate the population density for ZIP codes in my state (North Carolina). I am able to extract the ZIP code populations and polygons from the US Census and plot the map of North Carolina using the following…
1
vote
2 answers

Save information abouth the path moving from point to point with tmap

I would be thankful if you could help me with the following problem. I have a map for US counties and each county has its own characteristic, say, soil conductivity. Then I have coordinates of the source and signal receiver. What I need to do is to…
1
vote
1 answer

tmap is plotting a different legend (range of values?) for a cropped rasterlayer compared to original raster

I am extremely new to working with spatial data and so most of what I'm about to say is me trying to speak a foreign language. Right now I am trying to learn how to do this all in R (I am slightly more capable with this data in QGIS but for this…
c.custer
  • 407
  • 5
  • 13
1
vote
1 answer

How do I plot multiple state using the sf and tmap packages in r

I am trying plot county level maps. I came across a tutorial that uses the sf package and the tmap package. Using ?st_read, it shows an example of how to get county level data using North Carolina as an example, using the following code - nc =…
The Rookie
  • 877
  • 8
  • 15
1
vote
1 answer

How to change a legend text with tmap

I am trying to make a simple map with R and tmap, everything works well but I can't fully customize the legend. I have used legend.format = list(text.separator = "-") to change the text from, say "40 to 60" to "40 - 60" (i want my map legend in…