[R-sig-Geo] v.split.length (GRASS) in R
Roger Bivand
Roger.Bivand at nhh.no
Thu Nov 24 15:09:18 CET 2016
On Thu, 24 Nov 2016, Manuel Spínola wrote:
> Thank you very much Roger.
>
> Sorry about that, I took the name from the Processing toolbox in QGIS and I
> assumed (wrongly) that was the name in GRASS.
>
> I want to split a vector line (route) in equal contiguous segments of 500 m.
So for a Line object of 5km, you'd want 10 separate contiguous Line
objects each of 500m in a Lines object? This would be the inverse
operation to rgeos::gLineMerge(). sp::spsample can give n regular points
on lines, but they are not a given distance apart (fixed distance, but n
is given, n total points on the object. The code in spsample methods could
give guidance. There are many edge cases, unfortunately, especially for
typical input objects, which may not be clean. GRASS may be the best way
of doing this, because it has a topological vector model, and will clean
the lines on input.
Roger
>
> Manuel
>
> 2016-11-24 2:09 GMT-06:00 Roger Bivand <Roger.Bivand at nhh.no>:
>
>> Before giving advice, please do ask for clarification. There is no
>> v.split.length in GRASS at all, there is only v.split. Without a fully
>> specified GRASS command, such as:
>>
>> v.split -n input=??, output=??, length=10.0, units="meters"
>>
>> which means add vertices each 10m, but do not split the vector line, we
>> could think that the OP wants to divide a line into contiguous shorter
>> segments. What does the OP actually want to do? Once we know that (which we
>> do not), we can offer advice, including running the command in GRASS -
>> which should be done anyway to ensure that the output of R-only approaches
>> matches the desired output object.
>>
>> Roger
>>
>>
>> On Wed, 23 Nov 2016, Manuel Spínola wrote:
>>
>> Dear list members,
>>>
>>> Is it possible to run v.split.length from GRASS in R? Or is there anyway
>>> to
>>> split a SpatialLinesDataFrame to shorter segments by length in R?
>>>
>>> Best,
>>>
>>> Manuel
>>>
>>> --
>>> *Manuel Spínola, Ph.D.*
>>> Instituto Internacional en Conservación y Manejo de Vida Silvestre
>>> Universidad Nacional
>>> Apartado 1350-3000
>>> Heredia
>>> COSTA RICA
>>> mspinola at una.cr <mspinola at una.ac.cr>
>>> mspinola10 at gmail.com
>>> Teléfono: (506) 8706 - 4662
>>> Personal website: Lobito de río <https://sites.google.com/site
>>> /lobitoderio/>
>>> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>>>
>>> [[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
>>>
>>
>> --
>> Roger Bivand
>> Department of Economics, Norwegian School of Economics,
>> Helleveien 30, N-5045 Bergen, Norway.
>> voice: +47 55 95 93 55; fax +47 55 95 91 00
>> e-mail: Roger.Bivand at nhh.no
>> http://orcid.org/0000-0003-2392-6140
>> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
>> http://depsy.org/person/434412
>
>
>
>
>
--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412
More information about the R-sig-Geo
mailing list