Generate OSM_id locally

I want to edit my map locally and don’t want to upload it to the OSM database, but nodes don’t have OSM_id (maybe negative id).
How can I generate OSM_id for them locally?

How can I generate OSM_id for them locally

you cannot, only the server can assign valid ids.

1 Like

Hi @Cactustory - @dieterdreist is correct. JOSM (if that’s what you are using) internally assigns negative identifiers. This is totally okay though, there is no need for you to “know” a valid OSM id before you upload your changes.

The actual issue you would run into is that someone else may have edited the same features while you were offline, leading to a conflict that can be hard to resolve, depending on the complexity of your edits.

1 Like

If you know for sure you never want to upload your edits to the OSM database and never want to merge them with future updates from OSM, you could of course make up your own positive unique IDs with a suitable script. That could be useful if you want to use the locally edited data in a tool that trips over negative IDs. You’d have to deal with the other aspects of JOSM’s dialect of the .osm format as well, though, such as XML elements with action=delete.

1 Like