Package com.google.code.geocoder.model

Examples of com.google.code.geocoder.model.GeocodeResponse


            String lat = ObjectHelper.before(latlng, ",");
            String lng = ObjectHelper.after(latlng, ",");
            req.setLocation(new LatLng(lat, lng));

            LOG.debug("Geocode for lat/lng {}", latlng);
            GeocodeResponse res = geocoder.geocode(req);
            LOG.debug("Geocode response {}", res);

            if (res != null) {
                extractGeoResult(res, exchange);
            }
        } else if (address != null) {

            // is it current address
            if ("current".equals(address)) {
                processCurrentLocation(exchange);
            } else {
                LOG.debug("Geocode for address {}", address);
                GeocoderRequest req = new GeocoderRequest(address, endpoint.getLanguage());
                GeocodeResponse res = geocoder.geocode(req);
                LOG.debug("Geocode response {}", res);

                if (res != null) {
                    extractGeoResult(res, exchange);
                }
View Full Code Here


        }
        if (!nodeWrapper.isNodeType("jnt:location") && !nodeWrapper.isNodeType("jmix:geotagged")) {
            nodeWrapper.addMixin("jmix:geotagged");
        }
        GeocoderRequest geocoderRequest = new GeocoderRequestBuilder().setAddress(address.toString()).getGeocoderRequest();
        GeocodeResponse geocoderResponse = geocoder.geocode(geocoderRequest);
        List<GeocoderResult> results = geocoderResponse.getResults();
        if (results.size() > 0) {
            nodeWrapper.setProperty("j:latitude", results.get(0).getGeometry().getLocation().getLat().toString());
            nodeWrapper.setProperty("j:longitude", results.get(0).getGeometry().getLocation().getLng().toString());
        }
    }
View Full Code Here

TOP

Related Classes of com.google.code.geocoder.model.GeocodeResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.