2

I'm trying to apply a list of .OSC changesets over an .OSM file.

The problem I have is that the .OSC files contain negative ids for nodes and ways. I understand that the negative ids are merely placeholders and that they are only unique per OSC file/entity type.

The fact that I want to merge such chagesets creates some (expected) issues:

> osmconvert initial.osm changes1.osc changes1.osc > updated12.osm
osmconvert Warning: wrong order at node -1 in file changes1.osc
osmconvert Warning: next object is node -2
  • osmconvert and osmosis complain about ids not being sorted in ascending order (in OSCs the ids are -1, -2 and so on)
  • any item from one changeset will overwrite elements from the previous changesets that happen to have the same id

I looked at the options that osmconvert and osmosis offer for dealing with negative ids, but found nothing - it appears that they assume all files would contain real ids.

I could write a preprocessing tool that assigns positive ids, but was wondering if there's a way to deal with this situation using the existing tool set.

2
  • 1
    Negative ids are usualy used to indicate newly created objects. The OSM API upload process would turn them into positive ids representing new objects. Where do you have those negative values from? – mmd May 5 '20 at 10:05
  • @mmd Indeed these are related to new objects. I created some new ways (and nodes) using the iD Editor, but saved them locally as .OSCs, as they were just some samples (not real nodes/ways). – Cristian Lupascu May 5 '20 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.