Skip to main content
The 2024 Developer Survey results are live! See the results

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.

3 votes
1 answer
73 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 ...
Leprechault's user avatar
  • 1,707
1 vote
3 answers
67 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(&...
Excelsior's user avatar
  • 181
3 votes
2 answers
129 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 ...
nola's user avatar
  • 45
1 vote
1 answer
81 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 ...
mikejwilliamson's user avatar
0 votes
1 answer
56 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 ...
user23632192's user avatar
0 votes
1 answer
99 views

Draw data ellipses at spatial locations

I have a data objects that contains a sample of measurements obtained for two air pollutants at a series of monitoring stations. I also have the spatial coordinates of these stations. For example: ...
agila's user avatar
  • 3,630
0 votes
1 answer
69 views

Longitude and latitude data not generating correct polygons using maps/mapdata/ggplot2 packages

I am trying to draw a map for all province within Egypt using maps and ggplot2 package in R, but I did not find any sub-region (provinces) for Egypt available in the databases of these packages. So, I ...
Mohamed Samir's user avatar
0 votes
1 answer
78 views

How to match the coordinates of 2 shapefiles in R

I have 2 shapefiles, one of them has the coordinates of administrative units as a multipolygon, and the other has the coordinates of various sections of a border wall as a multilinestring. I am trying ...
user24939654's user avatar
2 votes
1 answer
83 views

How to adjust population data in a raster dataset using census data from an administrative boundary shapefile

I downloaded 100m resolution population raster data from WorldPop, and through transprojection and cropping, I got a city's population spatial distribution raster data, in addition, I have the ...
Wei Liao's user avatar
1 vote
2 answers
92 views

R: Weighted mean is 0 for buffers that have no data

I am a newbie at R and am having trouble figuring this issue out so any help would be appreciated. I have daily flooding raster data that I am using to calculate the weighted mean of flooding in ...
Iris Iris's user avatar
0 votes
1 answer
97 views

Z coordinates are missing in sfc geometry in R

i'm literally new in programming and R. I have set of street networks and the segments of each network has been exploded by using QGIS. After using st_read, I found that the type of geometry of my sfc ...
Daksa Lintang's user avatar
0 votes
1 answer
68 views

What is returned by st_coordinates?

I am in the process of converting R scripts to Python and there are multiple uses of st_coordinates. I know that geopandas has similar functionality in get_coordinates, but st_coordinates apparently ...
wannabeengineer15's user avatar
1 vote
1 answer
104 views

Incorrect results when intersecting point and polygon data with sf in R

I’m getting bizarre results when I intersect some point data with polygons using the sf package in R, and while I think I’ve found a solution, I’m so baffled by the issue that I’d really appreciate it ...
dmcd's user avatar
  • 135
2 votes
1 answer
77 views

How to show both colors at a border using geom_sf?

I'm creating a map with two layers- a heatmap (geom_tile) with biome data and layering a map of the different regions on top. I've got a list countries in each region and I got R to display a map with ...
Jordan T's user avatar
3 votes
1 answer
110 views

Is there a way to completely snap a linestring to polygon in R?

I have 2 SHP files, one with many linestrings (railroads) and one with many polygons (counties in the U.S.). There is no intersections between those two files at all. My goal is to snap the lines to ...
Roee Diler's user avatar

15 30 50 per page