On Sat, Feb 26, 2011 at 12:47 AM, Andy Allan <gravityst...@gmail.com> wrote:
> Without fully understanding things - do you? Instead of splitting the

Well, I'm sure that it's theoretically possible to write virtually any
code in such a way that I don't need the intermediate state. But it
might be less readable. And it's harder. And probably the Actions need
to be clearer about their postconditions. For example, it should be
possible to know for certain where the new way generated by
SplitWayAction will figure in the node's parentWays. (It's probably
deterministic, but it's not documented.)

Without having access to intermediate state, code is probably also
going to be more fragile, because you can't do sanity checks.

> way and deleting one half[1] are you not instead figuring out which
> nodes to delete from the way?

If you look at my commit, I actually wrote two completely different
versions - because I couldn't figure out for the life of me why the
first one (the one that's not commented out) didn't work.

> Given that you know before you start
> which end of the ways you'll delete from, then it's probably
> possible[2] to do it that way.

That works for the "delete all nodes between the junction and the
centre of the roundabout" approach. It doesn't work for the "delete
the way that is between the junction and the centre of the roundabout"
approach, because I don't know which way that is without looking
through junction.parentWays. (Could be missing something obvious
here.)

Steve

_______________________________________________
Potlatch-dev mailing list
Potlatch-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/potlatch-dev

Reply via email to