[josm-dev] Integrating notes into JOSM core

Toby Murray toby.murray at gmail.com
Sun Aug 24 19:14:04 UTC 2014

Over the last year I've been dabbling with the josm-notes plugin. The
thought was always that eventually it would get integrated into core but it
has been slow going. In the last couple of weeks I got rather fed up with
the way the plugin was handling downloads and the GUI side of things. It
was originally designed around the OpenStreetBug API and some of the inner
workings just aren't very clean for the way things work with notes.

My eventual vision is that instead of the download-as-you-pan nonsense,
Notes will be listed as a checkbox alongside "OpenStreetMap Data" and "Raw
GPS Data" checkboxes in the download dialog. But this checkbox can not be
added by a plugin so this weekend I decided to take a look at how things
might fit into core.

At this point I would absolutely love it if JOSM was using git because
there could be easier collaboration and review of this code as I work on
advancing it towards an acceptable state. Also, it would be easier to keep
up with changes in trunk as this might be a longer process. Alas, this is
not the case. But in order to make it easy for people to see what I have so
far, I have forked the JOSM git mirror on GitHub and am pushing changes
there. When things are done we can work on porting the changes to SVN.

Depending on time constraints, I am thinking this might actually end up
being a multi-step process. The back-end API interactions could be
integrated into core first and the notes plugin could switch to using core
for those functions before any GUI changes are introduced in core. Honestly
I'm not sure much of the GUI code from the plugin will be reusable which is
why I am concentrating on the API side of things for now.

Notes are an interesting beast. They are part of the main API but changes
to notes are not uploaded as part of a changeset, nor do they have versions
or tags. So they are not an "OsmPrimitive" as far as JOSM is concerned. My
changes so far have been modeled somewhat on the GPX code which has a
similar status within the OSM world.

So far all I have done is to create POJOs representing notes and their
comments and a NoteReader class to parse them from XML. As I am making
changes to JOSM, I am also altering the plugin to use these new features
instead of its own versions of them. This allows me to test the core API
functionality without having to mess with anything in the JOSM core GUI
yet. Any comments or suggestions are of course welcome. You can view the
changes I have done here:

Next I need to look at how to integrate the API interactions into core. I'm
still trying to understand the interactions between OsmApi,
BoundingBoxDownloadeer, OsmServerReader and the Download*Task classes so
I'm not quite sure in what direction I'm headed on that yet. Suggestions
are of course welcome :)

Some relevant URLs:
My notes-api branch in the JOSM repo:

Notes plugin branch that is tracking my changes in JOSM core:


More information about the josm-dev mailing list