org.opentripplanner.gtfs.mapping.WgsCoordinateMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.gtfs.mapping;
import org.onebusaway.gtfs.model.Stop;
import org.opentripplanner.transit.model.basic.WgsCoordinate;
class WgsCoordinateMapper {
static WgsCoordinate mapToDomain(Stop stop) {
if (stop.isLatSet() && stop.isLonSet()) {
return new WgsCoordinate(stop.getLat(), stop.getLon());
}
if (!stop.isLatSet() && !stop.isLonSet()) {
return null;
}
if (stop.isLatSet()) {
throw new IllegalArgumentException("Latitude is set, but not longitude for stop: " + stop);
}
throw new IllegalArgumentException("Longitude is set, but not latitude for stop: " + stop);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy