Make Tracking Layer (Tracking Analyst)

License Level:BasicStandardAdvanced

Summary

This tool creates a tracking layer from a feature class or layer containing temporal data.

Usage

Syntax

MakeTrackingLayer_TA (in_features, out_layer, time_zone, adjusted_for_dst, storage_policy, start_time_field, {time_field_format}, {locale_id}, {am_designator}, {pm_designator}, {track_id_field})
ParameterExplanationData Type
in_features

The input feature class or layer.

Feature Layer
out_layer

The name of the tracking layer to be created. The newly created tracking layer can be used as input to any geoprocessing tool that accepts a feature layer as input.

Feature Layer
time_zone

The time zone that the data in the input feature class was recorded in. For a list of available time zones supported by your system, you can open the tool dialog box and expand this drop-down. When you enter the time zone as a parameter, you must use a non-localized string representation of the appropriate Microsoft Time Zone ID, and replace any spaces with underscore characters. For example, the appropriate string representation of the Pacific time zone in the United States is "Pacific_Standard_Time". "NO_TIME_ZONE" can be used to specify no time zone for the output tracking layer.

String
adjusted_for_dst

If you chose a time zone for your data, this parameter specifies whether the data values in the input time field were recorded with an adjustment for Daylight Saving Time.

  • ADJUSTED_FOR_DSTThe data values in the input time field were recorded with an adjustment for Daylight Saving Time.
  • NOT_ADJUSTED_FOR_DSTThe data values in the input time field were recorded without an adjustment for Daylight Saving Time.
Boolean
storage_policy

Determines the storage policy for the output tracking layer.

  • COPY_ALL_TO_MEMORYThe output tracking layer will be stored completely in memory.
  • KEEP_ON_DISKThe output tracking layer will use a disk-based storage system. This option should only be used when the input feature layer is very large.
String
start_time_field

The field in the input feature class or layer that contains date and time information. This tool requires date and time information to be contained in the same field, and the data type of the field must be Short, Long, Float, Double, Text, or Date.

Field
time_field_format
(Optional)

If the data type of the time field is anything other than Date, this parameter determines the format that will be used to interpret data values in the time field. Some examples of formats are:

  • "yyyyMMdd" (standard format valid for Text or Numeric time fields)
  • "yyyy/MM/dd HH:mm:ss" (standard format valid only for Text time fields)
  • "MM-dd-yyyy hh:mm:ss tt" (custom format valid only for Text time fields)

If the data type of the time field is Text, either a standard Esri text time format can be used or a custom format can be specified. However, custom formats can not be used if you specified KEEP_ON_DISK for the storage policy. If the data type of the time field is numeric (Short, Long, Float, or Double), only standard Esri numeric time formats can be used. If the data type of the time field is Date, this parameter is not needed.

String
locale_id
(Optional)

If the data type of the time field is Text, this parameter determines which locale will be used to interpret data values in the time field. For all time field data types other than Text, this parameter is not needed. If no locale is entered, the current locale of the operating system will be used. For a list of available locales supported by your system, open the tool dialog box and expand this drop-down. When entering the locale as a parameter, it is recommended to use only the locale ID (LCID) assigned by Microsoft, which can be entered as a long integer such as 1033. You can also enter the full string representation of the locale as a parameter, such as "01033-English_(United_States)", but you must replace spaces with underscore characters.

Long
am_designator
(Optional)

If the time field data type is Text and the time format is a 12-hour clock representation including a time marker ("t" or "tt"), then this parameter determines the character ("t") or characters ("tt") that designate AM in the time field data values. If nothing is entered, then the default AM designator for the selected locale will be used. For all time field data types other than Text, this parameter is not needed.

String
pm_designator
(Optional)

If the time field data type is Text and the time format is a 12-hour clock representation including a time marker ("t" or "tt"), then this parameter determines the character ("t") or characters ("tt") that designate PM in the time field data values. If nothing is entered, then the default PM designator for the selected locale will be used. For all time field data types other than Text, this parameter is not needed.

String
track_id_field
(Optional)

The field that contains data values that will be used to group features into tracks in the output tracking layer. The data type of the field can be Short, Long, Float, Double, Text, or OID.

Field

Code Sample

MakeTrackingLayer example using feature class with time values stored in date field

This sample shows how to run the tool on the feature class whose time field is of field type date. This sample uses the Tracking Analyst tutorial data.

import arcpy
arcpy.CheckOutExtension("tracking")
inputGDB = "C:/arcgis/ArcTutor/Tracking Analyst/Simple/Hurricanes.gdb/atlantic_hurricanes_2000"
timezone = "Eastern_Standard_Time"
arcpy.MakeTrackingLayer_ta( inputGDB, "Hurricanes", timezone, "ADJUSTED_FOR_DST", "COPY_ALL_TO_MEMORY", "Date_Time")
MakeTrackingLayer example using shapefile with time values in a standard text format

This sample shows how to run the tool on a shapefile whose time field is text containing data in a standard Esri format.

import arcpy
arcpy.CheckOutExtension("tracking")
inputShapefile = "C:/vehicles/trains.shp"
timezone = "Central_Standard_Time"
arcpy.MakeTrackingLayer_ta( inputShapefile, "trains_layer", timezone, "ADJUSTED_FOR_DST", "COPY_ALL_TO_MEMORY", "text_date", "yyyy-MM-dd HH:mm:ss")
MakeTrackingLayer example using shapefile with time values stored in a custom text format

This sample shows how to run the tool on a shapefile whose time field is text containing data in a custom format. This example also specifies a Track ID field for the output tracking layer.

import arcpy
arcpy.CheckOutExtension("tracking")
inputShapefile = "C:/vehicles/planes.shp"
timezone = "Central_Standard_Time"
arcpy.MakeTrackingLayer_ta( inputShapefile, "planes_layer", timezone, "ADJUSTED_FOR_DST", "COPY_ALL_TO_MEMORY", "cust_date", "MM/dd/yyyy HH:mm:ss", 1033,"AM", "PM", "EVENTID" )
MakeTrackingLayer example using shapefile with time values in a standard numeric format

This sample shows how to run the tool on a shapefile whose time field is a numeric type containing data in a standard Esri format.

import arcpy
arcpy.CheckOutExtension("tracking")
inputShapefile = "C:/vehicles/trains.shp"
timezone = "Central_Standard_Time"
arcpy.MakeTrackingLayer_ta( inputShapefile, "trains_layer", timezone, "ADJUSTED_FOR_DST", "COPY_ALL_TO_MEMORY", "num_date", "yyyyMMdd")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Tracking Analyst
ArcGIS for Desktop Standard: Requires Tracking Analyst
ArcGIS for Desktop Advanced: Requires Tracking Analyst
6/8/2012