Processing Geo Data¶
Purpose:¶
This application demonstrates how to retrieve the longitude and latitude based on location details provided.
Before you begin:
Save the sample Siddhi application in WSO2 Integrator: SI Tooling.
Executing the Sample¶
To execute the sample open the saved Siddhi application in WSO2 Integrator: SI Tooling, and start it by clicking the Start button (shown below) or by clicking Run => Run.

If the Siddhi application starts successfully, the following message appears in the console.
execution-geo-sample.siddhi - Started Successfully!
Testing the Sample¶
To test the sample Siddhi application, simulate single events for it via the WSO2 Integrator: SI Tooling as follows:
-
To open the Event Simulator, click the Event Simulator icon.

This opens the event simulation panel.
-
To simulate events for the
geocodeStreamstream of theexecution-geo-sampleSiddhi application, enter information in the Single Simulation tab of the event simulation panel as follows.
Field Value Siddhi App Name execution-geo-sampleStreamName geocodeStreamAs a result, attributes specific to the
geocodeStreamare displayed as marked in the above image. -
Enter attribute values as follows.
.Attribute Value location 5 Avenue Anatole Francelevel 75007 Paristime France -
Click Start and Send.
Viewing the Results¶
The prediction for the location you provided via the event you simulated is displayed as follows in the WSO2 Integrator: SI Tooling console.
INFO {io.siddhi.core.query.processor.stream.LogStreamProcessor} - sentimentExtensionSample: Event :, StreamEvent{ timestamp=1513623526790, beforeWindowData=null, onAfterWindowData=null, outputData=[48.8583698, 2.2944833, Tour Eiffel, 5 Avenue Anatole France, 75007 Paris, France], type=CURRENT, next=null}
Click here to view the sample Siddhi application.
@App:name("execution-geo-sample")
@App:description('Use geo data related functionality to retrieve the longitude and latitude for the provided location details.')
-- Please refer to https://docs.wso2.com/display/SP400/Quick+Start+Guide on getting started with streaming-integrator-tooling.
define stream geocodeStream (location string, level string, time string);
@sink(type='log')
define stream dataOut(latitude double, longitude double, formattedAddress string);
@info(name = 'query')
from geocodeStream#geo:geocode(location)
select latitude, longitude, formattedAddress
insert into dataOut;