CUTR-at-USF / OpenTripPlanner-for-Android

An Android app for multi-modal trip planning and navigation using any OpenTripPlanner server.
Other
130 stars 91 forks source link

Add support for OpenWeatherMap API for facilitate weather information #448

Open egofer opened 9 years ago

egofer commented 9 years ago

One of the main advantages of OpenTripPlanner and its Android client is that it allows the user to manage your own mobility, adapting to their own context. In this regard it would be interesting to the user have the weather information that is expected during your trip or transfers. This would allow you to choose the best transportation alternative. Over all in cities where the weather is a key factor in the trips.

OpenWeatherMap provides a free API with open weather data, weather forecasts and maps in HTML, JSON and XML formats that might be used in the Android client (or the OTP server).

barbeau commented 9 years ago

@egofer Definitely an interesting idea. Do you have any ideas how we would present this information to users? In other words, where would this information be placed in the UI?

egofer commented 9 years ago

I believe that the roadmap would be the best place. A panel would show a simple weather forecast in that place and for that particular time below each transfer (perhaps with the probability of rain and temperature is sufficient.).

This panel, along with the succession of stops if it were the case, would only be visible if the user deploys it, because for some people this information will not be relevant and makes more complex the roadmap.

In addition this panel could be reused to add more information in the future (fare, link to the photo stored in the GTFS file, incidents, etc.).

otpweather

vreixo commented 9 years ago

@egofer I think that this would be a very nice addition :-)

Are you thinking on a panel per itinerary or per step of the itinerary? For long trips the weather may change in between legs, but I'm wondering if would be too much to add one for each segment.

2014-10-01 18:23 GMT+02:00 egofer notifications@github.com:

I believe that the roadmap would be the best place. A panel would show a simple weather forecast in that place and for that particular time below each transfer (perhaps with the probability of rain and temperature is sufficient.).

This panel, along with the succession of stops if it were the case, would only be visible if the user deploys it, because for some people this information will not be relevant and makes more complex the roadmap.

In addition this panel could be reused to add more information in the future (fare, link to the photo stored in the GTFS file, incidents, etc.).

[image: otpweather] https://cloud.githubusercontent.com/assets/3096716/4478634/1d1b8e32-4987-11e4-8695-7503cde875ac.png

— Reply to this email directly or view it on GitHub https://github.com/CUTR-at-USF/OpenTripPlanner-for-Android/issues/448#issuecomment-57493273 .

barbeau commented 9 years ago

I think weather/temperature would likely be most relevant for walking legs. I believe most transit modes should be covered from weather. We could only display weather for more than one leg when the result is different per leg.

@egofer Where did you get the icons you used in your mockup? They are nice.

egofer commented 9 years ago

I think it would be interesting to show the weather information on all transfers, especially in walking and cycling for obvious reasons. However probably the premise should be that obtaining weather forecasting does not cause a delay in displaying optimal routes and the roadmap. I think this could be achieved:

  1. Calling the API only if the user displays the information panel of the leg (or to do this in the background).
  2. Due to the fact that OpenWeatherMap facilitates weather forecasts throughout the day in periods of 3 hours (00:00, 03:00, 06:00, etc.), if the trip is within one of these periods and duration is less than 3 hours, the Android client does a single query to the OpenWeatherMap API, because the rest are irrelevant.

@barbeau I got the icons from NounProject (with CC and PD licenses). On the other hand, OpenWeatherMap API returns a code with the name of the icon (although this style is perhaps not the most appropriate). However there are free fonts styles that can be used to represent the weather if required:

barbeau commented 9 years ago

FYI - another free weather API: https://www.mashape.com/george-vustrey/ultimate-weather-forecasts