org.opentripplanner.geocoder.AlternatingGeocoder 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.geocoder;
import org.locationtech.jts.geom.Envelope;
public class AlternatingGeocoder implements Geocoder {
private Geocoder geocoder1;
private Geocoder geocoder2;
private boolean useFirstGeocoder;
public AlternatingGeocoder(Geocoder geocoder1, Geocoder geocoder2) {
this.geocoder1 = geocoder1;
this.geocoder2 = geocoder2;
this.useFirstGeocoder = false;
}
@Override
public GeocoderResults geocode(String address, Envelope bbox) {
useFirstGeocoder = !useFirstGeocoder;
Geocoder g = useFirstGeocoder ? geocoder1 : geocoder2;
return g.geocode(address, bbox);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy