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

remove mapbox valhalla #114

Merged
merged 3 commits into from
Aug 3, 2023
Merged

remove mapbox valhalla #114

merged 3 commits into from
Aug 3, 2023

Conversation

nilsnolde
Copy link
Member

@nilsnolde nilsnolde commented Aug 2, 2023

fixes #95

def __init__(
self,
base_url: str,
api_key: Optional[str] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I had kept this line in OTP to maintain compatibility with the compare_providers notebook. We can either keep it or delete it in OTP and update the notebook code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't realize that while reviewing, thanks for the headsup. OTP is not in the compare_providers notebook right? Even if, yeah, we should update the notebook in that case to make it optional. We shouldn't have unused function arguments just for the sake of running examples. Maybe you can update it in the current PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's done.

@@ -31,10 +31,11 @@
class Valhalla:
"""Performs requests to a Valhalla instance."""

_DEFAULT_BASE_URL = "https://valhalla1.openstreetmap.de"

def __init__(
self,
base_url: str,
Copy link
Member

Choose a reason for hiding this comment

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

Missing default for base_url

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, good catch!

@nilsnolde nilsnolde merged commit 72be9ea into master Aug 3, 2023
2 checks passed
@nilsnolde nilsnolde deleted the nn-remove-mapboxvalhalla branch August 3, 2023 08:55
@@ -10,9 +10,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added
- Valhalla `/expansion` examples in the Jupyter Notebook
- OpenTripPlanner v2 support for routing & isochrones
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it wouldn't be better to specify the supported version for each router. Not in the class name, but in a parameter.

"openrouteservice": ORS,
"opentripplanner": OpenTripPlannerV2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need several aliases? I find it more bearable over time to provide the right key from the start.

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 don't need it, but typing "otp" instead of "opentripplanner_v2" is nicer IMO. The particular line you're indicating is indeed a bit more useless

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I agree with you about the abbreviations. I was thinking more of the version with underscore or hyphen. But no biggie, it was just a detail.

def __init__(
self,
base_url: str,
api_key: Optional[str] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's done.

@@ -513,6 +505,7 @@ def matrix(
avoid_locations: Optional[List[List[float]]] = None,
avoid_polygons: Optional[List[List[List[float]]]] = None,
units: Optional[str] = None,
date_time: Optional[dict] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahah yes I had come across it too, it was in my TODO thank you. As a 2nd step, I'd like to have 2 input parameters for all routers: departure_datetime and arrival_datetime instead, both of which are object datetime aware.

Copy link
Member Author

Choose a reason for hiding this comment

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

It wasn't supported in Valhalla until ~ 2-3 months ago: valhalla/valhalla#4071.

I agree it'd be nicer to have a more generic way and have Valhalla convert that to its own request format. Until OTP there wasn't any OSS router supporting that, I guess that's why we didn't really think about it.

@khamaileon
Copy link
Collaborator

I've been too slow 😅

@khamaileon
Copy link
Collaborator

But my comments were non-blocking. It was more of a discussion 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove mapbox valhalla provider
3 participants