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

All Questions

Tagged with
0 votes
1 answer
74 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 ...
Iris Van Paemel's user avatar
1 vote
1 answer
50 views

Mean of geospatial distance between two datasets of different lengths

I want to compute the mean distance between all points of the toy1 dataset with the closest point of the toy2 dataset. So for each point of the toy1 dataset, I want to find the closest point among the ...
Camillionnaire's user avatar
1 vote
0 answers
72 views

Inconsistent results when matching closest lat/long points in r using sf and st_distance()

I have a large dataset where each row is a station. I need to find the closest station within each year but where a different type of equipment was used. I then want to either combine these rows into ...
GenieV's user avatar
  • 33
1 vote
2 answers
673 views

Distance between pairs of coordinastes (UTM) in km with R

I have a dataframe with 2 pairs of UTM (32N) coordinates and I need to compute the differences in km between each of them, from origin to destination. I'm trying with sf library, using "...
ggg's user avatar
  • 93
1 vote
1 answer
226 views

Distance between points along path in R

I want to compute distance between nodes along a path (network). I have two shapefiles. One is a point layer representing train stations: train_station <- structure(list(geometry = structure(list(...
Pol Cosentino's user avatar
1 vote
1 answer
568 views

Grouping polygons and neighbours based on distance criteria

I would like to group polygons together based on a distance criteria: Any polygon within a certain distance (1200 metres or less) of an origin polygon are grouped together If other polygons are ...
Chris's user avatar
  • 1,237
0 votes
0 answers
253 views

How to get the shortest line between two polygons in R

I'm using st_distance() in the R package sf to compute the distance between two polygons. I'd like to also get the shortest line between the polygons, i.e. the line along which the distance is ...
Cyril Mory's user avatar
0 votes
1 answer
475 views

Nearest adjacent polygon, distance and closest point to other polygons

I have multiple polygons in a dataset and I would like to: Identify the nearest polygon to each polygon and what the distance between them is Calculate the coordinates of where the nearest parts of ...
Chris's user avatar
  • 1,237
1 vote
1 answer
404 views

Calculate nearest point coordinate and distance by differing years between two data frames using sf

For each observation in a data frame in a year I am trying to finde the nearest observation in another data frame one year prior and calculate their distance. Following this (https://gis.stackexchange....
Anton's user avatar
  • 254
1 vote
1 answer
360 views

How to loop st_distance through list

My goal is to apply the st_distance function to a very large data frame, yet because the data frame concerns multiple individuals, I split it using the purrr package and split function. I have seen ...
Beardedant's user avatar
2 votes
1 answer
1k views

How to solve this problem with the st_distance function from sf giving an error when inspecting the data?

I have this data: df <- data.frame (pc_home = c(1042, 2052, NA, 4021, 9423, NA, 1502, 5942), pc_work = c(NA, 2105, NA, 4352, 8984, NA, 1495, 6050), centroid_home ...
Victor Nielsen's user avatar
1 vote
0 answers
706 views

Minimal distance between random points in r

I am trying to make a random sample of points on a shape layer composed of multipolygons. I use for that the st_sample function of package sf. I get my sample with the desired number of points but I ...
Carl Bethuel's user avatar
2 votes
1 answer
734 views

Finding coordinates from heading and distance in R

I want to get the coordinates of new points, preferably using the sf package, when the inital positions and the distance and heading traveled is known. Consider this; we have three points (pts), with ...
Jeppe Olsen's user avatar
  • 1,008
0 votes
1 answer
346 views

Calculating distance between consecutive projected coordinates within individuals (adding distance column?)

I have a movement dataset with different individuals and projected coordinates. The coordinates were projected into UTM using the following code: coordinates(data) = ~x+y #turns data into spatial data ...
Cam's user avatar
  • 451
1 vote
1 answer
373 views

st_distance -How to visualise the distance between different variables in a large spatial data set

I am very new to spatial analysis in R, been learning as much as i can but hit a road block. Objectives: To visualise a 15000 sites (across England) data set spatially - Done To measure the distance ...
Arron_2012's user avatar

15 30 50 per page