Hi,
no, there is another problem. Merge tool has been updated and snap
tool not. Snap tool in v.edit is very simple:
1) select lines
2) snap *first two* lines from the list [regardless of threshold -- it is a bug]
see [1,2]
Behaviour of merge tool is a little bit different. It tries to merge
*all* selected lines.
So there is *important* question for future development of v.edit,
should be snap tool updated (snap all selected lines) or merge tool
modified according to current simplified snap tool (i.e. merge only
first two selected lines and leave rest of selected lines untouched)?
Martin
[1] http://gama.fsv.cvut.cz/~landa/temp/grass/v-edit/linie_cat.png
[2] http://gama.fsv.cvut.cz/~landa/temp/grass/v-edit/linie_snap_cat.png
2007/3/29, Jarek Jasiewicz <jarekj@amu.edu.pl>:
>
> I disabled threshold for merging lines.
>
> Martin
>
>> Jarek
>>
>
Martin!
Look on line 259 in merge.c: (it is copy form newest cvs version)
....
/* find the minimal distance between first or last point of both lines */
mindistidx = 0;
for (i = 0; i < 4; i++)
if (distances[i] < distances[mindistidx])
mindistidx = i;
G_debug (3, "merge line ? mindist: %g, thresh: %g",
distances[mindistidx], thresh);
look here: >>>>>> if (distances[mindistidx] > thresh) {
return 0;
}
.....
maybe here is the problem
that part of code differs slighty from the part of code in snap.c where
is no test if distance is lesser than treshold
Jarek
--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *
Martin Landa wrote:
Hi,
no, there is another problem. Merge tool has been updated and snap
tool not. Snap tool in v.edit is very simple:
1) select lines
2) snap *first two* lines from the list [regardless of threshold -- it
is a bug]
see [1,2]
Behaviour of merge tool is a little bit different. It tries to merge
*all* selected lines.
So there is *important* question for future development of v.edit,
should be snap tool updated (snap all selected lines) or merge tool
modified according to current simplified snap tool (i.e. merge only
first two selected lines and leave rest of selected lines untouched)?
I'd vote for selective merge and snap tools. One could repeat v.edit in
a loop in order to merge or snap more than two lines, is that correct?
Maciek
Hi,
2007/3/30, Maciej Sieczka <tutey@o2.pl>:
Martin Landa wrote:
> Hi,
>
> no, there is another problem. Merge tool has been updated and snap
> tool not. Snap tool in v.edit is very simple:
>
> 1) select lines
> 2) snap *first two* lines from the list [regardless of threshold -- it
> is a bug]
>
> see [1,2]
>
> Behaviour of merge tool is a little bit different. It tries to merge
> *all* selected lines.
>
> So there is *important* question for future development of v.edit,
> should be snap tool updated (snap all selected lines) or merge tool
> modified according to current simplified snap tool (i.e. merge only
> first two selected lines and leave rest of selected lines untouched)?
I'd vote for selective merge and snap tools. One could repeat v.edit in
a loop in order to merge or snap more than two lines, is that correct?
Yes it would be possible, but a bit time-consuming. Let's say we have
a vector map containing 1e5 lines. We select (by bbox && where) 1e4
lines for merging... Maybe not good example, v.edit is designed as
*low-level* editing tool (do not edit more then *few* features at the
time).
Currently, merge and snap tools have different nature. Let's say we
select three lines from vector map. Snap tool snaps first two line
from selected three lines (maybe should snap lines only when exactly
two lines are selected??) but merge tool tries to merge all three
selected lines. When you select two lines behaviour or merging and
snapping is the same.
1) Snap approach allows user to edit only *two* lines at time.
2) Merge approach allows edit *two and more* lines at time.
I'd vote for 2) but not fully, maybe it does not follow original
v.edit proposal.
Martin
--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *
Martin Landa napisał(a):
Hi,
no, there is another problem. Merge tool has been updated and snap
tool not. Snap tool in v.edit is very simple:
1) select lines
2) snap *first two* lines from the list [regardless of threshold -- it is a bug]
see [1,2]
Behaviour of merge tool is a little bit different. It tries to merge
*all* selected lines.
So there is *important* question for future development of v.edit,
should be snap tool updated (snap all selected lines) or merge tool
modified according to current simplified snap tool (i.e. merge only
first two selected lines and leave rest of selected lines untouched)?
Martin
[1] http://gama.fsv.cvut.cz/~landa/temp/grass/v-edit/linie_cat.png
[2] http://gama.fsv.cvut.cz/~landa/temp/grass/v-edit/linie_snap_cat.png
2007/3/29, Jarek Jasiewicz <jarekj@amu.edu.pl>:
>
> I disabled threshold for merging lines.
>
> Martin
>
>> Jarek
>>
>
Martin!
Look on line 259 in merge.c: (it is copy form newest cvs version)
....
/* find the minimal distance between first or last point of both lines */
mindistidx = 0;
for (i = 0; i < 4; i++)
if (distances[i] < distances[mindistidx])
mindistidx = i;
G_debug (3, "merge line ? mindist: %g, thresh: %g",
distances[mindistidx], thresh);
look here: >>>>>> if (distances[mindistidx] > thresh) {
return 0;
}
.....
maybe here is the problem
that part of code differs slighty from the part of code in snap.c where
is no test if distance is lesser than treshold
Jarek
I rather suggest simplified form (eg.only two lines at once) because there be the problem with which line merge with which first and the second. In simple situation like this ---- ------ ------- it seems very simple but with that:
-------- -----------
-----------
how to solve the proper order (cat, ids??) so results may be unpredictable
about threshold
I removed lines
if (distances[mindistidx] > thresh) {
return 0;
}
and compiled again it isn't the problem.
Jarek
Hi,
2007/3/29, Jarek Jasiewicz <jarekj@amu.edu.pl>:
Martin Landa napisa³(a):
> Hi,
>
> no, there is another problem. Merge tool has been updated and snap
> tool not. Snap tool in v.edit is very simple:
>
> 1) select lines
> 2) snap *first two* lines from the list [regardless of threshold -- it
> is a bug]
>
> see [1,2]
>
> Behaviour of merge tool is a little bit different. It tries to merge
> *all* selected lines.
>
> So there is *important* question for future development of v.edit,
> should be snap tool updated (snap all selected lines) or merge tool
> modified according to current simplified snap tool (i.e. merge only
> first two selected lines and leave rest of selected lines untouched)?
I rather suggest simplified form (eg.only two lines at once) because
there be the problem with which line merge with which first and the
second. In simple situation like this ---- ------ ------- it seems
very simple but with that:
--------
-----------
-----------
how to solve the proper order (cat, ids??) so results may be unpredictable
If I understand well you mean (??), e.g.
+
\
1
\
+-----2------
/
3
/
+
If you select all three lines, they will be not merged, but if you
select only two lines (e.g. 1,2), they can be merged (it will cause
broken topology, this can be useful for example during networking (two
different roads, to eliminate joint node (cross-road))
v.edit map tool=merge id=1,2
+
\
1,2
\
+-----1,2----+
/
3
/
+
Martin