Closed district10 closed 2 years ago
The internal encoding of OSM objects in libosmium is somewhat magic. You have to understand how the Buffer
s and Item
s in those buffers work, do the right padding etc. It is not so easy to change that.
This is certainly not something I'd consider adding to libosmium, so I suggest you solve that outside libosmium.
@joto Yeah... I'm planning caching on the python end, that's much easier.
(Hope one day I can put more time learning the details.
I thought it was easy as adding
z
toosmium::geom::Coordinates
andalt
toosmium::geom::Location
. But it turns out more complicated than that.Besides adding z/alt to data structures, we need to assign them from your data, e.g. XML, so I tried:
https://github.com/district10/libosmium/commit/ff7dfe93be23ce15d39fff2b448bab384a35db09#diff-98bdd24cf8904fade7acabaa131c3b9c36ed1bd9e436a9c79b20fb66ff43fc6f
This won't work, because when
init_object
,tags()
are not set yet.Then I tried to add caching logic to
Node
class directly:https://github.com/district10/libosmium/commit/ff7dfe93be23ce15d39fff2b448bab384a35db09#diff-03c1cf399112604c393c6e324788398b97b72cf53deba9ca66b421f2446e4324
Code compiles and but unit tests wot't pass. Code just hangs at
node.tags()
function.It seems cause by osimum memory alignment. Any suggestions?
Maybe I should just calculate on site without caching.