You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I heavily use the low-level api and have a very custom FlagEncoder implementation (for example I store custom information in the flags, I have no speed information, etc.)
What do you think about introducing a super interface of FlagEncoder that only contains the methods needed to import data. With this minimal interface it would be easier to implement custom encoder with the Low Level API (especially easier to upgrade version because changes in AbstractFlagEncoder don't matter).
For example this interface would include public abstract long acceptWay(ReaderWay way); because if is referenced from the EncodingManager but not methods like public long setBool(long flags, int key, boolean value) because this is only used by AbstractFlagEncoder and its implementations.
I would open a PR if this is generally ok with you. The logic would not change as far as I can oversee this at the moment.
This use case will be covered in #1112, no need to create another abstraction. The FlagEncoder is a bit too ugly and after the mentioned issue we'll have hopefully a better foundation that better separates the storage from reading but also OSM from the core and much more.
That looks great, thanks for the information! As far as I can see the FlagEncoder only needs to expose a very minimal interface.
Would be great if there is an interface in the hierarchy doesn't require me to implement any methods used in (only some) Weighting implementations or in com.graphhopper.routing.Path - namely Speed, Waytype, Way name (or Turn costs).
The FlagEncoder is no longer necessary and if I invest a bit more time will remove it entirely. The only things then should be some parsers that feed into 'their' EncodedValue (that e.g. store average and max speed)
The Weighting then fetches those EncodedValues - see the new FastestCarWeighting. Turn costs is something currently unsolved but will probably get a similar (or better identical) approach of EncodedValues.
This will still take lots of weeks of coding but as I mainly invest into this now (besides some 'minor' other stuff here ;)) I hope to get out a prototype this year.
Activity
karussell commentedon Sep 26, 2017
This use case will be covered in #1112, no need to create another abstraction. The FlagEncoder is a bit too ugly and after the mentioned issue we'll have hopefully a better foundation that better separates the storage from reading but also OSM from the core and much more.
jtheuer commentedon Sep 26, 2017
That looks great, thanks for the information! As far as I can see the FlagEncoder only needs to expose a very minimal interface.
Would be great if there is an interface in the hierarchy doesn't require me to implement any methods used in (only some) Weighting implementations or in com.graphhopper.routing.Path - namely Speed, Waytype, Way name (or Turn costs).
karussell commentedon Sep 26, 2017
The FlagEncoder is no longer necessary and if I invest a bit more time will remove it entirely. The only things then should be some parsers that feed into 'their' EncodedValue (that e.g. store average and max speed)
The Weighting then fetches those EncodedValues - see the new FastestCarWeighting. Turn costs is something currently unsolved but will probably get a similar (or better identical) approach of EncodedValues.
karussell commentedon Sep 26, 2017
This will still take lots of weeks of coding but as I mainly invest into this now (besides some 'minor' other stuff here ;)) I hope to get out a prototype this year.
jtheuer commentedon Sep 26, 2017
Cool, looking forward to it. Do you have a link for FastestCarWeighting ?
https://github.com/graphhopper/graphhopper/search?utf8=✓&q=FastestCarWeighting&type= didn't yield any results.
karussell commentedon Sep 26, 2017
I meant in the branch: https://github.com/graphhopper/graphhopper/blob/encoder_refactoring/core/src/main/java/com/graphhopper/routing/weighting/FastestCarWeighting.java