Package org.fluxtream.core.domain

Examples of org.fluxtream.core.domain.Geolocation


    public void testExtractLatLong() throws Exception {
        final double delta = 0.00001;

        Assert.assertNull(ImageUtils.getGeolocation(IMAGE_1));

        final Geolocation geolocation1 = ImageUtils.getGeolocation(IMAGE_2);
        Assert.assertNotNull(geolocation1);
        Assert.assertEquals(40.44283333333333, geolocation1.getLatitude(), delta);
        Assert.assertEquals(-79.94633333333333, geolocation1.getLongitude(), delta);
        Assert.assertEquals(318.99533, geolocation1.getHeading(), delta);
        Assert.assertEquals("T", geolocation1.getHeadingRef());
        Assert.assertEquals(318.00183, geolocation1.getAltitude(), delta);
        Assert.assertEquals((Integer)0, geolocation1.getAltitudeRef());
        Assert.assertEquals(null, geolocation1.getGpsPrecision());
        Assert.assertEquals(null, geolocation1.getGpsDatestamp());
        Assert.assertEquals("20:32:31 UTC", geolocation1.getGpsTimestamp());

        try {
            ImageUtils.getGeolocation(IMAGE_3);
            Assert.fail("ImageUtils.getGeolocation() should fail for IMAGE_3 since the image type is not supported.");
        }
        catch (ImageProcessingException e) {
            // nothing to do
        }
        catch (IOException e) {
            Assert.fail("Should not get an IOException for calling ImageUtils.getGeolocation() on IMAGE_3.");
        }

        try {
            ImageUtils.getGeolocation(IMAGE_4);
            Assert.fail("ImageUtils.getGeolocation() should fail for IMAGE_4 since the image type is not supported.");
        }
        catch (ImageProcessingException e) {
            // nothing to do
        }
        catch (IOException e) {
            Assert.fail("Should not get an IOException for calling ImageUtils.getGeolocation() on IMAGE_4.");
        }

        try {
            ImageUtils.getGeolocation(IMAGE_4);
            Assert.fail("ImageUtils.getGeolocation() should fail for IMAGE_4 since the image type is not supported.");
        }
        catch (ImageProcessingException e) {
            // nothing to do
        }
        catch (IOException e) {
            Assert.fail("Should not get an IOException for calling ImageUtils.getGeolocation() on IMAGE_4.");
        }

        Assert.assertNull(ImageUtils.getGeolocation(IMAGE_5));

        final Geolocation geolocation2 = ImageUtils.getGeolocation(IMAGE_6);
        Assert.assertNotNull(geolocation2);
        Assert.assertEquals(45.50066666666667, geolocation2.getLatitude(), delta);
        Assert.assertEquals(9.110333333333333, geolocation2.getLongitude(), delta);
        Assert.assertEquals(null, geolocation2.getHeading());
        Assert.assertEquals(null, geolocation2.getHeadingRef());
        Assert.assertEquals(217, geolocation2.getAltitude(), delta);
        Assert.assertEquals((Integer)0, geolocation2.getAltitudeRef());
        Assert.assertEquals(null, geolocation2.getGpsPrecision());
        Assert.assertEquals("2011:05:06", geolocation2.getGpsDatestamp());
        Assert.assertEquals("7:59:48 UTC", geolocation2.getGpsTimestamp());

        try {
            ImageUtils.getGeolocation(NOT_AN_IMAGE);
            Assert.fail("ImageUtils.getGeolocation() should fail for NOT_AN_IMAGE since the image type is not supported.");
        }
View Full Code Here


        orientation = photo.getOrientation().getId();

        this.addTags(photo.getTags(), Tag.COMMA_DELIMITER);
        this.comment = photo.getComment();

        final Geolocation geolocation = photo.getGeolocation();
        if (geolocation != null) {
            latitude = geolocation.getLatitude();
            longitude = geolocation.getLongitude();
            heading = geolocation.getHeading();
            headingRef = geolocation.getHeadingRef();
            altitude = geolocation.getAltitude();
            altitudeRef = geolocation.getAltitudeRef();
            gpsPrecision = geolocation.getGpsPrecision();
            gpsDatestamp = geolocation.getGpsDatestamp();
            gpsTimestamp = geolocation.getGpsTimestamp();
        }
    }
View Full Code Here

            logger.error("Exception while trying to read the orientation data for user [" + guestId + "] photo [" + photoStoreKey + "]");
            orientationTemp = null;
        }
        orientation = (orientationTemp == null) ? ImageOrientation.ORIENTATION_1 : orientationTemp;

        Geolocation geolocationTemp;
        try {
            geolocationTemp = ImageUtils.getGeolocation(photoBytes);
        }
        catch (ImageProcessingException e) {
            logger.error("ImageProcessingException while trying to read the geolocation data for user [" + guestId + "] photo [" + photoStoreKey + "]");
View Full Code Here

TOP

Related Classes of org.fluxtream.core.domain.Geolocation

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.