Examples of GeoLocation


Examples of com.matussek.geo.GeoLocation

  sb.append('[');
  long now = System.currentTimeMillis() - timeDifference;
  double anOrbitLater = now + (extSat.getOrbitalPeriod() * 1000.0D);
  for (long time = now; time <= anOrbitLater; time += 60000L) {
      extSat.setTime(time);
      GeoLocation groundPoint = extSat.getGroundPoint();
      sb.append('[');
      sb.append(NF3.format(Math.toDegrees(groundPoint.getLon())));
      sb.append(',');
      sb.append(NF3.format(Math.toDegrees(groundPoint.getLat())));
      sb.append("],");
  }
  sb.deleteCharAt(sb.length() - 1);
  sb.append(']');
  return sb.toString();
View Full Code Here

Examples of com.matussek.geo.GeoLocation

/* 136 */     sb.append('[');
/* 137 */     long now = System.currentTimeMillis() - this.timeDifference;
/* 138 */     double anOrbitLater = now + (this.extSat.getOrbitalPeriod() * 1000.0D);
/* 139 */     for (long time = now; time <= anOrbitLater; time += 60000L) {
/* 140 */       this.extSat.setTime(time);
/* 141 */       GeoLocation groundPoint = this.extSat.getGroundPoint();
/* 142 */       sb.append('[');
/* 143 */       sb.append(NF3.format(Math.toDegrees(groundPoint.getLon())));
/* 144 */       sb.append(',');
/* 145 */       sb.append(NF3.format(Math.toDegrees(groundPoint.getLat())));
/* 146 */       sb.append("],");
/*     */     }
/* 148 */     sb.deleteCharAt(sb.length() - 1);
/* 149 */     sb.append(']');
/* 150 */     return sb.toString();
View Full Code Here

Examples of edu.uga.galileo.slash.bo.GeoLocation

        stat.setTopLevelDomain(reverseDNSLookupValue
            .substring(reverseDNSLookupValue.lastIndexOf('.') + 1));
      }

      // add resolved geolocation information
      GeoLocation location = Controller.getGeolocationLookupService()
          .getGeoLocation(stat.getIpAddress());
      if (location != null) {
        stat.setCity(location.getCity());
        stat.setRegion(location.getRegion());
        stat.setCountry(location.getCountry());
        stat.setNetSpeed(location.getNetSpeed());
      }

      if (!(stat.getUserAgent().startsWith("Java"))) {
        sdao.writeStat(conn, stat);
      }
View Full Code Here

Examples of edu.uga.galileo.slash.bo.GeoLocation

      ps.setLong(2, ipToLong);

      rs = ps.executeQuery();

      if (rs.next()) {
        return new GeoLocation(rs.getString("city"), rs
            .getString("region"), rs.getString("country"), ""); // rs.getString("netspeed")
                                      // last
      }
    } catch (SQLException e) {
      Logger.error("Couldn't perform geolocation.", e);
View Full Code Here

Examples of facebook4j.GeoLocation

                comments = new PagableListImpl<Comment>(0);
            }
            type = getRawString("type", json);
            if (!json.isNull("coordinates")) {
                JSONObject coordinatesJSONObject = json.getJSONObject("coordinates");
                coordinates = new GeoLocation(coordinatesJSONObject.getDouble("latitude"),
                                              coordinatesJSONObject.getDouble("longitude"));
            }
        } catch (JSONException jsone) {
            throw new FacebookException(jsone.getMessage(), jsone);
        }
View Full Code Here

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

Examples of org.fluxtream.core.domain.Geolocation

        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

Examples of org.fluxtream.core.domain.Geolocation

            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

Examples of rocks.xmpp.extensions.geoloc.model.GeoLocation

                                @Override
                                public void handle(ActionEvent actionEvent) {

                                    try {
                                        GeoLocationManager geoLocationManager = xmppSession.getExtensionManager(GeoLocationManager.class);
                                        geoLocationManager.publish(new GeoLocation(45.44, 12.33));
                                    } catch (XmppException e) {
                                        e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                                    }

                                }
View Full Code Here

Examples of rocks.xmpp.extensions.geoloc.model.GeoLocation

                "          <lat>45.44</lat>\n" +
                "          <locality>Venice</locality>\n" +
                "          <lon>12.33</lon>\n" +
                "          <tzo>-08:00</tzo>\n" +
                "        </geoloc>\n";
        GeoLocation geoLocation = unmarshal(xml, GeoLocation.class);
        Assert.assertNotNull(geoLocation);
        Assert.assertEquals(geoLocation.getLanguage(), "en");
        Assert.assertEquals(geoLocation.getAccuracy(), 20.0);
        Assert.assertEquals(geoLocation.getCountry(), "Italy");
        Assert.assertEquals(geoLocation.getLatitude(), 45.44);
        Assert.assertEquals(geoLocation.getLocality(), "Venice");
        Assert.assertEquals(geoLocation.getLongitude(), 12.33);
        Assert.assertEquals(geoLocation.getTimeZone(), TimeZone.getTimeZone("GMT-08:00"));

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.