Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 2.16 KB

sample-app.md

File metadata and controls

35 lines (29 loc) · 2.16 KB

Breinify: Leading Temporal AI Engine

Sample Application

The library contains an executable sample application Sample.java. This sample application provides some examples on how to request data from the API through the library.

Output of the Sample Application
Output of the Sample Application utilizing some commonly used features.

As illustrated, the sample application resolves the IP address 204.28.127.66 and looks-up some sample geo-coordinates, i.e., (40.7608, -111.8910), (39.0256, -77.0299), and (43.0025, -87.9192). The sample also shows how to resolve text to a location, as examples Las Vegas, Grand Canyon, and The Big Apple. At last, the example shows a text based on the response of the /temporaldata API using some time, location, event, and weather information. The sample application does not illustrate the retrieval of GeoJson instances. GeoJson instances are mainly used for visualizations, which are out of the scope of this simple example (not because of the API or the library, mostly because of the complexity within Java). Nevertheless, to retrieve GeoJsons is as simple as it is for other libraries (see their examples for a visualization, e.g., JavaScript or Node.js):

final BreinTemporalDataResult result = new BreinTemporalData()
   .setLatitude(37.7609295)
   .setLongitude(-122.4194155)
   .addShapeTypes("CITY", "NEIGHBORHOOD")
   .execute();

// access the geoJson instances for the CITY and the NEIGHBORHOOD
System.out.println(result.getLocation().getGeoJson("CITY"));
System.out.println(result.getLocation().getGeoJson("NEIGHBORHOOD"));