-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Separate core module from osm reading #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
07a41cb to
bebe828
Compare
|
Analysing this very useful (and big) modules decoupling.. |
|
Currently yes, as I'm not sure how the dependencies should look like. E.g. should it be |
|
Core should be best independent (if possible) from graph creation business. |
|
BTW: maybe we should use |
|
Hmm nice thought. For clear API the 2nd solution (with data suffix) appears more appropriate i.e. |
Indeed, this would be too ugly. So let us break and we already report the user what to do to fix this: https://github.com/graphhopper/graphhopper/pull/740/files#diff-59d362881b641ff1b933a3785503c20eR774 |
|
At least for the elevation module this could work as follows. E.g. in the current Import file ( public class Import
{
public static void main( String[] strs ) throws Exception
{
CmdArgs args = CmdArgs.read(strs);
GraphHopper hopper = new GraphHopperOSM().init(args);
// one line glue code of OSM and elevation module
hopper.setElevationProvider(ElevationHelper.createElevationProvider(args));
hopper.importOrLoad();
hopper.close();
}
}The same would be necessary in the web module. The downside is that we would need this glue code and also explicitely define the elevation module as separate dependency besides Another possibility to avoid the glue code would be very simple reflection code asking for elevation and if not existing falls back to |
|
Merged now. |
Fixes #450 e.g. removing xml dependencies from model classes (node, way, relation). Moves several OSM related classes and tests into the module and makes it possible to avoid this overhead for Android. The breaking change now is that all code requiring OSM import has to change
coretoreader-osmGraphHoppertoGraphHopperOSMBut this makes integrating like #616 very easy e.g. in a submodule without effecting current dependencies which I really like.
The OSM parsing stuff is still included in the FlagEncoders like converting units to SI units or workarounds for certain OSM issues as well as parsing strings into objects. Such a change would be more intense and requiring us to convert the OSM data into some kind of intermediate object format. Another option would be to define a subset of OSM which is stricter and less complex but still valid OSM and use this as the intermediate format. But this is for another issue...