/** * This is a wrapper to build a reverse geocoding request */ public GHGeocodingRequest(double lat, double lon, String locale, int limit) { this(true, new GHPoint(lat, lon), null, locale, limit, "default", -1); }
@Override public LinearKeyAlgo setBounds(double minLonInit, double maxLonInit, double minLatInit, double maxLatInit) { bounds = new BBox(minLonInit, maxLonInit, minLatInit, maxLatInit); latDelta = (bounds.maxLat - bounds.minLat) / latUnits; lonDelta = (bounds.maxLon - bounds.minLon) / lonUnits; return this; }
@Override public boolean equals(Object obj) { if (obj == null) return false; final GPXEntry other = (GPXEntry) obj; return time == other.time && super.equals(obj); }
@Override public String toString() { return super.toString() + ", " + time; } }
/** * Wrapper method for {@link Polygon#contains(double, double)}. */ public boolean contains(GHPoint point) { return contains(point.lat, point.lon); }
@Override public boolean contains(double lat1, double lon1) { return normDist(lat1, lon1) <= normedDist; }
public SpatialKeyAlgo bounds(BBox box) { bbox = box.clone(); return this; }
/** * Set routing request from specified startPlace (fromLat, fromLon) to endPlace (toLat, toLon) * with a preferred start and end heading. Headings are north based azimuth (clockwise) in (0, * 360) or NaN for equal preference. */ public GHRequest(double fromLat, double fromLon, double toLat, double toLon, double startHeading, double endHeading) { this(new GHPoint(fromLat, fromLon), new GHPoint(toLat, toLon), startHeading, endHeading); }
/** * Prefills BBox with minimum values so that it can increase. */ public static BBox createInverse(boolean elevation) { if (elevation) { return new BBox(Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, true); } else { return new BBox(Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, Double.NaN, Double.NaN, false); } }
public GHGeocodingRequest(boolean reverse, GHPoint point, String query, String locale, int limit, String provider, long timeout) { this.reverse = reverse; if (point == null) { this.point = new GHPoint(); } else { this.point = point; } this.query = query; this.locale = locale; this.limit = limit; this.provider = provider; this.timeout = timeout; }
@Override public BBox getBounds() { return new BBox(minLon, maxLon, minLat, maxLat); }
@Override public GHPoint getCenter() { return new GHPoint((maxLat + minLat) / 2, (maxLon + minLon) / 2); }
@Override public BBox getBounds() { return new BBox(-180, 180, -90, 90); } };
@Override public GHPoint getCenter() { return new GHPoint(lat, lon); }
@Override public GHPoint getCenter() { return new GHPoint((maxLat + minLat) / 2, (maxLon + minLon) / 2); }