OSM question

Hello. I’m looking for a good way to add additional data (annotations) to OSM. I’ve a custom routing application (programmed in java) which requires additional, application specific data. For example, each road segment needs to be annotated with a “priority” field. Since this is an application specific field, this is not something you want to add directly to the existing OSM data. Consequently, I was wondering whether there’s a good way to add a new layer (‘ApplicationLayer’) on top of the OSM data. The purpose of this layer is to add additional application-specific data. Ideally, I’m looking for a way to create the layer such that it remains compatible with the underlying OSM data. So if somebody updates/changes OSM, than this should be reflected in the ApplicationLayer. It would be very annoying if there’s no way to keep the ApplicationLayer synchronized with the OSM data, or to detect conflicts.


To say this with other words: if I understand correctly you want to have a list of private tags for several ways and, whenever a way is changed in OSM, your private list will keep in sync.
I have been also longing for such a feature but I’m afraid it doesn’t exist.

The hard way would to maintain your own database containing your “priority” fields against an OSM way id and writing down some characteristics about each way (list of nodes, length, and so on).

Over time, a way can be split (one part will keep the original id number and the other parts will get new numbers), two or more ways could be merged, ways can be extended, shrunk, or can get additional nodes in the middle (with or without changing their overall geometry). Even if a way appears unchanged in OSM, one or several of its nodes may have been moved. Even worse, any mapper can erase a way at any time and draw a new one instead, making it virtually impossible to detect under the ApplicationLayer model. :frowning:

If your routing application covers a small territory, writing some scripts to periodically monitor significant changes and manually review them may be the easiest solution. It might be really painful otherwise.

Hope this helps.

Consider using something like https://pgrouting.org/docs/tools/osm2pgrouting.html to populate your routing database. The github is at https://github.com/pgRouting/osm2pgrouting where you can see some sample XML files for setting priorities on ways based on the tags found on the ways.