Odysseus has built-in features in the spatial package with which spatio-temporal and especially moving objects data can be processed. Here we describe how to use these features and give a few example scenarios.
For this example, we use the data from the San Francisco bay, which is provided by ais.exploratorium.edu (you can open this in a browser and see the raw AIS data). You use this query to access the data. Just create a new Odysseus Script file within Odysseus Studio and run this query (with the "green arrow down"-button). When you right click on the query in the "Queries" view and choose "Show Stream Elements" and then "List ...", you can see the key-value objects with readable AIS data.
#PARSER PQL #RUNQUERY /// Access the data from San Francisco input = ACCESS({ source='SanFranciscoAIS', wrapper='GenericPush', transport='TCPClient', protocol='NMEA', datahandler='keyValueObject', options=[ ['host', 'ais.exploratorium.edu'], ['port', '80'] ] } ) |
A message you receive could look similar to the following:
{"rateOfTurn":0,"navigationStatus":"UnderwayUsingEngine","maneuverIndicator":"NotAvailable","trueHeading":274,"positionAccurate":false,"latitude":37.56334666666667,"courseOverGround":272.3,"speedOverGround":13.4,"sourceMmsi":367134000,"longitude":-123.107605,"second":18,"raimFlag":false};1488537437230|oo |
This data can now be used to fill a spatio-temporal index for moving objects. To do this, create another Odysseus Script file and run the following query.
#PARSER PQL /// The index structure #DEFINE dataStructureName 'sanFranciscoStore' #DEFINE dataStructureType 'mo_geohash' #RUNQUERY /// Store the data in an index structure movingObjectIndex = MOVINGOBJECTSTORE({ distancepermo = 100.0, geometryattribute = 'SpatialPoint', datastructurename = ${dataStructureName}, idattribute = 'sourceMmsi', datastructuretype = ${dataStructureType} }, System.SanFranciscoAIS ) |
Example code
The work on this topic is not finished. Here list of things that we want to add in future releases.