[R-sig-Geo] split SLDF with attributes
marta azores
martazores at gmail.com
Fri Feb 24 16:31:21 CET 2017
Thanks for your answer Mel,
Option1) Createsegments: this script cut the SLDF...but as autoridades said
um the website...The results are spatiallines, not SLDF. Then, they don't
jeep the attributes.
Option2) rgeos:over I know this tool, but O have several lines crossing
among them. I am afraid, that can be a bit messy.
I doesn't know the gTouches...I check it after your suggestion..
But I think the rgeos:Over os the best option for me.
Thanks for your suggestion
Marta
No dia sexta-feira, 24 de fevereiro de 2017, Bacou, Melanie <mel at mbacou.com>
escreveu:
> Marta,
> Option 1) using CreateSegments() seems to do what you want. Why don't you
> simply use rgeos::over() or rgeos::gTouches() between your old and new
> SLDFs to match the index positions of your old attributes to your new
> segments?
>
> --Mel.
>
>
> On 2/23/2017 2:27 PM, marta azores wrote:
>
>> Hi all,
>>
>> I am working with a large datasets of boat positions, and based on this
>> points I created a SpatialLinesDataFrame. Now, I would like to
>> split/divide SpatialLinesDataframe
>> into n segments of 10km and keep the attributes. So far, I have tried
>> multiple things:
>>
>> 1. The function from this website: http://rstudio-pubs-static.s3.
>> amazonaws.com/10685_1f7266d60db7432486517a111c76ac8b.html. The problem
>> with
>> it is that the function cuts the lines in segments of 10km but it is not
>> possible to get the attributes.
>>
>> 2. I have also tried the function from this website:
>> http://stackoverflow.com/questions/38700246/how-do-i-split-
>> divide-polyline-
>> shapefiles-into-equally-length-smaller-segments. The problem is that do
>> not
>> cut the segments in 10km, and it seems to cut the segments with random
>> lengths.
>>
>> 3. On the follwoing website: http://r-sig-geo.2731867.n2.
>> nabble.com/split-divide-SpatialLines-sp-into-n-segments-td7583234.html#
>> a7583629 propose to divide lines by segments but do not specify how it is
>> possible to do in based on the length of the segment.
>>
>> Is there any function to do this in R? Or does somebody know the solution
>> for that?
>>
>> My data looks like this:
>>
>> #Script:
>>
>> path_data <- "C:/R/"
>>
>> mergedDF_1_DF_short<- shapefile(path_data,"mergedDF_1_DF_short")
>>
>>
>> https://drive.google.com/drive/folders/0B7IbvWhE5JNPT0oxUklp
>> d3ZnRzA?usp=sharing
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list