8.2 Location Tracking Set

The location tracking server tracks a set of moving objects against a known set of regions and generates notifications as required. In this framework, the set of objects and regions is referred to as a tracking set.

In the database these are managed in a table with two columns:

region_id  NUMBER, 
geometry   SDO_GEOMETRY

REGION_ID is the primary key for this table, and GEOMETRY is the geometry of the tracking region.

Several additional structures are created when you create a tracking set. You can create any number of tracking sets, and each tracking set can have thousands of regions. When a region is no longer of interest for tracking purposes, it should be deleted from the tracking regions table.

A set of objects to be tracked also needs to be created. Each object must specify an ID for the object and a region ID to specify the region in which this object is tracked. That is, each object can be tracked against one or more tracking regions. An object is created by inserting a tracker message, TRACKER_MSG, into a tracking queue.

A tracker message object specifies the object_idregion_id, and operation. The operation parameter has one of the following string values.

  • I: A notification message is issued every time an object, defined by object_id, moves while inside the region, defined by region_id

  • O: A notification message is issued every time an object, defined by object_id, moves while outside the region, defined by region_id.

  • T: A notification message is issued only when the object, defined by object_id, transitions from inside to outside or from outside to inside the region defined by region_id.

  • D: Disables the tracking of an object defined by object_id in the region defined by region_id. To enable tracking of this object again, another tracking message must be sent.

After the objects are created and tracking regions configured, new location messages for the objects can be sent. As objects move in space, their locations change. Every time a new location message is sent, it is inserted into the location message queue, to be processed by the location tracking server. Location messages are processed and notification messages are generated as required. Applications can monitor the notification queue and process the notification messages whenever new notifications are generated.

The following additional grants are required for a user to run the location tracking server.

GRANT aq_administrator_role, create job, manage scheduler to <USER>; grant execute on dbms_aq to <USER>; 
GRANT execute on dbms_aqadm to <USER>;
GRANT execute on dbms_lock to  <USER>;
GRANT execute on dbms_aqin to  <USER>;
GRANT execute on dbms_aqjms to <USER>;