Git Product home page Git Product logo

Comments (6)

marook avatar marook commented on September 25, 2024

I agree with you. I think it's a bad idea to lose the relation member orderings over different types. I think we should break backwards compatibility in order to adjust the relations interface.

I've committed an interface proposal in the 'relations' branch. The commit which changes the expected interface just in the unit tests is 5db2f97

Maybe it's possible to keep the former nodes and ways properties as deprecated members of the relationsMembers element. This will create a little memory overhead. But I think I'm willing to spend that for the sake of backward compatibility.

What do you think?

from osm-read.

nrenner avatar nrenner commented on September 25, 2024

I would like to avoid any memory overhead and rather not support both variants at the same time. But I only care about PBF and as relation support for PBF has not been released yet, I would prefer to change that implementation to only support a single members array.

Not sure how many users there are for the new XML relations and if breaking backwards compatibility would be ok. @BinaryBrain ?

from osm-read.

BinaryBrain avatar BinaryBrain commented on September 25, 2024

My implementation should not cause trouble for people who don't handle
relations. If there is no callback, nothing will happen. It's like if you
don't handle way because you only use nodes.
By the way, I don't see why you would need way and not relations.

from osm-read.

nrenner avatar nrenner commented on September 25, 2024

@BinaryBrain I implemented relation support for PBF following your implementation. My question now is, if it would be Ok to change the returned relation members object (and thus break the API) to contain only a single array with a type property instead of separate arrays for each type, because with the latter we loose the overall member ordering (see my first comment above).

from osm-read.

BinaryBrain avatar BinaryBrain commented on September 25, 2024

Well you seem do know OSM better than me and you also seem to be right.
Feel free to modify the format as you want, there's no problem for me.

That said, maybe you should be careful of the retro-compatibility. If that's impossible, maybe you should create a new osmread.parse(...) method

from osm-read.

marook avatar marook commented on September 25, 2024

I've changed the API of the relation callback.

@BinaryBrain In order to use the next version (v0.5 (At the time of writings it's not yet released)) of osm-read you will need to adjust some parts of your relations code which calls osm-read. I've added some description about the required changes in the file ChangeLog. Hope that helps.

from osm-read.

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.