Sunday, January 8, 2012

License Change Mapping

So far I have avoided saying anything about the OpenStreetMap license change on this blog. It is a very sensitive subject for a lot of people for a million different reasons. This is not a post about how right/wrong the license change is. I personally have agreed to the new terms but then again I don't really care what license my data gets redistributed under. While I prefer (in most situations) a share-alike clause, if we were switching to public domain instead of ODbL, I would probably still agree. Whatever.

But the license change is happening and we must prepare the map for it, ahead of the April 1 cutover date set by the license working group. Today I decided to take a look at what it would take to get I-70 in Kansas cleaned up, license-wise, and thought I'd share my findings. Note that this particular process may or may not apply to other areas. The interstate system is kind of special in that it was imported from a public domain source and has very long stretches that are identical except for tags that don't really matter. This means that there isn't really very much unique or unrecoverable information present. If there is a small section of road (say a bridge) that is dirty, it can just be removed and replaced from clean data that surrounds it plus imagery to verify that it is indeed a bridge. However whenever possible it is preferred to maintain the history of objects in OSM so I don't want to just nuke and replace large sections of I-70. Plus, deleting and recreating ways gets more complicated because of the route relations that they may be a part of.

A majority of I-70 in Kansas is already clean but there is still a noticeable fraction of dirty objects. The goal is to end up with all objects being "clean" to re-license under ODbL. First task: find dirty objects. For this I use the "License Change" view in the OSM inspector tool created by Geofabrik: http://tools.geofabrik.de/osmi/?view=wtfe

Here is a section of I-70 I will be working on.

You can mouse over the things on the left to find out exactly what the colors and symbols mean. Basically red and orange are bad. In this screen shot I have already clicked on the right-most red dot. This brought up the information in the upper right panel which indicates that there are two items of interest near where I clicked. Node 388499694 and way 33918862 were both created by declining user moonwashed.

Now I click on the clock icon of the way. This brings up Ian Dees' "Deep Diff" service which displays a nice visual history of the way.


From this I can see that the declining user created the way and made one edit to it. The subsequent 11 edits have all been by users who have accepted the new terms. The only original tags that have survived unchanged from the declining user are highway=motorway and oneway=yes. In this case, I consider these both trivial tags that should not prevent this way from being re-licensed. I have yet to encountered this along I-70 but there may be non-trivial tags that were added by a declining user. In this case, such tags would have to be removed to make the way "clean."

Now, what about the nodes? I have the "remote control" feature enabled in JOSM which means that I can go back to the OSM inspector and click on the icon with the little "J" on it next to the way. This will cause JOSM to automatically download a bounding box around that way and select the way after it is downloaded. (This doesn't seem to work from Opera though see comment below) I also have the License Change Plugin installed which I used to do a license check on the selected way. Here is the resulting JOSM window:


I have also selected all of the dirty nodes in the license problem list. Now if I click the "Select" button, it will select all the dirty nodes. Next I inspect them to make sure none of them are nodes that connect to other ways. This could cause problems in the next step. And in fact, the one at the left end of the way is a junction node with a bridge. So I will unselect it using a CTRL+click and deal with it later. Now that only dirty nodes are selected, I delete them all. This will leave me with a way that is of course horribly wrong in terms of geometry. But now I can turn on the Bing imagery and go back and re-improve the way from Bing using the ImproveWayAccuracy plugin:


And of course the screen shot software intentionally left out the mouse cursor... but it is where the green line makes a bend which is where I am about to add a node. Now I check along the rest of the way to make sure everything else is ok.

Now back to that dirty node I left out. The difficulty in this case is that the node is part of a 2-node way (a short bridge) so if I delete the dirty node, the bridge will get deleted as well. Since I don't want that, I will create a new node in the middle of the bridge, then delete the dirty node. This will create a gap between the two ways which needs to be fixed by re-extending one of the ways to connect with the other. Then all that I need to do is fix the position of the junction node according to imagery. This leaves all the nodes clean.

Note that for untagged nodes, simply moving might be enough to clean them, depending on what rules end up being applied during the license chage. But simply moving a node by 1 meter to make sure it is ODbL clean doesn't give me warm fuzzy feelings. I'd rather just scrap them and start from scratch to avoid uncertainty.

But the way itself is still considered dirty. For the following 3 reasons, I believe that the way can still be re-licensed:
  • The way was originally created from a public domain import. All the declining user did was split it, probably to make the bridge.
  • All tags are either trivial (as mentioned above) or have been added/changed by agreeing users
  • The geometry is now completely clean as I removed all dirty nodes and recreated them as I would when mapping something from scratch: aerial imagery and GPS traces
So to indicate this, I will add the following two tags to the way:
  • odbl=clean
  • odbl:note=decliner touched tags that have been overwritten or are trivial. All decliner nodes have been removed

The first tag is documented on the Remapping/License Change View on OSM Inspector wiki page. I'm not sure if there has been an official nod to obeying this tag in the final license change process but I'm not the only one using it so hopefully it will. And if not, it gives me a simple tag that I can query on to retrieve all ways that need further work. The second tag is just something I decided to use to briefly explain why I think this way is clean.

And that's it. After the OSM inspector updates its data, this way should show up as a green line instead of a red one.

This might seem like a lot of work but once I worked out a process I was able to move along pretty quickly. Plus, there were only a few ways where I had to deal with more than a few nodes. I got all of I-70 in eastern Kansas done in a little over an hour and I should be able to finish the rest within another hour or two. And along the way I of course get sucked into improving other things too so it isn't entirely busywork.

If only we lived in a perfect world where everyone got along and no licenses were required. But then what would the lawyers do?

7 comments:

  1. to make osm inspector work in opera : tools -> preferences -> advanced -> security. click on "trusted websites" -> secure internal hosts. add "localhost" here (you migh need to add 127.0.0.1 as well, but localhost was enough for me)

    ReplyDelete
  2. Oh hey what do you know. That works brilliantly. Thanks!

    ReplyDelete
  3. Thanks, this is great!

    How do you select nodes of a way in JOSM?

    ReplyDelete
    Replies
    1. To select all nodes of a specific way, select the way then do a search (ctrl-F) and enter "child selected" as the search term. You can also do "parent selected" if you have some nodes selected and want to select the ways that they are a part of.

      Delete
    2. Ok. And while on the subject: Would you happen to know how to select _only_ all visible ways in JOSM? That is, I've run into a situation a number of times where I'd like to select all ways of a filtering results -- but I get the nodes selected, too, if I just drag with mouse. Ctrl+A chooses (at least sometimes) even objects hidden from filtered view.
      Any idea?

      Delete
    3. Yeah... the search function selecting filtered elements seems like a problem to me. I see some discussion about it in a JOSM trac ticket... At a minimum there needs to be a keyword to exclude filtered objects from a search result.

      As it stands now, it looks like turning on a filter while you have objects selected will remove the filtered objects from the selection. So turn off the filter, do a "type:way inview" (or allinview to exclude ways that are not entirely within your view) and then reactivate the filter. You should see the number of selected ways drop.

      Delete