[R-sig-Geo] Linear referencing in R

Kent Johnson kent3737 @ending from gm@il@com
Sun Sep 30 03:17:42 CEST 2018


You need to snip out the sections of the railroad file rather than
connecting the endpoints. Maybe this is closer to what you want?

segments = topoESQ_comp %>%
  filter(to_km <= 871) %>%
  purrr::pmap(function(from_km, to_km, ...) {
    st_linestring(do.call(rbind,
Estacas_1m$geometry[((1000*from_km):(1000*to_km))+1]))
}) %>%
  st_sfc

Kent Johnson


> Date: Fri, 28 Sep 2018 19:52:03 -0300
> From: Rubem Dornas <rapdornas using gmail.com>
> To: r-sig-geo using r-project.org
> Subject: [R-sig-Geo] Linear referencing in R
> Hi, people! I hope I'll be not to speculative in my question and that you
> can comprehend my problem.
>
> Well, I have a railroad shapefile and I have two csv files corresponding to
> the topography in each side of the railroad. The csv are organized in this
> way:
>
> ID_topo, from_km, to_km, height
> 1, 0, 1.91, 15
> 2, 1.91, 2.23, -3
>
> I created a point shapefile for each meter of the railroad and then I
> proceeded with a join (not spatial) between the from_km of the topography
> data frame and the km mark (km_calc) from the point railroad.
>
> My goal is to create shapefiles for each of the railroadside topography.
> The issue is that when I try to make a new line shapefile from topography
> based on the points of the railroad, what I get is a line that has doesn't
> follow the curvature of the railroad. Using the example of the csv above,
> what I get are several straight lines linked by the from_km to to_km. (Here
> is a link to a print screen from QGIS:
>
> https://www.dropbox.com/s/erfsst8pasoqj64/Captura%20de%20tela%202018-09-28%2019.49.47.png?dl=0
> <http://Image>)
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list