Accessing and Analyzing Twitter Feeds with Oracle Stream Analytics (Part 2)

In Part 1 of this series we saw how to setup a connection in Oracle Stream Analytics to Twitter and create a Tweet stream. In this part we will investigate using the OSA map and geo-spatial exploration features to display the tweet point of origin on a map.

Location Aware Tweets

Notice that tweets do not by default include the location information (latitude and longitude) of the post. Missing location data is set to minus one on the tweet as shown below.

iPaaS-tweet-lat-long

In order to include location information, post from a mobile device that has location (GPS) hardware. Enable location on the tweet and turn on “Share precise location” as shown below.

Tweet-precise-location

Now that we have tweets with location information the next step is to create a map display in OSA to get visual display of point of origin.

OSA Maps and Patterns

The map item allows you to set a rectangular region of the globe and “geo fences” which will display highlighted markers if location data in the stream is contained within the fence. Start by creating a new Map item,

create-map-item

enter a name and type for the map, we’re using manual type here.

map-name-and-type

Zoom in or out to set the global region and draw the one or more geo fence areas as a closed loop on the map.

map-fence-na-west

 

Next we need to define the exploration as a Pattern and link the Twitter stream to the map. Create a new Pattern based exploration,

create-pattern-item

and select Spatial General for the pattern type.

spatial-general-select

Use the Map and Event Stream items we have already created and select latitude and longitude location data. We want marker highlight for tweets inside geo fence so select only “Enter” for tracking and leave the coordinate system default 8307.

pattern-map-and-stream

 

Publish the exploration and we are finished. As Tweets arrive in the Twitter feed stream they will display as markers on the map.

tweet-map-marker-display

Next

In the next installment we’ll take a look at using content analysis on the text of the tweet stream to track sentiment information.

Add Your Comment