Commit graph

75 commits

Author SHA1 Message Date
Andreas Schildbach
070fcad64a Migrate multi-module project to single project. 2019-07-19 19:16:55 +02:00
Ialokim
11c4303733 AbstractNavitiaProvider: Fix to expect and return UTC times. 2019-02-21 19:17:41 +01:00
Andreas Schildbach
8e52035ce5 NetworkProvider: Add types parameter to suggestLocations(). 2019-01-06 15:28:24 +01:00
Andreas Schildbach
0ea83a1ad3 NetworkProvider: Add maxLocations parameter to suggestLocations(). 2019-01-06 14:53:11 +01:00
Andreas Schildbach
fe5a2a8453 Migrate from EnumSet<LocationType> in interfaces to just Set<LocationType>. 2019-01-01 18:11:49 +01:00
Andreas Schildbach
e6474db222 Point: Store coordinate as pair of double, rather than 1E6 ints.
This makes the lat/lon member variables private and adds 1E6 variants for getters and the static constructor.
Also, Location now stores a Point for its coordinate, rather than 1E6 ints. The 1E6-based constructors have been removed.
2018-11-16 01:41:14 +01:00
Andreas Schildbach
2e5f16d3ef NetworkProvider: Rename Option to TripFlag. 2018-11-05 19:58:20 +01:00
Ialokim
79ff93b80f NetworkProvider: queryTrips() now uses a TripOptions field for products, optimize, walkSpeed, accessibilty and options.
The old queryTrips() variant is now deprecated.
2018-11-05 19:57:33 +01:00
Andreas Schildbach
3ffabe1d9b AbstractNavitiaProvider: Add PhysicalMode.RAILSHUTTLE. 2018-10-16 10:40:00 +02:00
Andreas Schildbach
652ff15241 AbstractNavitiaProvider: When querying for nearby locations always use coordinates if provided by caller. 2018-10-06 11:39:42 +02:00
Andreas Schildbach
b2875ddd31 Update links in license to use HTTPS. 2018-07-15 16:47:49 +02:00
Torsten Grote
23b3bd7f6f Navitia: Fix house numbers display. 2017-11-28 18:48:27 +01:00
Torsten Grote
b21088f810 Navitia: Fix sort order of suggested locations.
The navitia developers have informed me that the "quality" of
auto-completion results is deprecated and already meaningless.
Also, we had a wrong inverse sorting order before. The only thing that
matters is the sort order in which the results are returned.
This commit fixes the sort order accordingly.
2017-11-08 19:58:53 +01:00
Torsten Grote
42f9c21145 Navitia: Add house numbers to addresses.
This commit adds the house number behind the street name if available
and gives a way to define other formats like in France
where the house number comes before the street name.
2017-11-08 19:46:38 +01:00
Torsten Grote
e179351115 AbstractNavitiaProvider: Add Orlyval to Physical Modes.
Without this patch, connections with the orlyval train cause an IllegalArgumentException.
2017-09-05 23:28:15 +02:00
Peter Serwylo
af0bcdc17c AbstractNavitiaProvider: Pass network to getLineStyle().
This allows coverages with multiple distinct transport agencies
(e.g. Australia) to meaninfully distinguish between different lines
with similar names. For example, there is often buses which are
labelled by numbers. "Bus 12" needs to be two different colours,
based on which transport network it belongs to.

In the case of Australia, it will use this to delegate to the
lineStyles() method.
2017-08-20 22:27:49 +02:00
Torsten Grote
fde9b3f470 Navitia: Don't swallow trips.
Use the `min_nb_journeys` parameter rather than the `count` parameter
when requesting trips.

The `count` parameter causes Navitia to remove trips arbitrarily
from the result which can look like a bug to the user
when she knows a trip should be there, but it isn't.
2017-03-24 20:48:54 +01:00
jamescr
cc9307b587 Navitia: Add TRAM physical mode - GTFS and transitfeed route type '0'. 2017-02-21 19:13:19 +01:00
Andreas Schildbach
bf510b516d If possible, use generic type inference for constructing objects. 2017-01-28 14:59:03 +01:00
Patrick Kanzler
a9e254c3ae AbstractNavitiaProvider: Fix NullPointerException.
4f7bd832e6 introduced a
NullPointerException in AbstractNavitiaProvider.
The call to Context() in line 970 calls prevQueryUrl.toString() and
nextQueryUrl.toString().
The variables are however null in the case that the search returned
only one result. The easiest way to reproduce this is searching
for two very near locations. The result will then be one walk-route.
This commit fixes the NPE by restoring the old behavior and has been
tested in Transportr.
2017-01-18 14:44:01 +01:00
Andreas Schildbach
4f7bd832e6 Use HttpUrl and HttpUrl.Builder where possible. 2017-01-03 10:59:30 +01:00
Andreas Schildbach
a0a5db7a02 AbstractNavitiaProvider: Fix some exception messages. 2016-12-12 12:48:34 +01:00
Torsten Grote
976e5567d7 AbstractNavitiaProvider: Handle section type 'on_demand_transport'. 2016-12-12 12:48:17 +01:00
Andreas Schildbach
a844c5bc56 EFA: Parse serverID from <itdRequest>. 2016-11-07 23:08:44 +01:00
Andreas Schildbach
05219556c8 AbstractNavitiaProvider: Handle error id 'date_out_of_bounds'. 2016-10-22 17:30:02 +02:00
Andreas Schildbach
74d552d187 Migrate all HTTP calls to use OkHttp rather than URLConnection. 2016-09-25 19:53:31 +02:00
Andreas Schildbach
4c64746e75 Switch to Java 7.
Notes regarding Android compatibility:
- The 'try-with-resources' language feature needs API level 19, so don't use it.
  All other language features can be used back to API level 8.
