Code Monkey home page Code Monkey logo

Comments (4)

joto avatar joto commented on August 29, 2024

If there is a version 2, there must have been a version 1. So "modify" is arguably right. If the two OSM files came from the OSM database, this constellation could never happen, it only happens when there are extracts or so. This is one of those cases where the file format isn't really thought through. Anyway, any program reading this change file will do the same operation anyway, so it shouldn't make a difference.

This is definitely something where we can not "fix" in Osmium, because the reason this comes out this way is deeply embedded into the way Osmium handles changes. Unlike Osmosis, which has "data streams" and "change streams", Osmium only has "objects", the change format is synthesized when writing out an .osc file simply using "create" when version==1 and "modify" when version > 1.

from osmium-tool.

woodpeck avatar woodpeck commented on August 29, 2024

The diff between two osm files describes "how to get there from here". If file A doesn't have an object, then you do not get to file B by "modifying" that non-existing object! I dont understand why "If the two OSM files came from the OSM database this constellation could never happen" - surely you can have an object not be there in planet file A and be at version 2 in planet file B?

from osmium-tool.

joto avatar joto commented on August 29, 2024

Because there must have been a version 1. The only version that is ever created out of thin air is version 1. All other versions are modifications of that first version. Yes, we can argue about the the exact definition of the change file and of what "create" and "modify" etc. mean, but in the end all a change file is, is a bunch of OSM objects. And everything that doesn't have a smaller version number than what's existing in your planet file or database, will be added to that planet file or database (and a "delete" is a kind of add in this case, because it adds a newer version marked as "deleted") replacing any older versions if they existed. There is no difference between how "create" or "modify" are handled really, and "delete" is also only special in so far as it basically sets the "visible" flag to false.

from osmium-tool.

joto avatar joto commented on August 29, 2024

I have clarified this behaviour in the documentation.

from osmium-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.