Questions tagged [r-sf]
The motivation behind the `sf` package is to provide a complete, standardized implementation of simple features in R, with links to GDAL, GEOS and Proj.4. There is a also https://gis.stackexchange.com/ for spatial R questions.
r-sf
1,990
questions
-1
votes
1
answer
67
views
Misaligned sf object in ggplot
I have two sf objects, which when plotting are slightly misaligned.
While initially the two objects have different CRS:
the first has: WGS 84
the second has: MGI / Austria GK East
I proceed, as ...
1
vote
1
answer
37
views
I would like to identify the primary administrative unit from the latitude and longitude coded in the dataset
I want to identify the primary administrative unit from the latitude and longitude coded in the dataset, and fill that administrative unit with red
What I tried:
library(rnaturalearth)
library(sf)
...
0
votes
1
answer
35
views
`purrr` mapping of `st_intersects()` using inputs from across two lists
I have a list of geocoded point dataframes that I want to intersect with a corresponding list of polygon geometry dataframes. Below is a reprex to create the data structure:
library(dplyr)
library(...
2
votes
1
answer
34
views
Rotating/angle of ggplot key_glpyh, custom legend key glyph
I am trying to emulate a plot style ive seen online, created by Chris Canipe (https://www.axios.com/2017/12/15/the-flow-of-goods-between-states-1513304375). Looking at trade flows, I've managed to ...
0
votes
0
answers
51
views
How to create a 'count' choropleth map? Large dataframe with many different values overlain on separate geodatabase
I am aiming to plot a choropleth map (plotted using the polygons from a geodatabase) that will count the number of instances per region (wildlife management units) from a separate data frame (...
0
votes
1
answer
67
views
Removing white border plotting maps with geom_sf
I am attempting to remove the white borders around a facet plot that I created with geom_sf(). Previously I was using the now deprecated rgdal package and coord_cartesian(). I am trying to get a ...
0
votes
1
answer
54
views
Transform point into UTM 32N
i am coding with R and RStudio. I have a set of polygons in one in my global environment called buek250_shapefile. I am able to plot them with leaflet.
For the next step I wrote a function which gets ...
0
votes
1
answer
94
views
Merge two shapefiles in R, get a dataframe of variable value in each precinct
I'm not a GIS person, this is driving me nuts. I have a shp file of voting precincts. I have another shp file of radio broadcasts. I want to use R to geolocate the broadcasts into the precincts, so ...
0
votes
1
answer
67
views
I need spatial polygons representing the land and sea in a world map and then convert them to a dataframe
I need a world map in R that can be transformed into polygons of land to be able to calculate distances through sea from one point to another and going around land/polygons. These polygons need to be ...
1
vote
2
answers
73
views
Filter polygons on coordinates
I'm currently working with a shapefile that does not contain explicit latitude and longitude coordinates. My goal is to filter out areas with latitudes above 60 degrees. I want to delete the small ...
3
votes
1
answer
67
views
Trying to create continent map for South America but geom_polygon produces zigzag fill
I try to do this ggplot:
library (sf)
library(dplyr)
library(ggplot2)
continents.f.xy <- st_zm(continents.f)
continents_map_SA <- continents.f.xy%>%
dplyr::bind_rows() %>% #bind the ...
1
vote
3
answers
62
views
customize malaria atlas project autoplots
I am trying to plot some data from the Malaria Atlas Project. Therefore, I looked in the vignette and used an example for getting started:
if (!require("malariaAtlas")) install.packages(&...
3
votes
2
answers
119
views
R: How to replace values in polygon geometry without a for loop?
I have over 60,000 building polygons footprints in shapefile format (polygonZ) where I need to replace the z values (for each ring) for all the polygon vertices, so that all the Z values for the ...
1
vote
1
answer
76
views
adehabitatHR KUD loop not overlaying mapping correctly in R
I have some code which calculates KUD at 95% from fish position data, restricted by the bounds of a shapefile, and then plots this, and overlays the shapefile on top.
########## BOUND KUD TO SHAPEFILE ...
0
votes
1
answer
53
views
Downloaded sf polygon data are not visible on plotted map
I´m trying to create a range map in R, which is supposed to show the occurrences of a specific tree species (Quercus cerris) in the world. For this, I use the BIEN database and the function ...