[
https://issues.apache.org/jira/browse/STREAMS-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15598419#comment-15598419
]
ASF GitHub Bot commented on STREAMS-399:
----------------------------------------
Github user smarthi commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/313#discussion_r84584515
--- Diff:
streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/converter/util/TwitterActivityUtil.java
---
@@ -350,4 +351,26 @@ public static void addTwitterExtensions(Activity
activity, Tweet tweet) {
extensions.put("keywords", tweet.getText());
}
+
+ /**
+ * Compute central coordinates from bounding box
+ * @param place the bounding box to use as the source
+ */
+ public static List<Double> boundingBoxCenter(Place place) {
+ if( place == null ) return new ArrayList<>();
+ if( place.getBoundingBox() == null ) return new ArrayList<>();
+ if( place.getBoundingBox().getCoordinates().size() != 1 ) return
new ArrayList<>();
+ if( place.getBoundingBox().getCoordinates().get(0).size() != 4 )
return new ArrayList<>();
+ List<Double> lats = Lists.newArrayList();
+ List<Double> lons = Lists.newArrayList();
+ for( List<Double> point :
place.getBoundingBox().getCoordinates().get(0)) {
+ lats.add(point.get(0));
+ lons.add(point.get(1));
+ }
+ List<Double> result = new ArrayList<Double>();
--- End diff --
the RHS can just be 'new ArrayList<>();' -> Java 7
> Add any missing fields to tweet.json
> ------------------------------------
>
> Key: STREAMS-399
> URL: https://issues.apache.org/jira/browse/STREAMS-399
> Project: Streams
> Issue Type: Improvement
> Reporter: Steve Blackmon
> Assignee: Steve Blackmon
>
> Noticed some new fields in tweets:
> is_quote_status
> quoted_status_id
> quoted_status
> Add these and any other missing fields to tweet.json
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)