[Talk-ca] [talk-ca] Merging ways
James Ewen
ve6srv at gmail.com
Fri Jul 6 02:08:32 BST 2012
On Thu, Jul 5, 2012 at 11:28 AM, Richard Fairhurst <richard at systemed.net> wrote:
> As David said, there isn't, but I'd be happy to look at adding one.
That's like a promise of a Christmas present... now I'm all excited!
> Assuming that (as ever with Potlatch) we go for a 90% solution rather than
> covering every possible combination... am I right in thinking that you'd
> like something that combines two areas, with a shared sequence of nodes,
> into one?
Yup, that sounds about right...
> In other words:
> A-B-C-D-E-F-G-A
> and
> H-I-J-C-D-E-K-L-H
> become
> A-B-C-J-I-H-L-K-E-F-G-A
> (and D is deleted)
Ooh, muh brayn hertz! That was hard on the old noggin' but, yeah!
That's exactly it.
The issue with the Canvec data is that it is processed in tiles, and
any way that crosses a tile boundary ends up getting chopped up.
Linear ways are pretty easy to fix, just select both sections and join
them. Areas are a little more work, as they end up with a common
border. It usually isn't too hard to combine these sections. You
simply need to cut the node at the start of the slice, and delete the
common segment, and then do the same for the other segment. Then
select each remaining segment and join them.
Automating the process would be very nice as it takes a bit to select
the right node, cut it, reselect it, make sure you are on the right
section of the split way, and then delete the segment, times 2.
Selecting both sections of the split area, and having the program find
and remove the common border, and then join the two would be super
cool!
Here's a perfect example, a little pond that is split across a tile boundary...
http://www.openstreetmap.org/browse/way/105928394
http://www.openstreetmap.org/browse/way/81343872
Nodes:
1219746948 (also part of ways 81343872 and 81343872)
1219746952
1219746955
1219746957
1219746959
1219746971
1219746974
1219746978 (also part of way 81343872)
1219746948 (also part of ways 81343872 and 81343872)
Nodes:
1219746948 (also part of ways 105928394 and 105928394)
1219746978 (also part of way 105928394)
947636778
947636783
947636784
947636785
947636787
947636788
947636789
947636790
947636791
947636792
947636795
1219746948 (also part of ways 105928394 and 105928394)
So we can see that nodes 1219746948 and 1219746978 are the two nodes
that are shared on that common border. Remove the common ways between
those nodes, and merge the remaining sections together.
This is about as simple as it gets. There are other situations where
relations are cut, or multiple segments need to be merged because the
area crosses the boundary multiple times. However, all these
situations get broken down into smaller tasks, where in the end, you
do end up merging two sections together just as above. There may be
more things to do afterwards, but just automating the merge task would
be super!
--
James
VE6SRV
More information about the Talk-ca
mailing list