Text Data Formats for the Generic Input Data Link

The Generic Input Data Link can receive data messages in a text format that uses character separators between the different values and between messages. One of the most common ways of using this text format is to incorporate comma-separated values (CSV) into Tracking Server.

Assume that Tracking Server has a message definition named Vehicle and it is composed of the following fields with the associated data types:

Message Definition Name: Vehicle

Field Name

Data Type

SHAPE

Point

License_Plate

String

Date_Time

Timestamp

The following example shows what a simple CSV message stream might look like for this message definition. Each message has the name of the message definition (as it is stored in Tracking Server) followed by all of the attributes. For each message, the message definition name and all of the attributes are separated from one another by commas. Each message is separated from the next message by a carriage return character.

Vehicle,"-116.38976478523308,32.61191112061326,0",C893HKV,3/19/2010 8:35:20 PM
Vehicle,"-116.38976478523308,32.61191112061326,0",C893HKV,3/19/2010 8:35:25 PM
Vehicle,"-116.38976478523308,32.61191112061326,0",C893HKV,3/19/2010 8:35:30 PM

Notice that the field names don't appear in the data anywhere. The data values for the appropriate fields must be listed in the correct order to be interpreted correctly by Tracking Server.

The first item in this list is "Vehicle", which is the message definition name. After the message definition name is a list of attributes separated by commas. Note that the first attribute is the geometry of the data. Since the geometry is itself a list of 3 values separated by commas. Since the geometry is a single attribute that contains commas, it needs to be surrounded by quotes. The quotes keep the Generic Input Data Link from getting confused between the commas inside the geometry and the commas outside the geometry. Following the geometry in this example is two additional attributes representing this vehicle's license plate number, and the time that the vehicle was observed.

A comma is only one type of separator that might be used. The Generic Input Data Link could be configured to use other separators. The example below shows the same data as the previous example with the commas replaced by dollar signs.

Vehicle$"-116.38976478523308,32.61191112061326,0"$C893HKV$3/19/2010 8:35:20 PM
Vehicle$"-116.38976478523308,32.61191112061326,0"$C893HKV$3/19/2010 8:35:25 PM
Vehicle$"-116.38976478523308,32.61191112061326,0"$C893HKV$3/19/2010 8:35:30 PM

Sometimes it may be desirable to specify the field separator using a single character. This works well if the field separator is a single character, as in the case of the comma-separated values. However, sometimes the system providing data to Tracking Server will separate fields using a binary value which does not correspond to any letter. In this case the field separator can be specified in the Generic Input Data Link Properties panel using a special escape sequence. You may specify a hexadecimal value using the escape sequence "\x" followed by the hexadecimal value inside of square brackets ([ ]). For example to use the hexadecimal value FF as your field separator, enter the following into the field delimiter box of the Generic Input data link Properties panel: \x[FF]. You may also specify this same value using the decimal escape sequence of "\d". For example, the same separator may be expressed in decimal format as follows \d[255].

You may also use these escape sequences in conjunction with simple text values. For example, suppose you want to use a two-character separator consisting of a comma followed by the hexadecimal value "FF". You would enter the following into the field delimiter box of the Generic Input Data Link Properties panel: ,\x[FF] . The hexadecimal value of a comma is 2C, so you could accomplish the same result with the following value in the field delimiter box: \x[2C]\x[FF].

Separating messages from one another is accomplished in the same way as separating fields within a message. The "End of message" box in the Generic Input Data Link Properties panel is used to specify the separator between messages. By default, the value used is a line feed. You may specify a different value using the same escape conventions available with the field delimiter.

8/28/2015