Comments (3)
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.
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?
core/src/OsmSharp/IO/PBF/Encoder.cs
Line 206 in e951c41
And it needs the following "if" as well...?
core/src/OsmSharp/IO/PBF/Encoder.cs
Line 225 in e951c41
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.
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)
- Running into System.IO.EndOfStreamException HOT 6
- Join on filtering OSM data
- Complete Stream leads to data loss HOT 3
- Message=Method not found: 'ProtoBuf.Meta.RuntimeTypeModel ProtoBuf.Meta.TypeModel.Create() HOT 4
- DefaultFeatureInterpreter is broken
- Error when saving PBF with compression: block raw size expected
- OSM pbf read performance HOT 5
- May be a memory leak in PbfReader ? HOT 1
- How to fetch Latitude and Longitude co-ordinates from osmGeo object while filtering HOT 4
- Read OSM PBF file
- Only finding 390 roads in all of Norway HOT 8
- Get the id by latitude and logitude HOT 2
- Release official OsmSharp NuGet HOT 1
- Getting layers?
- PBF StreamSource to FeatureSource - 'Attribute id already exists!' when creating Feature list HOT 3
- Read OSM PBF file header and bounds? HOT 1
- Osrm can't parse created .osm.pbf files
- Osm file? HOT 1
- If a way or relation has an id attribute, an "Attribute id already exists" exception will throws. HOT 1
- SerializeToXml() throws an exception
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 core.