GeoLocation geoLocation = status.getGeoLocation(); if (null != geoLocation) { double lat = status.getGeoLocation().getLatitude(); double lon = status.getGeoLocation().getLongitude(); theMap.put("lat", lat); theMap.put("lon", lon);
@Override public String getValue() { return status.getGeoLocation() + ""; } },
/** * Retrieves the State from GeoLocation Object of the Tweet. * This is considered as the primary and correct value for the State of the tweet. * * @param status -- Status Object. * @return State of tweet. */ private final String getStateFromTweetGeoLocation(final Status status) { String state = null; final double latitude; final double longitude; final GeoLocation geoLocation = status.getGeoLocation(); if (null != geoLocation) { latitude = geoLocation.getLatitude(); longitude = geoLocation.getLongitude(); LOGGER.debug("LatLng for BingMaps:{} and {}", latitude, longitude); final Optional<String> stateGeoOptional = BingMapsLookup.reverseGeocodeFromLatLong(latitude, longitude); if(stateGeoOptional.isPresent()){ final String stateFromGeoLocation = stateGeoOptional.get(); LOGGER.debug("State from BingMaps:{}", stateFromGeoLocation); state = (2 == stateFromGeoLocation.length())? stateFromGeoLocation.toUpperCase(): null; } } return state; } }
GeoLocation geoLocation = status.getGeoLocation(); Coordinate coordinate = null;
GeoLocation geoLocation = status.getGeoLocation(); if (null != geoLocation) { double lat = status.getGeoLocation().getLatitude(); double lon = status.getGeoLocation().getLongitude(); theMap.put("lat", lat); theMap.put("lon", lon);
@Override public void onStatus(Status status) { Document tweet = new Document(); tweet.put("_id", status.getId()); tweet.put("createdAt", status.getCreatedAt()); tweet.put("favoriteCount", status.getFavoriteCount()); tweet.put("retweetCount", status.getRetweetCount()); if (status.getGeoLocation() != null) { tweet.put("lat", status.getGeoLocation().getLatitude()); tweet.put("long", status.getGeoLocation().getLongitude()); } tweet.put("screenName", status.getUser().getScreenName()); if (status.getRetweetedStatus() != null) { tweet.put("retweetedStatus", status.getRetweetedStatus().getText()); } tweet.put("text", status.getText()); Document query = new Document(); query.put("_id", status.getId()); collection.replaceOne(query, tweet, new UpdateOptions().upsert(true)); }
GeoLocation location = status.getGeoLocation(); if (user.isWithGeo() && location != null) { tl.UpdateStatus(statusText, (float) location.getLatitude(), (float) location.getLongitude(), "");
status.date = parser.print(this.status.getCreatedAt().getTime()); if (this.status.getGeoLocation() != null) { final GeoLocation geloc = this.status.getGeoLocation(); final double[] coords = new double[2];
status.date = parser.print(this.status.getCreatedAt().getTime()); if (this.status.getGeoLocation() != null) { final GeoLocation geloc = this.status.getGeoLocation(); final double[] coords = new double[2];
if (null != status.getGeoLocation()) { geoLocationStruct = new Struct(GEO_LOCATION_SCHEMA); convert(status.getGeoLocation(), geoLocationStruct); } else { geoLocationStruct = null;