27 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
75
views
Scale colours in spatraster maps
I'm trying to plot multiple geographical maps in SpatRaster using terra, eg.:
> library(tidyterra)
> library(terra)
> library(ggplot2)
> str(edata)
S4 class 'SpatRaster' \[package "...
-4
votes
1
answer
132
views
I have a very long list of cities across many countries. How can I add geographical information such as municipality, state, region, etc.? [closed]
I have a column that contains the place of residence of participants. Some reported as "city/village, country", "postcode city, country", "region, country", etc. There ...
2
votes
1
answer
141
views
Robinson projection of two global raster data from two sources
I tried to access global elevation raster data from two sources:
Source 1 (Natural earth):
I downloaded raster data of world elevation from here: https://www.naturalearthdata.com/downloads/10m-raster-...
2
votes
2
answers
136
views
After projecting, world elevation raster is not visible in plot even though values exist
I downloaded raster data of world elevation from here: https://www.naturalearthdata.com/downloads/10m-raster-data/10m-cross-blend-hypso/ --> Cross Blended Hypso with Relief, Water, Drains, and ...
2
votes
1
answer
222
views
Customizing legend when plotting geom_spatraster and geom_spatvector in R
Using R, I am attempting to create a plot that contains both geom_spatraster and geom_spatvector objects, and I am running into issues with the legend. Using the repex at the bottom below, the legend ...
1
vote
2
answers
132
views
Misalignment of coordinate systems when using terra::as.data.frame instead of tidyterra::geom_spraster with ggplot2
When I was working on the visualisation of spatial data (vector and raster), I ran into some tricky issues: Involves projection conversion of coordinate systems, range conversion of data, and ggplot::...
0
votes
1
answer
131
views
Stop projected data from double-wrapping around map in particular projections (tidyterra)
When plotting global data using tidyterra, I'm experiencing a weird issue with the way the data wraps around the edges of the map (e.g. the -180/180 boundary). As shown in the example below, ...
1
vote
1
answer
98
views
Control rescaling when binning continuous values in tidyterra
I'm trying to use tidyterra's scale_*_whitebox_b() to bin continuous values using custom breaks that are unevenly distributed, to emphasize the difference in the low values. I'm having trouble because ...
1
vote
1
answer
73
views
Problems with facet_* when nulls occur in multilayer rasters
When using tidyterra for multi-layer raster plotting, the facet_* function doesn't seem to work effectively when one of the layers has the null value "NA". I'm not sure if this is a bug or if there is ...
0
votes
1
answer
115
views
White dots on SpatRaster when plotting with tidyterra::geom_spatraster_RGB() and not terra::plotRGB()?
I'm making a map of this island and whenever I try to plot it using tidyterra::geom_spatraster_RGB() there are these white dots and the graph is more pale than when I use terra::plot_RGB(). I ...
1
vote
1
answer
104
views
How to combine SST contour lines and polygons of reef distribution on a world map showing oceans bathymetry?
I would like to create a world map showing the global distribution of coral reefs in combination with the two 20°C isotherms. I have managed to plot them individually, but not in a single graph. The ...
0
votes
2
answers
394
views
How to extract the density population of specific longitude and latitude points from the GHSL population data?
I have a data frame with about 20,000 rows containing the latitude and longitude of points spread across the world. I need to determine the population density at those points, so I considered using ...
1
vote
1
answer
209
views
In tidyterra for R, could facet_grid be implemented?
In R, package tidyterra allows use of facet_wrap(~lyr) to plot multiple spatial raster layers in one figure.
library(terra)
library(ggplot2)
library(tidyterra)
x <- rast(array(data = rnorm(120,0,1),...
0
votes
2
answers
87
views
issues plotting cropped raster DEM in ggplot
It's probably a stupid mistake but I can't figure out what I am doing wrong. I have a DEM raster I can visualize using plot() and ggplot() just fine. But when I try to crop and mask it to a smaller ...
3
votes
1
answer
416
views
Using coord_sf with geom_spatraster changes the resolution
I am trying to plot a subregion of a large raster (e.g., just Arizona out of a raster that covers North America) using tidyterra and ggplot2. I have tried setting the limits of the plot by setting the ...