- The JDK 1.7 API still isn't fully implemented, so better stick with 1.6 for now.
2016-09-25 19:53:31 +02:00
Andreas Schildbach
0518453fb1 Navitia: Update API base to HTTPS. 2016-09-20 22:25:35 +02:00
Andreas Schildbach
931dafb628 Switch to modern code format. Organize imports. No functional changes.
Java sources use Eclipse 4.5 'Java Conventions' with indentation changed to 4 spaces only per level.
2016-09-08 18:26:01 +02:00
Andreas Schildbach
de6ae1a025 Navitia: Handle physical mode OTHER. 2016-07-31 14:20:41 +02:00
Torsten Grote
6d99e63db8 Navitia: More efficient product parsing
According to CanalTP/navitia#1386, Navitia has finally added the
product to departure query results, so all information we need can now
be retrieved by one network query only.

The AbstractNavitiaProvider was adapted accordingly and all legacy code
including the Product Cache was removed.
2016-06-01 09:57:43 +02:00
Torsten Grote
4566bf3cfb Navitia: Find products for nearby stations 2016-05-23 15:57:51 +02:00
Torsten Grote
17e54c4d62
Navitia: Support Ambiguous QueryTripsResult 2016-05-15 20:05:17 -03:00
Torsten Grote
bc5cf15893 Line: Add a name to Line and use it with Navitia providers
Also add network to Navitia providers and take text color into account.

Due to a bug uncovered by adding the network to the line,
the code to retrieve departures had to be simplified.
It now does not do an extra network request to get the line destination.
2016-04-14 10:11:13 +02:00
Torsten Grote
2adf627e51 Navitia: Also suggest POI and administrative locations
The administrative areas are extremely useful when people search for a
suburb, but no stops have the suburbs name. They are currently mapped
to a POI location.
2016-04-13 16:37:19 +02:00
Torsten Grote
47f31e99c2 Navitia: Properly create Locations with name and place.
Allow option to fix case of location names and simplify location parsing
code.
2016-04-07 20:12:31 +02:00
Andreas Schildbach
ab4650586a Navitia: Handle empty or non-present color attributes, use the product default colors in these cases. 2016-03-09 13:40:13 +01:00
Torsten Grote
14f02607f1 Navitia: Less network requests and no NPE when querying for departures.
The AbstractNavitiaProvider was making one network request per departure
it found, just to find the `Product`. This information is mostly
available in the second request it makes, so this should be taken when
available.

Also, in rare cases no destination can be found for a line. It should
not crash in these cases. This was also fixed within this commit.
2016-03-09 13:18:50 +01:00
Andreas Schildbach
ead34426c6 Navitia: If query returns 'not found' and JSON from error page could not be parsed, link the original exception. 2016-03-09 13:14:19 +01:00
Torsten Grote
bb76498c87 Navitia: Take the location priority into account when suggesting locations. 2016-03-08 14:47:52 +01:00
Andreas Schildbach
81ce7cdc3d Navitia: When querying for nearby locations, let the server choose the limit when maxLocations=0. 2016-02-10 19:21:00 +01:00
Torsten Grote
16c85476b1 Navitia: Fix departures query when using equiv=false
When querying departures from a stop_area with equiv=false
the query URI was wrong and returned no results.
This was especially problematic, because the suggestLocation query
returns only stop_areas at the moment.
2016-02-07 00:39:11 +01:00
Torsten Grote
4f9fb0cab2 Navitia: queryNearbyLocations() with distance of 0 now means "unlimited" (50km). 2016-01-31 19:39:42 +01:00
Torsten Grote
abad1694bc Navitia: Increase hard-coded time-span for departures to 86400 (24h) default.
This was previously set to 1 hour causing very few or none departures to
be returned for stations with little traffic.
2016-01-31 19:28:42 +01:00
Torsten Grote
ac3d55cc21 Navitia: Only set "Authorization" HTTP header when required. 2016-01-31 19:26:23 +01:00
Torsten Grote
5be14b0134 Navitia: Allow custom API base.
This is especially useful if you want to run a Navitia instance on your
own server.
2015-12-22 15:25:17 +01:00
Nicolas Derive
d107a905b2 Navitia: Fix some API request URIs. 2015-12-21 12:11:43 +01:00
Andreas Schildbach
9b16fc6353 HttpClient: Use setHeader() rather than authorization parameter. 2015-09-26 10:04:08 +02:00
Andreas Schildbach
00a395a9ad Extract HttpClient into own class which can keep state (cookies and configuration for now). 2015-07-19 14:22:55 +02:00
Andreas Schildbach
f4974bc8f2 EFA: Trip optimization for least duration, least changes or least walking. 2015-06-06 00:36:27 +02:00