r-sp Questions

2

Solved

I am working with lat long coordinates in R. First I need to transform my coordinates to zone 17 and then add some buffer to them. For that I used next code (the data used is in orig_coords ): libr...
Chiliarch asked 16/6 at 22:35

3

This is an extension to Improve centering county names ggplot & maps and ggplot centered names on a map. It is not only a theoretical problem, I came across that particular case on answering Ho...
Ens asked 22/6, 2022 at 13:40

4

Solved

I have a set of coordinates: d1 <- data_frame( title = c("base1", "base2", "base3", "base4"), lat = c(57.3, 58.8, 47.2, 57.8, 65.4, 56.7, 53.3), long = c(0.4, 3.4, 3.5, 1.2, 1.5, 2.6, 2.7)) I...
Siouan asked 14/8, 2018 at 8:53

1

Solved

I have the following coordinates in DMS format. I need to convert them to decimal degrees. # Libraries > library(sp) > library(magrittr) # Latitide & Longitude as strings > lat <- ...
Setula asked 7/10, 2021 at 15:52

3

Solved

below is an example of finding route, travel time and travel distance from 'One World Trade Center, NYC' to 'Madison Square Park, NYC' using osrm package in R. (I learnt it from Road Routing in R)....
Quickwitted asked 23/8, 2021 at 22:45

1

Solved

I'm trying to create a simple polygon in sf and select only points within that polygon. What am I doing wrong here? library(concaveman) library(ggplot2) foo.df <- data.frame("long&quot...
Tonnie asked 27/5, 2021 at 14:52

2

I am looking to draw a radius around a lat long point, then use that buffer to filter other points that fit within it. For example: #stores datasets stores = data.frame(store_id = 1:3, lat = c("4...
Sorgo asked 19/5, 2019 at 2:45

3

Solved

I have a SpatialPointsDataFrame and a SpatialPolygons. I want to check for each point in SpatialPointsDataFrame, which polygon in the SpatialPolygons does it lie. I can do this using sp::over to ac...
Labanna asked 10/9, 2020 at 1:20

3

Context My questions are related to the changes induced by the upgrade from PROJ4 to PROJ6 and the consequences in various R spatial packages (sp, sf, raster). We receive now a lot of warnings abo...
Griffen asked 3/9, 2020 at 16:25

1

I want to know the fastest algorithms for obtaining the cartesian distances between each point in a SpatialPointsDataFrame (X) and either (a) the closest point in a second SpatialPointsDataFrame (Y...
Scrubby asked 11/6, 2020 at 23:45

2

Solved

I have been following this workflow to convert coordinates from Eastings / Northings to Latitude / Longitude in R. Up until today it has been working fine. Here is a reproducible example: require(...
Childish asked 1/6, 2020 at 17:17

1

Solved

I have some code showing this error, but, I haven't called "overlay", maybe it's a library function that is calling it Code: d.mle=likfit(P, ini.cov.pars = c(1,30), cov.model = 'matern', ka...
Present asked 11/5, 2019 at 14:38

4

Solved

I have a sf object that contains polygon information (precincts) for a metro area, obtained through a .shp file. For a given lat/lon pair, I want to determine which precinct it belongs to. I'm thin...
Stanza asked 17/4, 2017 at 17:42

2

Solved

In R, we can take a raster and turn it into a SpatialLinesDataFrame with the function rasterToCountour: library(raster) f <- system.file("external/test.grd", package="raster") r <- raster(f...
Eberle asked 4/12, 2018 at 20:40

3

Solved

I'm trying to place a grid over San Jose like this: Grid of San Jose You can make the grid visually using the following code: ca_cities = tigris::places(state = "CA") #using tigris package to g...
Desmoid asked 22/10, 2018 at 20:41

2

Solved

I have a dataframe df1 with 10 columns. Two of these columns are lng and lat. I want to create a SpatialPointsDataframe from df1. When I read on how to create a SpatialPointsDataframe it feels like...
Written asked 15/9, 2015 at 10:22

2

Solved

Using this answer from Ege Rubak as an example, how can I predict pH values for a specific point, say lat = -23.49184 and long = 152.07185, using the idw() function in R? The closest answer I foun...
Absorb asked 9/8, 2018 at 15:22

3

Solved

Using R, I would like to overlay some spatial points and polygons in order to assign to the points some attributes of the geographic regions I have taken into consideration. What I usually do is to...
Apogeotropism asked 17/7, 2018 at 12:52

1

Solved

Hi all, I am struggling with this and hope someone could come out with a simple solution. My objective is to create a regular polygon grid over the extent of a polygon, but rotated by a user-def...
Microsporophyll asked 11/7, 2018 at 10:7

1

Solved

I have some 'roads' as a sp object: class : SpatialLinesDataFrame features : 17360 extent : 490176.4, 567680.9, 148639.1, 212821 (xmin, xmax, ymin, ymax) coord. ref. : +init=epsg:27700 +proj=tme...
Jonahjonas asked 16/5, 2018 at 13:40

1

Solved

I am plotting some spatial data in R using the tmap package. I define breaks and plot color in the tm_dots function. I'd like to be able to define the plot order of the categories so that they are ...
Pejsach asked 15/5, 2018 at 20:45

1

Solved

I have a SpatialPointsDataFrame defining SD boundary, however when I compute the center with gCentroid it's shifted. c. = rgeos::gCentroid(c.) %>% as.data.frame() Why isn't it plotting it at ...
Gimlet asked 9/4, 2018 at 15:29

1

I'm using some spatial data in R, and wondering whether use the packages/functions that rely on the old Spatial format (package sp) or the new package sf. I made this test, based on code found here...
Hookah asked 13/3, 2018 at 14:18

2

Solved

The task I'm trying to do is very simple with the sp package in R but I'm trying to learn sf hence my question. I'm trying to create a shape of points in R. I have lots of points so it has to be ef...
Pi asked 8/1, 2018 at 14:24

3

Solved

Starting from a shapefile containing a fairly large number (about 20000) of potentially partially-overlapping polygons, I'd need to extract all the sub-polygons originated by intersecting their dif...
Barroom asked 19/6, 2017 at 12:48

© 2022 - 2024 — McMap. All rights reserved.