[GRASS-dev] [GRASS GIS] #2231: v.split not working in expecting way

#2231: v.split not working in expecting way
-------------------------+--------------------------------------------------
Reporter: vasile | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: unspecified
Keywords: v.split | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
I have try to use v.split to generate segments with a specific length
along a line. It seems that at this moment, v.split is calculating the
overall length of the line and than is dividing the line in segments as
close as possible to the length provided in the "length" parameter. A flag
to force v.split to honour the exact length value will be more than
welcome.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2231&gt;
GRASS GIS <http://grass.osgeo.org>

#2231: v.split not working in expecting way
-------------------------+--------------------------------------------------
Reporter: vasile | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Keywords: v.split | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * priority: normal => major
  * version: unspecified => svn-releasebranch70

Comment:

A flag to enforce the user provided line length would be much appreciated.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2231#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2231: v.split not working in expecting way
--------------------------+---------------------------------
  Reporter: vasile | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Resolution: | Keywords: v.split
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Changes (by mlennert):

* Attachment "v_split_fixedlength.diff" added.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2231&gt;
GRASS GIS <http://grass.osgeo.org>

#2231: v.split not working in expecting way
--------------------------+---------------------------------
  Reporter: vasile | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Resolution: | Keywords: v.split
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by mlennert):

Replying to [comment:1 neteler]:
> A flag to enforce the user provided line length would be much
appreciated.

Try the attached patch.

Without the -f flag:

{{{
v.split in=line_test out=line_test_split length=10 units=kilometers --o &&
v.category in=line_test_split out=temp1 op=del cat=-1 --o && v.category
in=temp1 out=line_test_cats op=add --o && v.to.db -p map=line_test_cats
op=length

cat|length
1|9398.52863332647
2|9398.52863332655
3|9398.52863332647
4|9398.52863332647
5|9398.52863332655
6|9398.52863332647
7|9398.52863332656
8|9398.52863332645
}}}

With the -f flag:

{{{
v.split -f in=line_test out=line_test_split length=10 units=kilometers --o
&& v.category in=line_test_split out=temp1 op=del cat=-1 --o && v.category
in=temp1 out=line_test_cats op=add --o && v.to.db -p map=line_test_cats
op=length

1|9999.99999999995
2|10000.0000000001
3|9999.99999999995
4|10000.0000000001
5|9999.99999999995
6|10000
7|9999.99999999995
8|5188.22906661201
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2231#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2231: v.split not working in expecting way
--------------------------+---------------------------------
  Reporter: vasile | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: major | Milestone: 7.0.0
Component: Vector | Version: svn-releasebranch70
Resolution: | Keywords: v.split
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by mlennert):

I've committed the patch to trunk (r65446) so it is easier to test.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2231#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>