Opened 6 years ago

Closed 17 months 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 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by neteler

Priority: normalmajor
Version: unspecifiedsvn-releasebranch70

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

Changed 4 years ago by mlennert

Attachment: v_split_fixedlength.diff added

comment:2 in reply to:  1 Changed 4 years ago by mlennert

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 Changed 4 years ago by mlennert

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

comment:4 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:5 Changed 3 years ago by martinl

Milestone: 7.0.57.3.0

comment:6 Changed 3 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:7 Changed 22 months ago by martinl

Can we close the ticket?

comment:8 Changed 22 months ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:9 Changed 17 months ago by neteler

Milestone: 7.4.17.4.2

comment:10 Changed 17 months ago by mmetz

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.