Opened 10 years ago

Closed 6 years ago

#2231 closed enhancement (fixed)

v.split not working in expecting way

Reported by: vasile Owned by: grass-dev@…
Priority: major Milestone: 7.4.2
Component: Vector Version: svn-releasebranch70
Keywords: v.split Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Attachments (1)

v_split_fixedlength.diff (1.8 KB ) - added by mlennert 9 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by neteler, 9 years ago

Priority: normalmajor
Version: unspecifiedsvn-releasebranch70

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

by mlennert, 9 years ago

Attachment: v_split_fixedlength.diff added

in reply to:  1 comment:2 by mlennert, 9 years ago

Replying to 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

comment:3 by mlennert, 9 years ago

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

comment:4 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:5 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:6 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:7 by martinl, 6 years ago

Can we close the ticket?

comment:8 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:9 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:10 by mmetz, 6 years ago

Resolution: fixed
Status: newclosed

No complaints in the last 3 years, closing as fixed.

Note: See TracTickets for help on using tickets.