@Override public int hashCode() { int result = location != null ? location.hashCode() : 0; result = 31 * result + (locationType != null ? locationType.hashCode() : 0); result = 31 * result + (viewport != null ? viewport.hashCode() : 0); result = 31 * result + (bounds != null ? bounds.hashCode() : 0); return result; }
/** * @param precision * @return Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. */ public String toUrlValue(int precision) { return getSouthwest().toUrlValue(precision) + "," + getNortheast().toUrlValue(precision); }
/** * @return Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. */ public String toUrlValue() { return toUrlValue(DEFAULT_PRECISION); }
private GeocodeResponse arretToGeocodeResponse(Arret arret) { GeocodeResponse response = new GeocodeResponse(); response.setStatus(GeocoderStatus.OK); response.setResults(new ArrayList<GeocoderResult>()); GeocoderResult result = new GeocoderResult(); result.setGeometry(new GeocoderGeometry()); result.getGeometry().setLocation( new LatLng(BigDecimal.valueOf(arret.getLatitude()), BigDecimal.valueOf(arret.getLongitude()))); response.getResults().add(result); return response; }
@Override public LatLng getLatLngPointsByAddress(String address) throws IOException { GeocoderResult result = getAddress(address); if (result == null) return null; return result.getGeometry().getLocation(); }
/** * Returns the geo location type. Should be one of: ROOFTOP, RANGE_INTERPOLATED, GEOMETRIC_CENTE, APPROXIMATE. * * @param geocoderResult * @return */ private GeocoderLocationType getGeometryLocationType(GeocoderResult geocoderResult) { GeocoderLocationType locationType = null; GeocoderGeometry geometry = geocoderResult.getGeometry(); if (geometry != null && geometry.getLocationType() != null) { locationType = geometry.getLocationType(); } return locationType; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GeocoderGeometry that = (GeocoderGeometry) o; if (location != null ? !location.equals(that.location) : that.location != null) return false; if (locationType != that.locationType) return false; if (viewport != null ? !viewport.equals(that.viewport) : that.viewport != null) return false; if (bounds != null ? !bounds.equals(that.bounds) : that.bounds != null) return false; return true; }
/** * @return Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. */ public String toUrlValue() { return toUrlValue(LatLng.DEFAULT_PRECISION); }
public static GeocoderLocationType fromValue(String v) { return valueOf(v); } }
public GeocoderRequestBuilder setAddress(String address) { geocoderRequest.setAddress(address); return this; }
public GeocoderRequestBuilder setLanguage(String language) { geocoderRequest.setLanguage(language); return this; }
public GeocoderRequestBuilder addComponent(GeocoderComponent component, String value) { geocoderRequest.addComponent(component, value); return this; }
public String value() { return name(); }
public GeocoderRequestBuilder setChannel(String channel) { geocoderRequest.setChannel(channel); return this; }
public GeocoderRequestBuilder setRegion(String region) { geocoderRequest.setRegion(region); return this; }
public GeocoderRequestBuilder setBounds(LatLngBounds bounds) { geocoderRequest.setBounds(bounds); return this; }
public GeocoderRequestBuilder setLocation(LatLng location) { geocoderRequest.setLocation(location); return this; }
public static GeocoderStatus fromValue(String v) { return valueOf(v); }
private GeocodeResponse arretToGeocodeResponse(Arret arret) { GeocodeResponse response = new GeocodeResponse(); response.setStatus(GeocoderStatus.OK); response.setResults(new ArrayList<GeocoderResult>()); GeocoderResult result = new GeocoderResult(); result.setGeometry(new GeocoderGeometry()); result.getGeometry().setLocation( new LatLng(BigDecimal.valueOf(arret.getLatitude()), BigDecimal.valueOf(arret.getLongitude()))); response.getResults().add(result); return response; }