Comments (6)
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.
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.
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.
@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.
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.
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)
- lat lon are not in WSG84 format HOT 5
- Relations HOT 2
- number instead of string for id, uid and ref? HOT 3
- Pause/Resume HOT 12
- Parser getting stuck HOT 1
- Cannot read property 'byteLength' of undefined HOT 5
- Example pbf.html is Broken HOT 6
- Too Much Recursion HOT 4
- Get tag "center" from overpass-api response xml HOT 2
- Invalid typed array length in arrayBufferReader Line 12 HOT 1
- Allocation failed - process out of memory HOT 1
- Tags unresolved HOT 3
- Vulnerability in protobuf dependencies HOT 2
- pbfParser in node.js and "TypeError: Invalid non-string/buffer chunk" HOT 9
- Is it possible to do any progress indication HOT 1
- Module not found: Error: Can't resolve '../../node_modules/zlibjs/bin/inflate.min.js' HOT 1
- Would exposing an async iterator API suit this library? HOT 3
- Why not store IDs as BigInt? HOT 4
- primitivegroup.length - Is it always 1? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osm-read.