Skip to content
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

Move way name parsing from EncodingManager to OSMReader #2537

Merged
merged 5 commits into from
Mar 16, 2022
Merged

Conversation

easbar
Copy link
Member

@easbar easbar commented Mar 12, 2022

I moved the code that parses the name/ref OSM tag of the OSM ways from EncodingManager#applyWayTags to OSMReader. I also added a new setting to disable instructions on the server side called routing.instructions, which is now separated from datareader.instructions. The latter now only controls whether the way names shall be parsed or not. It is probably debatable whether we even need datareader.instructions and it should probably be better renamed to datareader.parse_names or even osmreader.parse_names. However renaming datareader to osmreader is for another issue.


req.putHint("instructions", false);
instance.route(req);
assertEquals(old, instance.getEncodingManager().isEnableInstructions(), "route method should not change instance field");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not :) But testing this here does not seem necessary and now the flag is gone anyway...

Comment on lines -627 to -628
if (Double.isInfinite(edge.getDistance()))
throw new IllegalStateException("Infinite distance should not happen due to #435. way ID=" + way.getId());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this check else where

Comment on lines +53 to +55
private final EncodedValue.InitializerConfig turnCostConfig;
private final EncodedValue.InitializerConfig relationConfig;
private final EncodedValue.InitializerConfig edgeConfig;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be final so I made them final

@easbar easbar merged commit 5f8d2b6 into master Mar 16, 2022
@easbar easbar deleted the move_pref_lang branch March 16, 2022 08:52
@easbar easbar added this to the 5.0 milestone Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant