mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 01:10:02 +00:00
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.
This commit is contained in:
parent
a7f6abc4b9
commit
e6474db222
49 changed files with 514 additions and 462 deletions
|
@ -310,8 +310,8 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
|||
private String printLocation(final Location location) {
|
||||
if (location.hasId())
|
||||
return location.id;
|
||||
else if (location.hasLocation())
|
||||
return (double) (location.lon) / 1E6 + ";" + (double) (location.lat) / 1E6;
|
||||
else if (location.hasCoord())
|
||||
return location.getLonAsDouble() + ";" + location.getLatAsDouble();
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
@ -695,9 +695,9 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
|||
|
||||
// Build url depending of location type.
|
||||
final HttpUrl.Builder url = url();
|
||||
if (location.hasLocation()) {
|
||||
final double lon = location.lon / 1E6;
|
||||
final double lat = location.lat / 1E6;
|
||||
if (location.hasCoord()) {
|
||||
final double lon = location.getLonAsDouble();
|
||||
final double lat = location.getLatAsDouble();
|
||||
url.addPathSegment("coords").addPathSegment(lon + ";" + lat);
|
||||
} else if (location.type == LocationType.STATION) {
|
||||
if (!location.isIdentified())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue