GithubHelp home page GithubHelp logo

Comments (3)

HarelM avatar HarelM commented on August 19, 2024

Hi,
Any updates on this?
I'm was hoping I could help out and try implement this, but it's a bit too complex for my understanding.
I tried to look at this code to see how serialization is done in osmosis:
https://github.com/openstreetmap/osmosis/blob/master/osmosis-pbf/src/main/java/crosby/binary/osmosis/OsmosisSerializer.java
and "compare" it to the following code:
https://github.com/OsmSharp/core/blob/develop/src/OsmSharp/IO/PBF/Encoder.cs
If my understanding is correct (which it's probably not) Decode takes a protobuf and changes it so that dense nodes are converted to nodes and later everything is converted to OsmGeo (not inside this method)
However, Encode doesn't convert the buffer from non dense to dense but rather fills the buffer, so this is a bit confusing - most of the code is symmetrical when it comes to conversion except these two functions.
If you have pointers that can guide me to the right approach I'm sure I can help a little to progress this.
I would like to replace OSM-C-Tools and use this code to manage my PBF file updates...

from core.

HarelM avatar HarelM commented on August 19, 2024

I have looked through the code again, and I now think I fully understand it.
The only thing that I'm not sure about it the following comment - is it for performance sake?

//if (group.nodes != null) { group.nodes.Clear(); }

And it needs the following "if" as well...?
if(group.nodes.Count > nodeCount)

In any case, adding EncodeDenseNode shouldn't be difficult now that I think I understand the code.
but removing this "if" and uncommenting the above comment would make the code much more simple, IMO.
@xivk let me know what you think and if you think this is the right course of action.
Also, assuming I can send a pull request, could you create a pre-release NuGet package I can use?

from core.

xivk avatar xivk commented on August 19, 2024

I think because they get filled up and then later the ones left over are removed and yes probably for performance reasons. Not sure though, it's been a long time this code...

If you send a pull-request implementing this then I'll make sure to create a package. 👍 Also make sure to test the result with osmosis/JOSM or whatever other tools you are using. This gets pretty shaky and mistakes are easy to make.

Thanks in advance for doing this!

from core.

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.