Examples of GeoLocation


Examples of sagan.team.GeoLocation

        if (!m.find()) {
            throw new ParseException(text, 0);
        }
        float latitude = Float.valueOf(m.group(1));
        float longitude = Float.valueOf(m.group(2));
        return new GeoLocation(latitude, longitude);
    }
View Full Code Here

Examples of sagan.team.GeoLocation

    public void testNoParse() throws Exception {
        formatter.parse("afslk", null);
    }

    private void assertLatLon(String latLon, float lat, float lon) throws ParseException {
        GeoLocation location = formatter.parse(latLon, null);
        assertThat(location.getLatitude(), equalTo(lat));
        assertThat(location.getLongitude(), equalTo(lon));
    }
View Full Code Here

Examples of sagan.team.GeoLocation

        assertThat(location.getLongitude(), equalTo(lon));
    }

    @Test
    public void testPrint() throws Exception {
        assertThat(formatter.print(new GeoLocation(-10.3f, 87.42f), null), equalTo("-10.300000,87.419998"));
    }
View Full Code Here

Examples of twitter4j.GeoLocation

  }
 
  private void updateTwitter() throws TwitterException
  {
      Twitter twitter = new TwitterFactory().getInstance(this.twitt.getAutor(),this.passwd);
      twitter.updateStatus(this.twitt.getMensagem(),new GeoLocation(this.twitt.getLocation().getY(),this.twitt.getLocation().getX()));   
  }
View Full Code Here

Examples of twitter4j.GeoLocation

                        String title = "<img src=\"" + follower.getProfileImageURL().toString() + "\" />" + follower.getScreenName();
                        String alternate = follower.getProfileImageURL().toString();
                        String id = follower.getScreenName();
                        String updated = follower.getCreatedAt().toString();
                        String summary = follower.getDescription();
                        GeoLocation geo = follower.getStatus().getGeoLocation();
                        String lon = Double.toString(geo.getLongitude());
                        String lat = Double.toString(geo.getLatitude());
                        out.println(String.format(template, title, alternate, id, updated, summary, lon, lat));
                    }
                }
            }
View Full Code Here

Examples of twitter4j.GeoLocation

        System.out.println(result.getMaxId() + " :" + result.getPage());
        for (Tweet tweet : result.getTweets()) {           
            User user = twitter.showUser(tweet.getFromUser());
            System.out.println(user.getLocation());
            if (user.isGeoEnabled()) {
                GeoLocation geo = user.getStatus() != null ? user.getStatus().getGeoLocation() : null;
                System.out.println(geo + ":" + tweet.getLocation() + ":" + tweet.getFromUser() + ":" + tweet.getText());
            }
        }

    }
View Full Code Here

Examples of twitter4j.GeoLocation

                        String title = "<img src=\"" +  status.getUser().getProfileImageURL().toString() + "\" />" +  status.getUser().getScreenName();
                        String alternate = status.getUser().getProfileImageURL().toString();
                        String id =  status.getUser().getScreenName();
                        String updated =  status.getUser().getCreatedAt().toString();
                        String summary =  status.getText();
                        GeoLocation geo = status.getGeoLocation();
                        String lon = Double.toString(geo.getLongitude());
                        String lat = Double.toString(geo.getLatitude());
                        out.println(String.format(template, title, alternate, id, updated, summary, lon, lat));
                   
                }
           
View Full Code Here

Examples of twitter4j.GeoLocation

                JSONObject geometryJSON = json.getJSONObject("geometry");
                geometryType = getRawString("type", geometryJSON);
                JSONArray array = geometryJSON.getJSONArray("coordinates");
                if (geometryType.equals("Point")) {
                    geometryCoordinates = new GeoLocation[1][1];
                    geometryCoordinates[0][0] = new GeoLocation(array.getDouble(0), array.getDouble(1));
                } else if (geometryType.equals("Polygon")) {
                    geometryCoordinates = z_T4JInternalJSONImplFactory.coordinatesAsGeoLocationArray(array);
                } else {
                    // MultiPolygon currently unsupported.
                    geometryType = null;
View Full Code Here

Examples of twitter4j.GeoLocation

                                    final Handler<Tweet> handler) throws TwitterClientException, HandlerException {
        Query query = new Query(term);
        query.setCount(MAX_SEARCH_COUNT);

        if (null != geo) {
            GeoLocation loc = new GeoLocation(geo.getLatitude(), geo.getLongitude());
            query.setGeoCode(loc, geo.getRadius(), Query.KILOMETERS);
        }

        QueryResult result = null;
View Full Code Here

Examples of twitter4j.GeoLocation

         if (message.containsProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE))
         {
            double geolat = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE);
            double geolong = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LONGITUDE);
            status.setLocation(new GeoLocation(geolat, geolong));
         }

         if (message.containsProperty(TwitterConstants.KEY_PLACE_ID))
         {
            status.setPlaceId(message.getStringProperty(TwitterConstants.KEY_PLACE_ID));
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.