arcgis.apps.tracker module

The LocationTrackingManager is the main entry point into the Tracker module. It can be used as shown in the following code example.

# Access the location tracking manager and check the status

import arcgis
gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>")
print(gis.admin.location_tracking.status)

LocationTrackingManager

class arcgis.apps.tracker.LocationTrackingManager(gis)

This manages Location Tracking for an organization. It can be accessed from the gis as location_tracking

Additional information can be found here: https://doc.arcgis.com/en/tracker/help/configure-location-tracking.htm

Argument

Description

gis

Required GIS. The GIS to configure location tracking for.

create_track_view(title)

This creates a TrackView.

Argument

Description

title

Required String The title of the Track View to create.

Returns

TrackView

disable()

Disables location tracking for the organization.

THIS WILL DELETE ALL LOCATION TRACKING VIEWS, SERVICES, AND DATA.

Returns

True if successful, False otherwise

enable(tracks_layer_shards=6, lkl_layer_shards=3, tracks_layer_rolling_index_strategy='Monthly')

Enables location tracking for the organization.

Argument

Description

tracks_layer_shards

The number of shards to use for the tracks layer. This only applies for ArcGIS Enterprise.

lkl_layer_shards

The number of shards to use for the last known location layer. This only applies for ArcGIS Enterprise.

tracks_layer_rolling_index_strategy

The rolling index strategy for the tracks layer [“Daily”, “Weekly”, “Monthly”, “Yearly”, “Decade”, “Century”] This only applies for ArcGIS Enterprise.

Returns

True if successful, False otherwise

property item

The Location Tracking Item

property last_known_locations_layer

The last known locations FeatureLayer

pause()

Pauses location tracking for the organization.

Returns

True if successful, False otherwise

resume()

Resumes location tracking for the organization after it was paused.

Returns

True if successful, False otherwise

property retention_period

The retention period of the Location Tracking Tracks Layer. This is a positive integer whose units are defined by retention_period_units

property retention_period_enabled

A boolean indicating if the retention period is enabled

property retention_period_units

The retention period units (“HOURS”, “DAYS”, “MONTHS”, “YEARS”) of the Location Tracking Tracks Layer

property status

The status of location tracking (“disabled”, “paused”, “enabled”)

property track_lines_layer

The track lines FeatureLayer

property tracks_layer

The tracks FeatureLayer

TrackView

class arcgis.apps.tracker.TrackView(item)

A Track View

Argument

Description

item

Required Item. The item that represents the Track View.

# Get a Track View and list mobile users.

import arcgis
gis = arcgis.gis.GIS("https://arcgis.com", "<username>", "<password>")
item = gis.content.get("<item-id>")
track_view = arcgis.apps.tracker.TrackView(item)
mobile_users = track_view.mobile_users.list()
delete()

Deletes the Track View, including the group and view service.

property group

The group that contains the Track Viewers and Layers

property item

The Track View Item

property last_known_locations_layer

The last known locations FeatureLayer

property mobile_users

The MobileUserManager for the Track View

property track_lines_layer

The track lines FeatureLayer

property tracks_layer

The tracks FeatureLayer

property viewers

The TrackViewerManager for the Track View

TrackViewerManager

class arcgis.apps.tracker.TrackViewerManager(track_view)

A class that manages the Track Viewers in the Track View.

It can be accessed from the TrackView as viewers

Argument

Description

track_view

Required TrackView. The Track View to configure Track Viewers for.

add(viewers)

Adds the specified usernames as Track Viewers

Argument

Description

viewers

Required List of String or arcgis.gis.User. The list of usernames/users to add as Track Viewers.

delete(viewers)

Argument

Description

viewers

Required List of String or arcgis.gis.User. The list of usernames/users to remove as Track Viewers.

list()

Lists all of the Track Viewers

Returns

List of String representing usernames

MobileUserManager

class arcgis.apps.tracker.MobileUserManager(track_view)

A class that manages the Mobile Users in the Track View.

It can be accessed from the TrackView as mobile_users

Argument

Description

track_view

Required TrackView. The Track View to configure Mobile Users for.

add(users)

Adds the specified usernames as Mobile Users

Argument

Description

users

Required List of String or arcgis.gis.User. The list of usernames/users to add as Mobile Users

delete(users)

Argument

Description

users

Required List of String or arcgis.gis.User. The list of usernames/users to remove as Mobile Users.

list()

Lists all of the Track Viewers

Returns

List of String representing usernames

property view_definition_query

The View Definition Query of the tracks layer

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.