Package slash.navigation.earthtools.binding

Examples of slash.navigation.earthtools.binding.Height


    public Double getElevationFor(double longitude, double latitude) throws IOException {
        Get get = new Get(getEarthToolsUrlPreference() + "height/" + latitude + "/" + longitude);
        String result = get.executeAsString();
        if (get.isSuccessful())
            try {
                Height height = unmarshal(result);
                Integer elevation = parseInt(height.getMeters());
                if (elevation != null && !elevation.equals(-9999))
                    return elevation.doubleValue();
            } catch (Exception e) {
                throw new IOException("Cannot unmarshall " + result + ": " + e, e);
            }
View Full Code Here


    private static Unmarshaller newUnmarshaller() {
        return JAXBHelper.newUnmarshaller(newContext(ObjectFactory.class));
    }

    private static Height unmarshal(StringReader reader) throws JAXBException {
        Height result = null;
        try {
            return (Height) newUnmarshaller().unmarshal(reader);
        } catch (ClassCastException e) {
            throw new JAXBException("Parse error: " + e, e);
        }
View Full Code Here

TOP

Related Classes of slash.navigation.earthtools.binding.Height

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.