osm icon indicating copy to clipboard operation
osm copied to clipboard

Question: Why output and serializer chanel

Open oflebbe opened this issue 2 years ago • 3 comments

Is there a specific reason to have in osmpbf part of the project n output chanels and feeding them in order to a serializer chanel ? (decode.go function line number

The upside is it is making testing much easier since we get predictable outputs, however in my case I do not see not a reason that my application needs a special ordering of the elements : Do I miss something important why one should process objects in order ? (In other words: why doesn't the deocoder directly push to serializer)

oflebbe avatar Aug 20 '22 08:08 oflebbe

My use-cases is parsing osm history files where the elements are ordered by type, id, version. I need them to be ordered like this to process all the versions of a feature together.

paulmach avatar Aug 21 '22 00:08 paulmach

Ah wasn't aware of this property of the input stream. RIght now I am misusing the filters to early fan out the elements I am interested in, with a quite an speed increase with respect to the "regular" way. Would you accepta pr to disable serialization optionally, In case I can find time for working on it?

oflebbe avatar Aug 21 '22 05:08 oflebbe

The filters are faster because they are parallelized. It's not really the serialization that is causing the problem.

I don't think your use-case is a misuse of filters. If you want to filter first, then push those things on a channel for later use, that's okay. Maybe I should add an example for that.

paulmach avatar Aug 22 '22 19:08 paulmach