[copied to potlatch-dev, followups probably better there]

Steve Bennett wrote:
> One thing we could add (in addition to trying to fix bugs in the
> various places 1-length ways could be created) would be a
> general filter at save time that prevents any 1-length ways
> being sent back to the database. What do you think?

There's three places you can theoretically trap it:

1. In the UI (i.e. don't let the user create them in the first place)
2. In the entity model and actions (i.e. don't let them get into P2's
internal data)
3. In the upload code (i.e. don't let them be transmitted to the server)

Historically P2 has tried to tackle it at 1 - don't let the user create
them. Clearly something's falling through the gaps and I'm in
communication with Thomas B to see if we can find out where there is.

2 is also a reasonable place to address it. I recently did this with empty
relations which, like 1-length ways, aren't actually forbidden by the data
model but are discouraged by the community:
https://github.com/systemed/potlatch2/commit/f762b5c7b33c0ff4ecbd37bc1db37634cedb3d8a

You'll see that, when you remove a member from a relation, this code now
deletes the relation instead if it would result in it having 0 members. We
may be able to do something similar here, though I suspect it would be
less easy.

I'm less keen on 3. Conceptually, uploading should just be a matter of
"send the changes in P2's internal dataset to the server". Adding a check
here is a bit of a sticking plaster - it works but it doesn't fix the
underlying problem. I'd rather see if, with the help of some steps to
reproduce, we can fix 1 and/or 2 first before resorting to 3.

cheers
Richard




_______________________________________________
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk

Reply via email to