arcgis.features.managers module

Helper classes for managing feature layers and datasets. These class are not created by users directly. Instances of this class, are available as a properties of feature layers and make it easier to manage them.

AttachmentManager

class arcgis.features.managers.AttachmentManager(layer, version=None)

Manager class for manipulating feature layer attachments.

This class can be created by the user directly if a version is to be specified.

Otherwise, an instance of this class, called ‘attachments’, is available as a property of the FeatureLayer object, if the layer supports attachments. Users call methods on this ‘attachments’ object to manipulate (create, get, list, delete) attachments.

Inputs

Description

layer

Required FeatureLayer . The Feature Layer that supports attachments.

version

Required Version or string. The Version class where the branch version will take place or the version name.

add(oid, file_path, keywords=None, return_moment=False)

Adds an attachment to a FeatureLayer. Adding an attachment is a feature update, but is support with either the Update or the Create capability. The add operation is performed on a feature service feature resource.

Parameter

Description

oid

Required string of the object ID.

file_path

Required string. Path to the file to be uploaded as a new feature attachment. The content type, size, and name of the attachment will be derived from the uploaded file.

keywords

Optional string. Sets a text value that is stored as the keywords value for the attachment. This parameter can be set when the layer has an attachmentProperties property that includes “name”: “keywords” with “isEnabled”: True. If the attachments have keywords enabled and the layer also includes the attachmentFields property, you can use it to understand properties like keywords field length.

return_moment

Optional bool. Specify whether the response will report the time attachments were added. If True, the server will return the time in the response’s editMoment key. The default is False.

Returns

A JSON Response stating ‘success’ or ‘error’

count(where=None, attachment_where=None, object_ids=None, global_ids=None, attachment_types=None, size=None, keywords=None)
delete(oid, attachment_id, return_moment=False, rollback_on_failure=True)

Removes an attachment from a FeatureLayer . Deleting an attachment is a feature update; it requires the Update capability. The deleteAttachments operation is performed on a feature service feature resource. This operation is available only if the layer has advertised that it has attachments. A layer has attachments if its hasAttachments property is true.

Parameter

Description

oid

Required string of the object ID

attachment_id

Required string. Ids of attachment to delete.

Syntax:

attachment_id = “<attachmentId1>, <attachmentId2>”

return_moment

Optional boolean. Specify whether the response will report the time attachments were deleted. If True, the server will report the time in the response’s editMoment key. The default value is False.

rollback_on_failure

Optional boolean. Specifies whether the edits should be applied only if all submitted edits succeed. If False, the server will apply the edits that succeed even if some of the submitted edits fail. If True, the server will apply the edits only if all edits succeed. The default value is true.

Result

JSON response stating ‘success’ or ‘error’

download(oid=None, attachment_id=None, save_path=None)

Downloads attachment and returns its path on disk.

The download tool works as follows:

  • If nothing is given, all attachments will be downloaded

    Example: download()

  • If a single oid and attachment_id are given, the single file will download

  • If a list of oid values are given, all the attachments for those object ids will be saved locally.

Argument

Description

oid

Optional list/string. A list of object Ids or a single value to download data from.

attachment_id

Optional string. Id of the attachment to download. This is only honored if return_all is False.

save_path

Optional string. Path to save data to.

Returns

A path to the folder where the attachement are saved

get_list(oid)

Get the list of attachements for a given OBJECT ID

Parameter

Description

oid

Required string of the object id

Result

A list of attachements

search(where='1=1', object_ids=None, global_ids=None, attachment_types=None, size=None, keywords=None, show_images=False, as_df=False, return_metadata=False, return_url=False, max_records=None, offset=None, *, attachment_where=None)

The search method allows querying the layer for its attachments and returns the results as a Pandas DataFrame or dict

Parameter

Description

where

Required string. The definition expression to be applied to the related layer/table. From the list of records that are related to the specified object Ids, only those records that conform to this expression will be returned.

Example:

where=”STATE_NAME = ‘Alaska’”.

The query results will return all attachments in Alaska.

object_ids

Optional list/string. The object IDs of this layer/table to be queried.

Syntax:

object_ids = <object_id1>, <object_id2>

Example:

object_ids = 2

The query results will return attachments only for the specified object id.

global_ids

Optional list/string. The global IDs of this layer/table to be queried.

Syntax:

global_ids = <globalIds1>,<globalIds2>

Example:

global_ids = 6s430c5a-kb75-4d52-a0db-b30bg060f0b9, 35f0d027-8fc0-4905-a2f6-373c9600d017

The query results will return attachments only for specified global id.

attachment_types

Optional list/string. The file format that is supported by query attachment.

Supported attachment types: bmp, ecw, emf, eps, ps, gif, img, jp2, jpc, j2k, jpf, jpg, jpeg, jpe, png, psd, raw, sid, tif, tiff, wmf, wps, avi, mpg, mpe, mpeg, mov, wmv, aif, mid, rmi, mp2, mp3, mp4, pma, mpv2, qt, ra, ram, wav, wma, doc, docx, dot, xls, xlsx, xlt, pdf, ppt, pptx, txt, zip, 7z, gz, gtar, tar, tgz, vrml, gml, json, xml, mdb, geodatabase

Example:

attachment_types=’image/jpeg’

size

Optional tuple/list. The file size of the attachment is specified in bytes. You can enter a file size range (1000,15000) to query for attachments with the specified range.

Example:

size= (1000,15000)

The query results will return all attachments within the specified file size range (1000 - 15000) bytes.

keywords

Optional string. When attachments are uploaded, keywords can be assigned to the uploaded file. By passing a keyword value, the values will be searched.

Example:

keywords=’airplanes’

show_images

Optional bool. The default is False, when the value is True, the results will be displayed as a HTML table. If the as_df is set to False, this parameter will be ignored.

as_df

Optional bool. Default is False, if True, the results will be a Pandas’ DataFrame. If False, the values will be a list of dictionary values.

return_metadata

Optional Boolean. If true, metadata stored in the exifInfo column will be returned for attachments that have exifInfo. This option is supported only when “name”: “exifInfo” in the layer’s attachmentProperties includes “isEnabled”: true. When set to false, or not set, None is returned for exifInfo.

return_url

Optional Boolean. Specifies whether to return the attachment URL. The default is false. This parameter is supported if the supportsQueryAttachmentsWithReturnUrl property is true on the layer. Applications can use this URL to download the attachment image.

max_records

Optional Integer. This option fetches query results up to the resultRecordCount specified. When resultOffset is specified and this parameter is not, the feature service defaults to the maxRecordCount. The maximum value for this parameter is the value of the layer’s maxRecordCount property. This parameter only applies if supportPagination is true.

offset

Optional Integer. This parameter is designed to be used in conjunction with max_records to page through a long list of attachments, one request at a time. This option fetches query results by skipping a specified number of records. The query results start from the next record (i.e., resultOffset + 1). The default value is 0. This parameter only applies when supportPagination is true. You can use this option to fetch records that are beyond maxRecordCount property.

attachment_where

Optional str. The definition expression to be applied to the attachments table. Only those records that conform to this expression will be returned. You can get the attachments table field names to use in the expression by checking the layer’s attachmentProperties.

Returns

A Pandas DataFrame or Dict of the attachments of the FeatureLayer

update(oid, attachment_id, file_path, return_moment=False)

Updates an existing attachment with a new file

Parameter

Description

oid

Required string of the object ID.

attachment_id

Required string. Id of the attachment to update.

file_path

Required string. Path to file to be uploaded as the updated feature attachment.

return_moment

Optional boolean. Specify whether the response will report the time attachments were deleted. If True, the server will report the time in the response’s editMoment key. The default value is False.

Result

JSON response stating ‘success’ or ‘error’

SyncManager

class arcgis.features.managers.SyncManager(featsvc)

Manager class for manipulating replicas for syncing disconnected editing of FeatureLayer . This class is not created by users directly. An instance of this class, called ‘replicas’, is available as a property of the FeatureLayerCollection object, if the layer is sync enabled / supports disconnected editing. Users call methods on this ‘replicas’ object to manipulate (create, synchronize, unregister) replicas.

cleanup_change_tracking(layers, retention_period, period_unit='days', min_server_gen=None, replica_id=None, future=False)

Change tracking information stored in each feature service layer (enabled for Change Tracking) might grow very large. The change tracking info used by the feature service to determine the change generation number and the features that have changed for a particular generation. Clients can purge the change tracking content if the changes are already synced-up to all clients and the changes are no longer needed.

Only the owner or the organization administrator can cleanup change tracking information.

Parameter

Description

layers

Required list. A list of layers and tables to include in the replica.

retention_period

Optional Integer. The retention period to use when cleaning up the change tracking information. Change tracking information will be cleaned up if they are older than the retention period.

period_unit

Optional String. The units of the retention period.

Values:

days, seconds, minutes, or hours

min_server_gen

Optional String. In addition to the retention period, the change tracking can be cleaned by its generation numbers. Older tracking information that has older generation number than the min_server_gen will be cleaned.

replica_id

Optional String. The change tracking can also be cleaned by the replica_id in addition to the retention_period and the min_server_gen.

future

Optional boolean. If True, a future object will be returned and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

Boolean or If future = True, then the result is a Future object. Call result() to get the response.

create(replica_name, layers, layer_queries=None, geometry_filter=None, replica_sr=None, transport_type='esriTransportTypeUrl', return_attachments=False, return_attachments_databy_url=False, asynchronous=False, attachments_sync_direction='none', sync_model='none', data_format='json', replica_options=None, wait=False, out_path=None, sync_direction=None, target_type='client', transformations=None, time_reference_unknown_client=None)

The create operation is performed on a FeatureLayerCollection resource. This operation creates the replica between the feature dataset and a client based on a client-supplied replica definition. It requires the Sync capability. See Sync overview for more information on sync. The response for create includes replicaID, replica generation number, and data similar to the response from the query() operation. The create operation returns a response of type esriReplicaResponseTypeData, as the response has data for the layers in the replica. If the operation is called to register existing data by using replicaOptions, the response type will be esriReplicaResponseTypeInfo, and the response will not contain data for the layers in the replica.

Parameter

Description

replica_name

Required string. Name of the replica.

layers

Required list. A list of layers and tables to include in the replica.

layer_queries

Optional dictionary. In addition to the layers and geometry parameters, the layer_queries parameter can be used to further define what is replicated. This parameter allows you to set properties on a per layer or per table basis. Only the properties for the layers and tables that you want changed from the default are required.

Example:

layer_queries = {“0”:{“queryOption”: “useFilter”, “useGeometry”: true,
“where”: “requires_inspection = Yes”}}

geometry_filter

Optional dictionary. Spatial filter from filters module to filter results by a spatial relationship with another geometry.

replica_sr

Optional WKID or a spatial reference JSON object. The spatial reference of the replica geometry.

transport_type

The transport_type represents the response format. If the transport_type is esriTransportTypeUrl, the JSON response is contained in a file, and the URL link to the file is returned. Otherwise, the JSON object is returned directly. The default is esriTransportTypeUrl. If async is true, the results will always be returned as if transport_type is esriTransportTypeUrl. If dataFormat is sqlite, the transportFormat will always be esriTransportTypeUrl regardless of how the parameter is set.

Values:

esriTransportTypeUrl | esriTransportTypeEmbedded.

return_attachments

If True, attachments are added to the replica and returned in the response. Otherwise, attachments are not included. The default is False. This parameter is only applicable if the feature service has attachments.

return_attachments_databy_url

If True, a reference to a URL will be provided for each attachment returned from create method. Otherwise, attachments are embedded in the response. The default is True. This parameter is only applicable if the feature service has attachments and if return_attachments is True.

asynchronous

If True, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. See the topic on asynchronous usage for more information. The default is False.

attachments_sync_direction

Client can specify the attachmentsSyncDirection when creating a replica. AttachmentsSyncDirection is currently a createReplica property and cannot be overridden during sync.

Values:

none, upload, bidirectional

sync_model

This parameter is used to indicate that the replica is being created for per-layer sync or per-replica sync. To determine which model types are supported by a service, query the supportsPerReplicaSync, supportsPerLayerSync, and supportsSyncModelNone properties of the Feature Service. By default, a replica is created for per-replica sync. If syncModel is perReplica, the syncDirection specified during sync applies to all layers in the replica. If the syncModel is perLayer, the syncDirection is defined on a layer-by-layer basis.

If sync_model is perReplica, the response will have replicaServerGen. A perReplica sync_model requires the replicaServerGen on sync. The replicaServerGen tells the server the point in time from which to send back changes. If sync_model is perLayer, the response will include an array of server generation numbers for the layers in layerServerGens. A perLayer sync model requires the layerServerGens on sync. The layerServerGens tell the server the point in time from which to send back changes for a specific layer. sync_model=none can be used to export the data without creating a replica. Query the supportsSyncModelNone property of the feature service to see if this model type is supported.

See the RollbackOnFailure and Sync Models topic for more details.

Values:

perReplica | perLayer | none

Example:

sync_model = perLayer

data_format

The format of the replica geodatabase returned in the response. The default is json.

Values:

filegdb, json, sqlite, shapefile

replica_options

This parameter instructs the create operation to create a new replica based on an existing replica definition (refReplicaId). It can be used to specify parameters for registration of existing data for sync. The operation will create a replica but will not return data. The responseType returned in the create response will be esriReplicaResponseTypeInfo.

wait

If async, wait to pause the process until the async operation is completed.

out_path

out_path - folder path to save the file.

sync_direction

Defaults to bidirectional when the targetType is client and download when the target_type is server. If set, only bidirectional is supported when target_type is client. If set, only upload or download are supported when target_type is server.

Values:

download | upload | bidirectional

Example:

sync_direction=download

target_type

Can be set to either server or client. If not set, the default is client. This option was added at 10.5.1.

transformations

Optional List. Introduced at 10.8. This parameter applies a datum transformation on each layer when the spatial reference used in geometry is different from the layer’s spatial reference.

time_reference_unknown_client

Setting time_reference_unknown_client as true indicates that the client is capable of working with data values that are not in UTC. If its not set to true, and the service layer’s datesInUnknownTimeZone property is true, then an error is returned. The default is false

It’s possible to define a service’s time zone of date fields as unknown. Setting the time zone as unknown means that date values will be returned as-is from the database, rather than as date values in UTC. Non-hosted feature services can be set to use an unknown time zone using ArcGIS Server Manager. Setting the time zones to unknown also sets the datesInUnknownTimeZone layer property as true. Currently, hosted feature services do not support this setting. This setting does not apply to editor tracking date fields which are stored and returned in UTC even when the time zone is set to unknown.

Most clients released prior to ArcGIS Enterprise 10.9 will not be able to work with feature services that have an unknown time setting. The timeReferenceUnknownClient parameter prevents these clients from working with the service in order to avoid problems.. Setting this parameter to true indicates that the client is capable of working with unknown date values that are not in UTC.

Returns

JSON response if POST request made successfully. Otherwise, return None.

create_replica_item(replica_name, item, destination_gis, layers=None, extent=None)

Creates a replicated service from a parent to another GIS.

Parameter

Description

replica_name

Optional string. Name for replicated item in other GIS

item

Required Item to replicate

destination_gis

Required GIS object

layers

Optional list. Layers to replicate in the item

extent

Optional dict. Depicts the geometry extent for an item.

Returns

The published replica item created

get(replica_id)

Parameter

Description

replica_id

Required string. replica_id returned by the feature service when the replica was created.

Returns

The replica information

get_list()

returns all the replicas for the feature layer collection

sync_replicated_items(parent, child, replica_name)

Synchronizes two replicated items between portals

Parameter

Description

parent

Required Item that points to the feature service that is the parent dataset. (source)

child

Required Item that points to the feature service that is the child dataset. (target)

replica_name

Required string. Name of either parent or child Item

Result

Boolean value. True means service is up to date/synchronized, False means the synchronization failed.

synchronize(replica_id, transport_type='esriTransportTypeUrl', replica_server_gen=None, return_ids_for_adds=False, edits=None, return_attachment_databy_url=False, asynchronous=False, sync_direction='snapshot', sync_layers='perReplica', edits_upload_id=None, edits_upload_format=None, data_format='json', rollback_on_failure=True)

synchronizes replica with feature layer collection See Synchronize Replica

unregister(replica_id)

unregisters a replica from a feature layer collection

Parameter

Description

replica_id

The replicaID returned by the feature service when the replica was created.

FeatureLayerCollectionManager

class arcgis.features.managers.FeatureLayerCollectionManager(url, gis=None, fs=None)

Allows updating the definition (if access permits) of a FeatureLayerCollection. This class is not created by users directly. An instance of this class, called ‘manager’, is available as a property of the FeatureLayerCollection object.

Users call methods on this ‘manager’ object to manage the feature layer collection.

add_to_definition(json_dict, future=False)

The add_to_definition operation supports adding a definition property to a hosted feature layer collection service. The result of this operation is a response indicating success or failure with error code and description.

This function will allow users to change or add additional values to an already published service.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object.

future

Optional, If True, a future object will be returns and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON message as dictionary when future=False else If future = True, then the result is a Future object. Call result() to get the response.

create_view(name, spatial_reference=None, extent=None, allow_schema_changes=True, updateable=True, capabilities='Query', view_layers=None, view_tables=None, *, description=None, tags=None, snippet=None, overwrite=None, set_item_id=None, preserve_layer_ids=False)

Creates a view of an existing feature service. You can create a view, if you need a different view of the data represented by a hosted feature layer, for example, you want to apply different editor settings, apply different styles or filters, define which features or fields are available, or share the data to different groups than the hosted feature layer create a hosted feature layer view of that hosted feature layer.

When you create a feature layer view, a new hosted feature layer item is added to Content. This new layer is a view of the data in the hosted feature layer, which means updates made to the data appear in the hosted feature layer and all of its hosted feature layer views. However, since the view is a separate layer, you can change properties and settings on this item separately from the hosted feature layer from which it is created.

For example, you can allow members of your organization to edit the hosted feature layer but share a read-only feature layer view with the public.

To learn more about views visit: https://doc.arcgis.com/en/arcgis-online/share-maps/create-hosted-views.htm

Parameter

Description

name

Required string. Name of the new view item

spatial_reference

Optional dict. Specify the spatial reference of the view

extent

Optional dict. Specify the extent of the view

allow_schema_changes

Optional bool. Default is True. Determines if a view can alter a service’s schema.

updateable

Optional bool. Default is True. Determines if view can update values

capabilities

Optional string. Specify capabilities as a comma separated string. For example “Query, Update, Delete”. Default is ‘Query’.

view_layers

Optional list. Specify list of layers present in the FeatureLayerCollection that you want in the view.

view_tables

Optional list. Specify list of tables present in the FeatureLayerCollection that you want in the view.

description

Optional String. A user-friendly description for the published dataset.

tags

Optional String. The comma separated string of descriptive words.

snippet

Optional String. A short description of the view item.

overwrite

Optional Boolean. If true, the view is overwritten, False is the default.

set_item_id

Optional String. If set, the ItemId is defined by the user, not the system.

preserve_layer_ids

Optional Boolean. Preserves the layer’s id on it’s definition when True. The default is False.

Returns

Returns the newly created Item for the view.

delete_from_definition(json_dict, future=False)

The delete_from_definition operation supports deleting a definition property from a hosted feature layer collection service. The result of this operation is a response indicating success or failure with error code and description. See Delete From Definition (Feature Service) for additional information on this function.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object.

future

Optional boolean. If True, a future object will be returns and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON message as dictionary when future=False else If future = True, then the result is a Future object. Call result() to get the response.

classmethod fromitem(item)

The fromitem method is used to create a FeatureLayerCollection from a Item class.

Parameter

Description

item

A required Item object. The item needed to convert to a FeatureLayerCollection object.

Returns

A FeatureLayerCollection object.

property generate_service_definition

Returns a dictionary can be used for service generation.

Returns

dict or None (if not supported on the service)

insert_layer(data_path, name=None)

This method will create a feature layer or table and insert it into the existing feature service. If your data path will publish more than one layer or table, only the first will be added.

Argument

Description

data_path

Required string. The path to the data to be inserted.

Note

Shapefiles and file geodatabases must be in a .zip file.

name

Optional string. The name of the layer or table to be created.

property layers

Returns a list of FeatureLayerManager to work with FeatureLayers

Returns

List[FeatureLayerManager]

overwrite(data_file)

Overwrite all the features and layers in a hosted feature layer collection service. This operation removes all features but retains the properties (such as metadata, itemID) and capabilities configured on the service. There are some limits to using this operation:

  1. Only hosted feature layer collection services can be overwritten

  2. The original data used to publish this layer should be available on the portal

  3. The data file used to overwrite should be of the same format and filename as the original that was used to publish the layer

  4. The schema (column names, column data types) of the data_file should be the same as original. You can have additional or fewer rows (features).

In addition to overwriting the features, this operation also updates the data of the item used to published this layer.

Parameter

Description

data

Required string. Path to the file used to overwrite the hosted feature layer collection.

Returns

JSON message as dictionary such as {‘success’:True} or {‘error’:’error message’}

property properties

The properties property retrieves and set properties of this object.

refresh()

refreshes a feature layer collection

property tables

Returns a list of FeatureLayerManager to work with tables

Returns

List[FeatureLayerManager]

update_definition(json_dict, future=False)

The update_definition operation supports updating a definition property in a hosted feature layer collection service. The result of this operation is a response indicating success or failure with error code and description.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object.

future

Optional boolean. If True, a future object will be returns and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON message as dictionary when future=False when future=True, Future object is returned. Call result() to get the response.

property webhook_manager
Returns

WebHookServiceManager

FeatureLayerManager

class arcgis.features.managers.FeatureLayerManager(url, gis=None)

Allows updating the definition (if access permits) of a FeatureLayer. This class is not created by users directly. An instance of this class, called ‘manager’, is available as a property of the FeatureLayer object, if the layer can be managed by the user. Users call methods on this ‘manager’ object to manage the feature layer.

add_to_definition(json_dict, future=False)

The addToDefinition operation supports adding a definition property to a hosted feature layer.

This function will allow users to change add additional values to an already published service.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object.

future

Optional boolean. If True, a future object will be returned and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON message as dictionary indicating ‘success’ or ‘error’. If future = True, then the result is a Future object. Call result() to get the response.

property contingent_values

returns the contingent values for the service endpoint

delete_from_definition(json_dict, future=False)

The deleteFromDefinition operation supports deleting a definition property from a hosted feature layer. The result of this operation is a response indicating success or failure with error code and description. See: Delete From Definition (Feature Service) for additional information on this function.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object. Only include the items you want to remove from the FeatureService or layer.

future

Optional, If True, a future object will be returns and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON Message as dictionary indicating ‘success’ or ‘error’. If future = True, then the result is a Future object. Call result() to get the response.

property field_groups

returns the field groups for the service endpoint

classmethod fromitem(item, layer_id=0)

Creates a FeatureLayerManager object from a GIS Item.

Parameter

Description

item

Required of type FeatureService that represents a FeatureLayerCollection .

layer_id

Required int. Id of the layer in the FeatureLayerCollection

Returns

FeatureLayer created from the layer provided.

property properties

The properties property retrieves and set properties of this object.

refresh()

refreshes a service

truncate(attachment_only=False, asynchronous=False, wait=True)

The truncate operation supports deleting all features or attachments in a hosted feature service layer. The result of this operation is a response indicating success or failure with error code and description. See Truncate (Feature Layer) for additional information on this method.

Note

The truncate method is restricted to layers that:

  • do not serve as the origin in a relationship with other layers

  • do not reference the same underlying database tables that are referenced by other layers (for example, if the layer was published from a layer with a definition query and a separate layer has also been published from that source)

  • do not have sync enabled

Parameter

Description

attachment_only

Optional boolean. If True, deletes all the attachments for this layer. None of the layer features will be deleted.

asynchronous

Optional boolean. If True, supports asynchronous processing. The default is False. It is recommended to set asynchronous=True for large datasets.

wait

Optional boolean. If True, then wait to pause the process until asynchronous operation is completed. Default is True.

Returns

JSON Message as dictionary indicating success or error

update_definition(json_dict, future=False)

The update_definition operation supports updating a definition property in a hosted feature layer. The result of this operation is a response indicating success or failure with error code and description.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The format can be derived from the properties property. For layer level modifications, run updates on each individual feature service layer object.

future

Optional, If True, a future object will be returns and the process will not wait for the task to complete. The default is False, which means wait for results.

Returns

JSON Message as dictionary indicating ‘success’ or ‘error’. If future = True, then the result is a Future object. Call result() to get the response.

VersionManager

class arcgis.features._version.VersionManager(url, gis, flc=None)

VersionManager allows users to manage the branch versioning for FeatureLayerCollection services. The Version Management Service is responsible for exposing the management capabilities necessary to support feature services that work with branch versioned datasets.

See the Version Management Service for more information

Parameter

Description

url

Required String. The URI to the web resource.

gis

Required GIS . The enterprise connection to the Portal site. A connection can be passed in such as a Service Directory connection.

flc

Optional FeatureLayerCollection . This is the parent container that the branch versioning is enabled on.

property all

returns all visible versions on a service

create(name, permission='public', description='')

Create the named version off of DEFAULT. The version is associated with the specified feature service. During creation, the description and access (default is public) may be optionally set.

Parameter

Description

name

Required String. The name of the version

permission

Optional String. The access permissions of the new version. The default access permission is public.

Values:

“private” | “public” | “protected” | “hidden”

description

Optional String. The description of the new version

Returns

Dictionary with Version Information

get(version, mode=None)

Finds and Locations a Version by it’s name

Parameter

Description

version

Required String. This is the name of the version to locate.

mode

Optional String. This allows users to get a version in a specific state of edit or read. If None is provided (default) the version is created without entering a mode.

Values:

  • edit - starts editing mode

  • read - starts reading mode

  • None - no mode is started. This is default.

property locks

For the specified feature service, return the versions which are locked.

Returns

List of locked versions

property properties

returns the service properties

purge(version, owner=None)

Removes a lock from a version

Parameter

Description

version

Required String. The name of the version that is locked.

owner

Required String. The owner of the lock. (Deprecated)

Returns

Boolean. True if successful else False.

search(owner=None, show_hidden=False)

For the specified feature service, return the info of all versions that the client has access to. If the client is the service owner (the user that published the service), all versions are accessible and will be returned.

Parameter

Description

owner

Optional String. A filter the versions by the owner.

show_hidden

Optional Boolean. If False (default) hidden versions will not be returned.

Returns

Dictionary indication ‘success’ or ‘error’

Version

class arcgis.features._version.Version(url, flc=None, gis=None, session_guid=None, mode=None)

A Version represents a single branch in the version tree.

Parameter

Description

url

Required String. The URI to the web resource.

gis

Required GIS . The enterprise connection to the Portal site.

flc

Optional FeatureLayerCollection . This is the parent container that the branch versioning is enabled on.

session_guid

Optional String. If a GUID is known for specific version, a user can specify it.

mode

Optional String. If a user wants to start either editing or reading on creation of the Version, it can be specified here. This is useful when a user is using the Version with a with statement.

Allowed Values:

  • edit - starts an edit session

  • read - starts a read session

alter(owner=None, version=None, description=None, permission=None)

The alter operation changes the geodatabase version’s name, description, and access permissions.

Parameter

Description

owner

Optional String. The new name of the owner.

version

Optional String. The new name of the version.

permission

Optional String. The new access level of the version.

Values:

“private” | “public” | “protected” | “hidden”

description

Optional String. The description of the new version

Returns

Boolean. True if successful else False.

conflicts()

The conflicts operation allows you to view the conflicts by layer and type (update-update, update-delete, delete-update) that were identified during the last Reconcile operation. The features that are in conflicts will also be returned as they existed in the branch, ancestor, and default versions.

delete()

Deletes the current version

Returns

Boolean. True if successful else False.

delete_forward_edits(moment)

If the input moment does not match a specific moment (a moment corresponding to an edit operation), the call will return an error. The client app must correctly manage the edit session’s edit operations moments (for example, the undo/redo stack) and not blindly pass in a timestamp that could mistakenly delete all the forward moments. Thus, the input moment must be equal to a moment in which an edit operation for the version was applied. The call will also fail if the session does not have a write lock on the version.

Parameter

Description

moment

Required String. Moment representing the new tail of the version; all forward moments will be trimmed.

Returns

Boolean. True if successful else False.

differences(result_type='objectIds', moment=None, from_moment=None, layers=None, future=False)

The differences operation allows you to view differences between the current version and the default version. The two versions can be compared to check for the following conditions.

  • Inserts - features that are present in the current version but not the default version

  • Updates - features that have different attributes or geometry in the current version than the default version

  • Deletions - features that are present in the default version but not in the current version

Both differences and conflicts will be returned. It is the clients’ responsibility to determine which are differences, and which are conflicts.

Parameter

Description

result_type

Required String. Determines the type of results to return. The default result type is objectIds.

Values :

“objectIds” | “features”

moment

Required String. Moment used to compare current version with default.

from_moment

Optional string. Time epoch value in milliseconds specifying the time from which to obtain the differences between this value and the specified moment argument value.

Note

  • By default, if this parameter is not specified, the differences operation returns the edits (inserts, updates, and deletes) at the specified value of the moment argument.

  • This parameter is only supported on the default version. For a named branch, this parameter will return an error if specified. The common ancestor moment is automatically used.

  • This parameter was introduced at ArcGIS Enterprise 10.9

layers

Optional list. The layer id values for which differences should be returned. If not specified, the differences for all layers will be returned.

future

Optional boolean. If True, the method runs as an asynchronous job returning a _URL_ value to inspect the status of the job. The default value is False.

Returns

Dictionary with a differences key indicating the various inserts, updates, or deletes for each layer.

edit(layer, adds=None, updates=None, deletes=None, use_global_ids=False, rollback_on_failure=True)

The edit operation allows users to apply changes to the current version. The edit session must be in the mode of edit or an exception will be raised.

Inputs

Description

layer

Required FeatureLayer . The layer to perform the edit on.

adds

Optional FeatureSet /List. The array of features to be added.

updates

Optional FeatureSet /List. The array of features to be updated.

deletes

Optional FeatureSet /List. String of OIDs to remove from service

use_global_ids

Optional boolean. Instead of referencing the default Object ID field, the service will look at a GUID field to track changes. This means the GUIDs will be passed instead of OIDs for delete, update or add features.

rollback_on_failure

Optional boolean. Optional parameter to specify if the edits should be applied only if all submitted edits succeed. If false, the server will apply the edits that succeed even if some of the submitted edits fail. If true, the server will apply the edits only if all edits succeed. The default value is true.

Returns

Dictionary

inspect(conflicts, inspect_all=False, set_inspected=False)

The inspect operation allows the client to annotate conflicts from the conflict set that was obtained during the last reconcile operation. Users can mark the conflicts as being inspected; additionally, a description or note can be associated with the conflict.

Parameter

Description

conflicts

Required List. The conflicts that are being inspected (removed) from the conflict set.

Parameter Format:

[{
“layerId” : <layerId>,
“features” : [{
“objectId” : <objectId>,
“note” : string
}]}]

The objectId key is required. The note parameter is optional.

inspect_all

Optional Boolean. This parameter, if true, will mark all conflicts as being inspected.

set_inspected

Optional Boolean. If True, the examined values will be set to inspected. If inspect_all is True, this parameter is ignored.

Returns

Boolean. True if successful else False.

property layers

returns the layers in the FeatureLayerCollection

property mode

The mode allows version editors to start and stop edit, read, or view mode.

Parameter

Description

value

Required string.

Values:

  • edit - calls the start_editing method and creates a lock

  • read - calls the start_reading method and creates a lock

  • None - terminates all sessions and lets a user view the version information (default)

property parcel_fabric

Provides access to a parcel fabric manager

Returns

ParcelFabricManager

post(rows=None, future=False)

The Post operation allows the client to post the changes in their branch to the default version. The client can only post changes if the branch version has not been modified since the last reconcile. If the default version has been modified in the interim, the client will have to reconcile again before posting.

Parameter

Description

rows

Optional List of dictionaries representing the features or objects for posting a subset of edits in the current version. The objectIds specified must be edits contained within the current version, which can be obtained from the differences() method. The posted edits will no longer exist in the current version, another reconcile() is necessary to see the posted features.

rows = [
        {"layerId": 0,
         "objectIds": [14,15,17,20]
        },
        {"layerId": 1},
         "objectIds": [123]
        }
       ]

future

Optional Boolean. If “True”, the operation runs as an asynchronous job. The results are returned as a Url pointing to a location that indicates the status of the job.

Returns

Boolean. True or a job URL if successful, else False.

property properties

returns the service properties

reconcile(end_with_conflict=False, with_post=False, conflict_detection='byObject', future=False)

Reconcile a version against the DEFAULT version. The reconcile operation requires that you are the only user currently editing the version and the only user able to edit the version throughout the reconcile process until you save or post. The reconcile operation requires that you have full permissions to all the feature classes that have been modified in the version being edited. The reconcile operation detects differences between the branch version and the default version and flags these differences as conflicts. If conflicts exist, they should be resolved.

Parameter

Description

end_with_conflict

Optional Boolean. Specifies if the reconcile should abort when conflicts are found. The default is False

with_post

Optional Boolean. If True the with_post causes a post of the current version following the reconcile.

conflict_detection

Optional String. Specify whether the conditions required for conflicts to occur are defined by object (row) or attribute (column).

The default is byObject.

Note

This parameter was introduced at ArcGIS Enterprise 10.9

Values:

byObject | byAttribute

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

Note

This parameter was introduced at ArcGIS Enterprise 10.9.1

The default is False.

Returns

Boolean.

If future = True, then the result is a Future object. Call result() to get the response.

restore(rows)

The restore method allows users to restore rows from a common ancestor version. This method is intended to be used when a DeleteUpdate conflicts are identified during the last reconcile.

Parameter

Description

rows

Required List. An array of the rows to be restored

Syntax

[{
“layerId”: <layerId>,
“objectIds”:[<objectId>]
}]
Returns

Boolean and String. Bool: True if successful else False. String: the moment

property save_edits

Get/Set the Property to Save the Changes.

Parameter

Description

value

Required bool. Values:

True | False

When set to true, any edits performed on the version will be saved.

start_editing()

Starts an edit session for the current user.

Returns

Boolean. True if successful else False.

start_reading()

Start reading represents a long-term service session. When start_reading is enabled, it will prevent other users from editing or reconciling the version.

Returns

Boolean. True if successful else False.

stop_editing(save=None)

Starts an edit session for the current user.

Parameter

Description

save

Optional Boolean. States if the values should be saved. If the value is set, it will override the save_edits property.

Returns

Boolean. True if successful else False.

stop_reading()

Stops and releases a reading session.

Returns

Boolean. True if successful else False.

property tables

returns the tables in the FeatureLayerCollection

property utility

provides access to the utility service manager

property validation

Provides access to a validation manager.

Returns

ValidationManager

ParcelFabricManager

class arcgis.features._parcel.ParcelFabricManager(url, gis, version, flc)

The Parcel Fabric Server is responsible for exposing parcel management capabilities to support a variety of workflows from different clients and systems.

Parameter

Description

url

Required String. The URI to the service endpoint.

gis

Required GIS. The enterprise connection.

version

Required Version. This is the version object where the modification will occur.

flc

Required FeatureLayerCollection . This is the parent container for ParcelFabricManager.

analyze_least_squares_adjustment(analysis_type='CONSISTENCY_CHECK', convergence_tolerance=0.05, parcel_features=None, future=False)

Note

Least Squares Adjustment functionality introduced at version 10.8.1

Analyzes the parcel fabric measurement network by running a least squares adjustment on the input parcels. A least-squares adjustment is a mathematical procedure that uses statistical analysis to estimate the most likely coordinates for connected points in a measurement network.

Use apply_least_squares_adjustment() to apply the results of a least squares adjustment to parcel fabric feature classes.

Parameter

Description

analysis_type

Optional string. Represents the type of least squares analysis that will be run on the input parcels.

  • CONSISTENCY_CHECK - A free-network least-squares adjustment will be run to check dimensions on parcel lines for inconsistencies and mistakes. Fixed or weighted control points will not be used by the adjustment.

  • WEIGHTED_LEAST_SQUARES - A weighted least-squares adjustment will be run to compute updated coordinates for parcel points. The parcels being adjusted should connect to at least two fixed or weighted control points.

The default value is CONSISTENCY_CHECK.

convergence_tolerance

Optional float. Represents the maximum coordinate shift expected after iterating the least squares adjustment. A least squares adjustment is run repeatedly (in iterations) until the solution converges. The solution is considered converged when maximum coordinate shift encountered becomes less than the specified convergence tolerance.

The default value is 0.05 meters or 0.164 feet.

parcel_features

Optional list. Represents the input parcels that will be analyzed by a least squares adjustment.

Syntax

>>> parcel_features = [{"id":"<guid>","layerId":"<layerID>"},{...}]

If None, the method will analyze the entire parcel fabric.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean. True if successful else False

apply_least_squares_adjustment(movement_tolerance=0.05, update_attributes=True, future=False)

Note

Least Squares Adjustment functionality introduced at version 10.8.1

Applies the results of a least squares adjustment to parcel fabric feature classes. Least squares adjustment results stored in the AdjustmentLines and AdjustmentPoints feature classes are applied to the corresponding parcel line, connection line, and parcel fabric point feature classes.

Use analyze_least_squares_adjustment() to run a least-squares analysis on parcels and store the results in adjustment feature classes.

Parameter

Description

movement_tolerance

Optional float. Represents the minimum allowable coordinate shift when updating parcel fabric points. If the distance between the adjustment point and the parcel fabric point is greater than the specified tolerance, the parcel fabric point is updated to the location of the adjustment point.

The default tolerance is 0.05 meters or 0.164 feet.

update_attributes

Optional boolean. Specifies whether attribute fields in the parcel fabric Points feature class will be updated with statistical metadata. The XY Uncertainty, Error Ellipse Semi Major, Error Ellipse Semi Minor, and Error Ellipse Direction fields will be updated with the values stored in the same fields in the AdjustmentPoints feature class.

The default is True

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean. True if successful else False

assign_to_record(features, record, write_attribute, moment=None, future=False)

Assigns the specified parcel features to the specified record. If parcel polygons are assigned, the record polygon will be updated to match the cumulative geometry of all the parcels associated to it. The Created By Record or Retired By Record attribute field of the parcel features is updated with the global ID of the assigned record.

Parameter

Description

features

Required List. The parcel features to assign to the specified record. Can be parcels, parcel polygons, parcel points, and parcel lines.

Syntax

>>> features=[{"id":"<guid>","layerId":"<layerID>"},{...}]

record

Required String. The record that will be assigned to the specified parcel features.

write_attribute

Required String. Represents the record field to update on the parcel features. Either the Created By Record or Retired By Record field is to be updated with the global ID of the assigned record.

Allowed Values:

CreatedByRecord or RetiredByRecord

moment

Optional Integer. This should only be specified by the client when they do not want to use the current moment

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean. True if successful otherwise False

build(extent=None, moment=None, return_errors=False, record=None, future=False)

A build will fix known parcel fabric errors.

For example, if a parcel polygon exists without lines, then build will construct the missing lines. If lines are missing, the polygon row(s) are created. When constructing this objects, build will attribute the related keys as appropriate. Build also maintains lineage and record features. The parcel fabric must have sufficient information for build to work correctly. Ie, source reference document, and connected lines.

Build provides options to increase performance. The process can just work on specific parcels, geometry types or only respond to parcel point movement in the case of an adjustment.

Parameter

Description

extent

Optional Envelope . The extent to build.

Syntax

>>> extent={
            "xmin":X min,
            "ymin": y min,
            "xmax": x max,
            "ymax": y max,
            "spatialReference": {"wkid": <wkid_value>}
           }

moment

Optional String. This should only be specified by the client when they do not want to use the current moment

return_errors

Optional Boolean. If True, a verbose response will be given if errors occured. The default is False. Deprecated

record

Optional String. Represents the record identifier (guid). If a record guid is provided, only parcels associated to the record are built, regardless of the build extent.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean. True if successful else False

change_type(parcels, target_type, parcel_subtype=0, moment=None, future=False)

Changes a set of parcels to a new parcel type. It creates new polygons and lines and deletes them from the source type. This is used when a parcel was associated in the wrong parcel type subtype and/or when creating multiple parcels as part of a build process. Example: when lot parcels are created as part of a subdivision, the road parcel is moved to the encumbrance (easement) parcel type.

Parameter

Description

parcels

Required List. Parcels list that will change type

target_type

Required String. The target parcel layer

target_subtype

Optional Integer. Target parcel subtype. The default is 0 meaning no subtype required.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean. True if successful else False

clip(parent_parcels, clip_record=None, clipping_parcels=None, geometry=None, moment=None, option=None, area_unit=None, future=False)

Clip cuts a new child parcel into existing parent parcels. Commonly it retires the parent parcel(s) it cuts into to generate a reminder child parcel. This type of split is often part of a parcel split metes and bounds record driven workflow.

Parameter

Description

parent_parcels

parent parcels that will be clipped into.

Syntax

>>> parent_parcels= <parcel (guid)+layer (name)...>

clip_record

Optional String. It is the GUID for the active legal record.

clipping_parcels

Optional List. A list of child parcels that will be used to clip into the parent parcels. Parcel lineage is created if the child ‘clipping_parcels’ and the parcels being clipped are of the same parcel type.

Syntax

clipping_parcels= <"id" : "parcel guid", "layerId": "<layer id>"...>

# Example:
>>> clipping_parcels = [{"id":"{D01D3F47-5FE2-4E39-8C07-E356B46DBC78}","layerId":"16"}]

Note

Either clipping_parcels or geometry is required.

geometry

Optional Polygon. Allows for the clipping a parcel based on geometry instead of ‘clipping_parcels’ geometry. No parcel lineage is created.

Note

Either clipping_parcels or geometry is required.

moment

Optional String. This should only be specified by the client when they do not want to use the current moment

option

Optional String. Represents the type of clip to perform:

  • PreserveArea - Preserve the areas that intersect and discard the remainder areas. (default)

  • DiscardArea - Discard the areas that intersect and preserve the remainder areas.

  • PreserveBothAreasSplit - Preserve both the intersecting and remainder areas.

area_unit

Optional String. Area units to be used when calculating the stated areas of the clipped parcels. The stated area of the clipped parcels will be calculated if the stated areas exist on the parent parcels being clipped.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

copy_lines_to_parcel_type(parent_parcels, record, target_type, moment=None, mark_historic=False, use_source_attributes=False, attribute_overrides=None, use_polygon_attributes=False, parcel_subtype=None, future=False)

Copy lines to parcel type is used when the construction of the child parcel is based on parent parcel geometry. It creates a copy of the parent parcels lines that the user can modify (insert, delete, update) before they build the child parcels. If the source parcel type and the target parcel type are identical (common) parcel lineage is created.

Parameter

Description

parent_parcels

Required String. Parcel parcels from which lines are copied.

record

Required String. The unique identifier (guid) of the active legal record.

target_type

Required String. The target parcel layer to which the lines will be copied to.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

mark_historic

Optional Boolean. Mark the parent parcels historic. The default is False.

use_source_attributes

Optional Boolean. If the source and the target line schema match, attributes from the parent parcel lines will be copied to the new child parcel lines when it is set to True. The default is False.

use_polygon_attributes

Optional Boolean. Parameter representing whether to preserve and transfer attributes of the parent parcels to the generated seeds.

attribute_overrides

Optional Dictionary. To set fields on the child parcel lines with a specific value. Uses a key/value pair of FieldName/Value.

Syntax:

>>> attributeOverrides = [{"type": "PropertySet",
                           "propertySetItems": [
                                                <field name>,
                                                <field value>
                                               ]
                         }]

parcel_subtype

Optional Integer. Represents the target parcel subtype.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

create_seeds(record, moment=None, extent=None, future=False)

Create seeds creates parcel seeds for closed loops of lines that are associated with the specified record.

When building parcels from lines, parcel seeds are used. A parcel seed is the initial state or seed state of a parcel. A parcel seed indicates to the build process that a parcel can be built from the lines enclosing the seed.

A parcel seed is a minimized polygon feature and is stored in the parcel type polygon feature class.

Parameter

Description

record

Required String. A GUID representing the record that will be assigned to the features set as current or historic.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

extent

Optional Dict/ Envelope . The envelope of the extent in which to create seeds.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

delete(parcels, moment=None, future=False)

Delete a set of parcels, removing associated or unused lines, and connected points.

Parameter

Description

parcels

Required List. The parcels to erase.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

divide(divide_parcel_guid, divide_parcel_type, divide_record, divide_option, divide_number_of_parts, divide_part_area, divide_line_bearing, divide_left_side, divide_distribute_remainder, default_area_unit=None, divide_cogo_line_bearing=None, future=False)

Note

Divide functionality introduced at version 10.9.1

Divide a polygon feature into multiple features that have proportional or equal areas, or equal widths.

Parameter

Description

divide_parcel_guid

Required String. Parameter for the unique identifier guid of the parcel being divided.

divide_parcel_type

Required Integer. Parameter representing the parcel type layer ID in which the new, divided parcels will be created.

divide_record

Required String. Parameter for the unique identifier guid of the record being used for the divide. If missing, no parcel history is created.

divide_option

Required String. The type of division to be performed.

  • ProportionalArea

  • EqualArea

  • EqualWidth

divide_number_of_parts

Required Integer. The number parts into which the parcel will be divided.

divide_part_area

Required Float. Area (or width) of each part (parcel fabric GDB units squared).

Note

This value is ignored when dividing by proportional area. A default value of 0 will be applied.

divide_line_bearing

Required Float. The direction (in decimal degrees) of the line used to divide the parcel.

divide_left_side

Required Boolean. Parameter indicating if area being divided is starting from the leftmost edge of the parcel. Any remainder area will be to the right of the divided parts. If False, the area being divided starts from the rightmost edge of the parcel and any remainder area will be to the left of the divided parts.

This parameter is required for the EqualArea and EqualWidth divide options.

Note

This value is ignored when dividing by proportional area. A default value of False will be applied.

divide_distribute_remainder

Required Boolean. Indicates whether to distribute or merge the remainder area after the divide is performed. This parameter is used for the EqualArea and EqualWidth divide options.

Note

This value is ignored when dividing by proportional area. A default value of False will be applied.

default_area_unit

Required Integer. The units in which area will be stored. The parameter is specified as a domain code from the PF_AreaUnits parcel fabric domain.

#Example Usage:

#Square feet
>>> default_area_unit=109405
#Square meters
>>> default_area_unit=109404

divide_cogo_line_bearing

Optional Float. Parameter representing the COGO direction (in decimal degrees) that will be stored in the COGO Direction field of the dividing lines.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

duplicate(parcels, parcel_type, record, parcel_subtype=None, repeat_count=None, update_field=None, start_value=None, increment_value=None, moment=None, future=False)

duplicate allows for the cloning of parcels from a specific record.

Parcels can be duplicated in the following ways:

  • Duplicate to a different parcel type.

  • Duplicate to a different subtype in the same parcel type.

  • Duplicate to a different subtype in a different parcel type.

Similarly, parcel seeds can be duplicated to subtypes and different parcel types.

Parameter

Description

parcels

Required List. A list of parcels to duplicate.

Syntax

>>>> parcels=[
              {"id":"<parcelguid>",
               "layerId":"16"
              },
              {...}
             ]

parcel_type

Required Integer. The target parcel type.

record

Required String. A GUID representing the record that will be assigned to the features set as current or historic.

parcel_subtype

Optional Integer. The target parcel subtype. The default is 0.

repeat_count

Optional Integer. How many times to duplicate the target parcels

update_field

Optional String. Which incrementable field to update on the target

start_value

Optional Integer. What value to start on when incrementing

increment_value

Optional Integer. How many steps to increment

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

property layer

returns the Parcel Layer ( FeatureLayer object or None ) for the service

merge(parent_parcels, target_parcel_type, attribute_overrides=None, child_name=None, default_area_unit=None, merge_record=None, merge_into=None, moment=None, future=False)

Merge combines 2 or more parent parcels into onenew child parcel. Merge sums up legal areas of parent parcels to the new child parcel legal area (using default area units as dictated by client). The child parcel lines arecomposed from the outer boundaries of the parent parcels. Merge can create multipart parcels as well as proportion lines (partial overlap of parent parcels). Record footprint is updated to match the child parcel.

Parameter

Description

parent_parcels

Required String. It is the parcel(guid)+layer(name) identifiers to merge.

target_parcel_type

Required String. Layer where parcel is merged to. History is created when parents and child are of the same parcel type

attribute_overrides

Optional List. A list of attributes to set on the child parcel, if they exist. Pairs of field name and value.

Syntax

>>> attribute_overrides = [
                          {
                           "type": "PropertySet",
                           "propertySetItems": [
                                                <field name>,
                                                <field value>
                                               ]
                          }
                         ]

Note

To set subtype, include subtype value in this list.

child_name

Optional String. A descript of the child layer. DEPRECATED

default_area_unit

Optional String. The area units of the child parcel.

merge_record

Optional String. Record identifier (guid). If missing, no history is created.

merge_into

Optional String. A parcel identifier (guid). Invalid to have a record id.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

area_unit

Optional Integer. Represents the default area units to be used when calculating the stated area of the merged parcel. The stated area of the merged parcel will be calculated if the stated areas exist on the parcels being merged.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

property properties

returns the properties of the service

reassign_features_to_record(source_record, target_record, delete_source_record, future=False)

Reassigns all parcel features in the specified source record to the specified target record. The source record will become empty and will be associated to no parcel features. The record polygon of the target record will be updated to match the cumulative geometry of all the parcels associated to it.

The Created By Record or Retired By Record attribute field of the parcel features is updated with the global ID of the assigned record.

Parameter

Description

source_record

Required String. GlobalID representing the record containing the parcel features to be reassigned.

Syntax:

source_record=<guid>

target_record

Required String. GlobalID representing the target record to which the parcel features will be reassigned.

Syntax

target_record=<guid>

delete_source_record

Required Bool. Parameter indicating whether to delete the original source record.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Boolean

reconstruct_from_seeds(extent, future=False)

This operation constructs parcels from seeds enclosed by parcel lines in the specified extent. The tool reconstructs parcels regardless of the parcel lines associations with records.

Parameter

Description

extent

Parameter representing the envelope of the extent to reconstruct seeds. Seeds that lie within the specified extent will be reconstructed into parcels.

Syntax

>>> extent={
            "xmin":X min,
            "ymin": y min,
            "xmax": x max,
            "ymax": y max,
            "spatialReference": {"wkid": <wkid_value>}
           }

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

set_line_label_position(parcel_line_features, future=False)

The set_line_label_position() sets the label position of the line’s COGO dimension to the left of the parcel line, to the right of the parcel line, or centered over the parcel line.

Parameter

Description

parcel_line_features

Required List. Parameter representing the input parcel line layers with label positions that will be updated.

>>> parcel_line_features=[{"id":"<guid>",
                           "layerId":"<layerID>"},
                           {...}]

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’ with a list of edited features

transfer_parcel(transfer_parcel_feature, target_parcel_features, record, default_area_unit, source_parcel_features=None, future=False)

The transfer_parcel() method supports workflows for transferring a piece of land between parcels.

Parameter

Description

transfer_parcel_feature

Required Dict. Parameter representing the parcel to be transferred. Only one parcel can be specified as the transfer parcel.

# Example Usage:

>>> transfer_parcel_feature={"id":"<guid>","layerId":"<layerID>"}

target_parcel_features

Required List. Parameter representing the target parcels to which land will be transferred. These parcels will be merged with the transfer parcel and will become larger.

# Example Usage:

>>> target_parcel_features=[{"id":"<guid>","layerId":"<layerID>"},{...}]

record

Required String. Parameter for the unique identifier (GUID) of the record being used for the transfer

default_area_unit

Required Integer. The units in which area will be stored. The parameter is specified as a domain code from the PF_AreaUnits parcel fabric domain.

#Example Usage:

#Square feet
>>> default_area_unit=109405
#Square meters
>>> default_area_unit=109404

source_parcel_features

Optional List. Parameter representing the source parcels from which land will be transferred. These parcels will be clipped and will become smaller.

# Example Usage:

>>> source_parcel_features=[{"id":"<guid>","layerId":"<layerID>"},{...}]

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’ with a list of edited features

update_history(features, record, moment=None, set_as_historic=False, future=False)

Sets the specified parcel features to current or historic using the specified record. If setting current parcels as historic, the Retired By Record field of the features is updated with the Global ID of the specified record. If setting historic parcels as current, the Created By Record field of the features is updated with the Global ID of the specified record.

Parameter

Description

features

Required List. The parcel features to be set as historic or current. Can be parcels, parcel polygons, parcel points, and parcel lines.

Syntax

>>> features=[
              {"id":"<guid>",
               "layerId":"<layerID>"},
              {...}
             ]

record

Required String. A GUID representing the record that will be assigned to the features set as current or historic.

moment

Optional String. This parameter represents the session moment (the default is the version current moment). This should only be specified by the client when they do not want to use the current moment.

set_as_historic

Optional Boolean. Boolean parameter representing whether to set the features as historic (True). If False, features will be set as current.

future

Optional boolean. If True, the request is processed as an asynchronous job and a URL is returned that points a location displaying the status of the job.

The default is False.

Returns

Dictionary indicating ‘success’ or ‘error’

TopographicProductionManager

class arcgis.features._topographic.TopographicProductionManager(url, gis=None)

The Topographic Production Service resource represents a topographic production server object extension (SOE). It is the entry point for all functionality related to creating topographic products in ArcGIS Server. This resource provides information about the service and enables the topographic production server capabilities on a map service. You can also view child resources and operations defined by the SOE.

Note

The use of this resource requires an ArcGIS GIS Server Advanced license and a Production Mapping Server or Defense Mapping Server license.

Inputs

Description

url

Required String. The web endpoint to the topographic service.

gis

Optional GIS. The enterprise connection to the Portal site. A connection can be passed in such as a Service Directory connection.

add_product(product_definition, raster=None, ancillary_layers=None)

The add_product operation adds a definition of a map product to the Topographic Production Service resource that can be used to generate a map

Parameter

Description

product_definition

Required dictionary. The definition of the map product.

See Parameters

raster

Optional string. The path to the raster on disk (server path).

ancillary_layers

Optional list of dictionaries. Additional layers to include in the final product.

Syntax: ``` [{

“layer”: “url of the layer”,

“featureClass”: “name of the feature class to extract to”, “map”: “name of the map the layer will be inserted into”, “layerIndex”: “insertion index of the layer” }, …

Note

This parameter supports services located in the same portal site as the server object extension (SOE) or services that are publicly available. The featureClass, map, and layerIndex properties in the array are optional. If the dataset is identifiable from the feature service, it is not necessary to provide the featureClass property. The default values are 0 for layerIndex and BaseMap for map.

Returns

True if succeeded and False if failed.

calculate_extent(name, version, area_interest_layer, input_geometry, out_sr)

The calculate_extent operation calculates a custom area of interest (AOI) for a given product and version. The result can be specified as the value for the customAoi parameter of the generateProduct operation.

Parameter

Description

name

Required string. The name of the product.

version

Required string. The version of the product to generate.

area_interest_layer

Required string. The url of the layer defining the product’s area of interest.

input_geometry

Required dictionary. A geometry defining the center of the custom extent. A point geometry.

out_sr

Required string. The coordinate system for the extent that is returned.

Returns

True if success and False otherwise.

generate_product(name, version, area_interest_layer, area_interest_feature_id, output_type, custom_area_interest=None, layer_exclusion=None, ancillary_layers=None)

The generate_product operation automates the process of producing a layout or map based on an existing map product definition.

Parameter

Description

name

Required string. The name of the product.

version

Required string. The version of the product to generate.

area_interest_layer

Required string. The url of the layer defining the product’s area of interest.

area_interest_feature_id

Required string. The Object ID of the area of interest feature in the area_interest_layer.

Note

If you use the optional custom_area_interest parameter, then this parameter is ignored.

output_type

Required string. The type of output.

Values: “aprx” | “pagx” | “pdf”

custom_area_interest

Optional list dictionary. The features defining the product’s area of interest. One feature is allowed at the current release.

layer_exclusion

Optional list of strings. The list of layer names to exclude from the product.

ancillary_layers

Optional list of dictionaries. Additional layers to include in the final product.

Syntax: ``` [{ “layer”: “url of the layer”,

“featureClass”: “name of the feature class to extract to”, “map”: “name of the map the layer will be inserted into”, “layerIndex”: “insertion index of the layer” }, …

Ancillary layers are added as feature service layers of the final product and don’t extract data to the local geodatabase.

Note

This parameter supports services located in the same portal site as the server object extension (SOE) or services that are publicly available. The featureClass, map, and layerIndex properties in the array are optional. If the dataset is identifiable from the feature service, it is not necessary to provide the featureClass property. The default values are 0 for layerIndex and BaseMap for map.

Returns

A dictionary with the jobId and statusUrl.

jobs_manager()

Retrieve the Topographic Production Job Manager class. With this manager you can retrieve all jobs, a single job, query or cancel a job.

Returns

TopographicProductionJobManager

product(name, include_def=True)

The product operation retrieves a single product from the products that a Topographic Production Service resource supports.

Parameter

Description

name

Required string. The name of the product.

include_def

Optional bool. Specifies whether the full json definition of the map product is included.

products(include_def=True)

The products operation retrieves the products that a Topographic Production Service resource supports.

Parameter

Description

include_def

Optional bool. Specifies whether the full json definition of the map product is included.

Returns

The products that are supported as a dictionary.

property properties

returns the properties for the service

remove_product(name)

The remove_product operation removes a product from the Topographic Production service and returns a standard REST success or error message.

Parameter

Description

name

Required string. The name of the product.

Returns

True if success, else False.

update_product(name, description=None, enabled=None, sheet_id_field=None, raster=None, versions=None, ancillary_layers=None)

The update_product operation updates properties of a product.

Parameter

Description

name

Required string. The name of the product.

description

Optional string. The new description of the product.

enabled

Optional bool. Enables or disables the product. If a product is disabled, the generate_product operation returns an error for that product.

sheet_id_field

Optional string. Updates the sheet ID field.

raster

Optional string. The path to a raster on disk (server path).

versions

Optional dict. Indicates the type of operation and versions. There are two formats.

If the operation is add or update: ``` {

“operation”: “add | update”,
“versions”: [
{

“name”:”name of version”, “template”: “name of template”

]

If the operation is remove: ``` {

“operation”: “remove”, “versions”: [

“name of version 1”, “name of version 2”, …

]

}

ancillary_layers

Optional list of dictionaries. Additional layers to include in the final product.

Syntax: ``` [{ “layer”: “url of the layer”,

“featureClass”: “name of the feature class to extract to”, “map”: “name of the map the layer will be inserted into”, “layerIndex”: “insertion index of the layer” }, …

Ancillary layers are added as feature service layers of the final product and don’t extract data to the local geodatabase.

Note

This parameter supports services located in the same portal site as the server object extension (SOE) or services that are publicly available. The featureClass, map, and layerIndex properties in the array are optional. If the dataset is identifiable from the feature service, it is not necessary to provide the featureClass property. The default values are 0 for layerIndex and BaseMap for map.

Returns

The product name and whether the operation was a success(True) or a failure (false)

TopographicProductionJobManager

class arcgis.features._topographic.TopographicProductionJobManager(url, gis)
cancel_job(job_id)

The cancel operation cancels a job submitted through the generate_product REST operation. It returns a standard REST success or error message.

Parameter

Description

job_id

Required string. The unique job id to cancel.

Returns

Success (true) or Failure (false)

job(job_id, msg_level=None)

The job operation tracks the status of a job executed by the generate_product REST operation and returns the status, start date, last modified date, and messages of the job.

Parameter

Description

job_id

Required string. The unique job id to see.

msg_level

Optional string. The message level associated with the job.

Values: “info” | “warn” | “error”

Note

Regardless of the msgLevel value, any errors that a job contains are included in the messages array of the response by default.

Returns

A Json response with syntax:

``` {

”status”: <untranslated string representing general status of the job>, “statusCode”: <code representing specific status of the job>, “submissionTime”: <time and date of the job submission in UTC and ISO 8601 format YYYY-MM-DDThh:mm:ssZ>, “lastUpdatedTime”: <time and date of the last job update in UTC and ISO 8601 format YYYY-MM-DDThh:mm:ssZ>, “percentComplete”: <percent of the job completed>, “aoiLayer”: <URL of AOI layer>, “aoiFeatureId”: <AOI feature ID>, “outputUrl”: <URL of output>, “user”: <username>, “jobId”: <job identifier>, “productName”: <name of the product>, “productVersion”: <version of the product>, “outputType”: <type/format of the output>, “messages”: { <informative | error | warning> }

jobs()

Retrieve all the jobs for the service.

query_job(status=None, start_date=None, end_date=None, msg_level=None)

The query operation retrieves the status of jobs executed by the generate_product REST operation and returns the status, start date, last modified date, and messages for a set of jobs.

Parameter

Description

status

Optional int. Retrieves all the jobs with a particular status.

`Values:
  • New—0

  • Submitted—1

  • Waiting—2

  • Executing—3

  • Succeeded—4

  • Failed—5

  • TimedOut—6

  • Canceling—7

  • Canceled—8

  • Deleting—9

  • Deleted—10`

start_date

Optional datetime. Retrieves all the jobs that started on or after the start date and time specified. The date and time should be UTC and in ISO 8601 format. If time is not specified, then midnight is used in the following format: 00:00:00.

end_date

Optional datetime. Retrieves all the jobs that ended on or after the end date and time specified. The date and time should be UTC and in ISO 8601 format. If time is not specified, then 23:59:59 is used.

msg_level

Optional string. The message level associated with the job.

Values: “info” | “warn” | “error”

Note

Regardless of the msgLevel value, any errors that a job contains are included in the messages array of the response by default.

TraceConfiguration

class arcgis.features._trace_configuration.TraceConfiguration(domain_network_name, tier_name, shortest_path_network_attribute_name=None, propagators=None, target_tier_name=None, subnetwork_name=None, filter_bitset_network_attribute_name=None, traversability_scope=<TraversabilityScopeEnum.JUNCTIONS_AND_EDGES: 'junctionsAndEdges'>, filter_scope=<FilterScopeEnum.JUNCTIONS_AND_EDGES: 'junctionsAndEdges'>, condition_barriers=None, function_barriers=None, filter_barriers=None, filter_function_barriers=None, functions=None, nearest_neighbor=None, output_filters=None, output_conditions=None, include_containers=False, include_content=False, include_structures=False, include_barriers=True, validate_consistency=True, validate_locatability=False, include_isolated=False, ignore_barriers_at_starting_points=False, include_up_to_first_spatial_container=False, allow_indeterminate_flow=None)

Parameter

Description

domain_network_name

Required string. Specifies the name of the domain network where the trace is starting. This is required for subnetwork-based traces.

tier_name

Required string. Specifies the name of the tier where the trace is starting. This is required for subnetwork-based traces.

shortest_path_network_attribute_name

Required string for a shortest path trace; otherwise, it’s optional. It specifies the network attribute name used for determining cost when calculating the shortest path.

propagators

Required list of dictionaries. This is an array of objects. The default is null.

Syntax:

[

{ “networkAttributeName” : “<string>”, “substitutionAttributeName”: “<string>”, “propagatorfunctionType” : “bitwiseAnd” | “min”, | “max” “operator : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : string (numeric), “propagatedAttributeName”: “<string>” }

]

target_tier_name

Optional string. Specifies the name of the tier where an upstream or downstream trace ends.

subnetwork_name

Optional string. Specifies the name of the subnetwork that be traced. The starting points of the trace are the controllers of this subnetwork.

filter_bitset_network_attribute_name

Optional string used during a loops trace to only return loops with the same bit set all around the loop. This is used during upstream and downstream traces to ensure that trace results include any bit that is set in the starting points for the network attribute.

traversability_scope

Optional TraversibilityScopeEnum or string specifying the network element types to which the condition, category, or function barriers apply. The default is junctionsAndEdges.

filter_scope

Optional FilterScopeEnum or string specifying the network element types to which the filter barriers or filter function barriers apply. The default is junctionsAndEdges.

condition_barriers

Optional list of dictionaries.Each dictionary represents network attribute or category conditions that serve as barriers (the default is null). If is_specific_value is true, the network attribute is compared to a specific value; otherwise, the network attribute is compared to another network attribute.

Syntax:

[
{

“name” : <string>, “operator” : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : <string>, “combineUsingOr” : <true | false>, “isSpecificValue” : <true | false>

}

]

function_barriers

Optional list of dictionaries. Each dictionary represents a function barrier.

Syntax:

[
{
“functionType”“add” | “subtract” |

“average” | “count” | “min” | “max”,

“networkAttributeName” : <string>, “operator” : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : <string>, “useLocalValues”:true | false

}

]

filter_barriers

Optional list of dictionaries. Each dictionary represents network attribute or category conditions that serve as barriers (the default is null). If is_specific_value is true, the network attribute is compared to a specific value; otherwise, the network attribute is compared to another network attribute.

Syntax:

[
{

“name” : <string>, “operator” : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : string (numeric), “combineUsingOr” : <true | false>, “isSpecificValue” : <true | false>

}

]

filter_function_barriers

Optional list of dictionaries. Each dictionary represents a filter function barrier.

Syntax:

[
{
“functionType”“add” | “subtract” |

“average” | “count” | “min” | “max”,

“networkAttributeName” : <string>, “operator” : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : string (numeric)

}

]

functions

Optional list of dictionaries. Each dictionary represents a function. Each function can have an optional list of network attribute conditions.

Syntax:

[
{
“functionType”“add” | “subtract”
“average” | “count”
“min” | “max”,

“networkAttributeName” : <string>, “conditions”: [ {

“name” : <string>, “type” : “networkAttribute” | “category”, “operator” : “equal” | “notEqual”

“greaterThan”
“greaterThanEqual |
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value” : <string>, “combineUsingOr” : <true | false>, “isSpecificValue” : <true | false>

}

]

nearest_neighbor

Optional dictionary that specifies the parameters needed for calculating nearest neighbors.

Syntax:

{

“count” : int “costNetworkAttributeName” : string, “nearestCategories” : array of string, “nearestAssets” [

{ “networkSourceId” : long, “assetGroupCode” : long, “assetTypeCode” : long }

]

}

output_filters

Optional list of dictionaries specifying the output filter.

Syntax:

[
{

“networkSourceId” : long, “assetGroupCode” : long, “assetTypeCode” : long

}

]

output_conditions

Optional list of dictionaries specifying the type of features returned based on a network attribute or category.

Syntax:

[
{

“name”: “<string>”, “type”: “networkAttribute” | “category”, “operator”: “equal” | “notEqual”

“greaterThan”
“greaterThanEqual”
“lessThan”
“lessThanEqual”
“includesTheValues”
“doesNotIncludeTheValues”
“includesAny”
“doesNotIncludeAny”,

“value”: <string>,

“combineUsingOr”: <true | false>, “isSpecificValue”: <true | false>

}

]

include_containers

Optional property specifying whether to include containers in the trace result. The default is false.

include_content

Optional property specifying whether to include content in the trace result. The default is false.

include_structures

Optional property specifying whether to include structures in the trace result. The default is false.

include_barriers

Optional property specifying whether to include barriers in the trace result. The default is true.

validate_consistency

Optional property specifying whether to validate the consistency of the trace results. The default is true.

validate_locatability

Optional property specifying whether to validate whether traversed junction or edge objects have the necessary containment, attachment, or connectivity association in their association hierarchy. The default is false.

include_isolated

Optional property specifying whether to include isolated features for an isolation trace. The default is false.

ignore_barriers_at_starting_points

Optional property specifying whether dynamic barriers in the trace configuration are ignored for starting points. This can be useful when performing an upstream protective device trace using the discovered protective devices (barriers) as starting points to find subsequent upstream protective devices. The default is false.

include_up_to_first_spatial_container

Optional property specifying whether to limit the containers returned in the trace result. This property depends on the include_containers property and no-ops if include_containers is false. If includeContainers is true and this property is true, containment associations up to and including the first spatial container are returned; otherwise, all c ontainment associations are returned. The default is false.

allow_indeterminate_flow

Optional property specifying whether network features with indeterminate flow stop traversability or are included in the trace results. This property is only honored when running an upstream, downstream, or isolation trace.

allow_indeterminate_flow: bool | None = None
condition_barriers: list[dict] | None = None
domain_network_name: str
filter_barriers: list[dict] | None = None
filter_bitset_network_attribute_name: str | None = None
filter_function_barriers: list[dict] | None = None
filter_scope: FilterScopeEnum | str | None = 'junctionsAndEdges'
classmethod from_config(config)

Loads the Trace Configurations from a Configuration

function_barriers: list[dict] | None = None
functions: list[dict] | None = None
ignore_barriers_at_starting_points: bool = False
include_barriers: bool = True
include_containers: bool = False
include_content: bool = False
include_isolated: bool = False
include_structures: bool = False
include_up_to_first_spatial_container: bool = False
nearest_neighbor: dict | None = None
output_conditions: list[dict] | None = None
output_filters: list[dict] | None = None
propagators: list[dict] | None = None
shortest_path_network_attribute_name: str | None = None
subnetwork_name: str | None = None
target_tier_name: str | None = None
tier_name: str
to_dict()
traversability_scope: TraversabilityScopeEnum | str | None = 'junctionsAndEdges'
validate_consistency: bool = True
validate_locatability: bool = False

TraceNetworkManager

class arcgis.features._trace.TraceNetworkManager(url, version=None, gis=None)

The Trace Network Service exposes analytic capabilities (tracing) as well as validation of network topology.

Inputs

Description

url

Required String. The web endpoint to the trace service.

version

Optional Version. The Version class where the branch version will take place.

gis

Optional GIS. The GIS connection object.

property properties

returns the properties for the service

query_network_moments(moments_to_return=['all'], moment=None)

The query_network_moments operation returns the moments related to the network topology and operations against the topology. This includes when the topology was initially enabled, when it was last validated, when the topology was last disabled (and later enabled), and when the definition of the trace network was last modified.

Parameter

Description

moments_to_return

Optional List of Strings. Represents the collection of validate moments to return. Default is all.

`Values: [“initialEnableTopology” | “fullValidateTopology” |

“partialValidateTopology” | “enableTopology” | “disableTopology” | “definitionModification” | “indexUpdate” | “all” ]`

moment

Optional Epoch in Time in Seconds. Example: moment=1603109606

trace(locations, trace_type, moment=None, configuration=None, result_types=None, run_async=False)

A trace refers to a preconfigured algorithm that systematically travels a network to return results. Multiple parameters and properties are provided with the trace operation that support various analytic workflows. All traces use the network topology to read cached information about network features. This can improve performance of complex traces on large networks. Trace results are not guaranteed to accurately represent a trace network when dirty areas are present. The network topology must be validated to ensure that it reflects the most recent edits or updates made to the network.

Note

The active portal account must be licensed with the ArcGIS Trace Network user type extention to use this operation.

Parameter

Description

locations

Required list of dictionaries. The locations for starting points and barriers. An empty array must be used when performing a subnetwork trace if a subnetworkName is provided as part of the configuration - for example, locations=[].

The location is ignored by the trace if the following required properties are not defined: * percentAlong : required for edge features and objects.

[{
    "traceLocationType" : "startingPoint" | "barrier",
    "globalId" : <guid>,
    “percentAlong” : <double>, // optional
}]

trace_type

Required string. Specifies the core algorithm that will be executed to analyze the network. Can be configured using the configuration parameter.

Values: ‘connected’ | ‘subnetwork’ | ‘subnetworkController’ | ‘upstream’ | ‘downstream’ | ‘loops’ | ‘shortestPath’ | ‘isolation’

moment

Optional Integer. Specifies the session moment. This should only be specified if you do not want to use the current moment.

Example: moment = <Epoch time in milliseconds>

configuration

Optional dictionary or instance of TraceConfiguration class. Specifies the collection of trace configuration properties. Depending on the trace_type, some properties are required.

To see all configuration properties see: Trace Configuration Properties

result_types

Optional parameter specifying hte types of results to return.

Note

ArcGIS Enterprise 10.9.1 or later is required when using the connectivity type.

Returns

If asynchronous = True then the status URL is returned for the job. Otherwise,

a Dictionary of the Trace Results is returned.

trace_configurations()

The trace_configurations resource provides access to all trace configuration operations for a trace network. It is returned as an array of named trace configurations with the creator, name, and global ID for each.

validate_topology(envelope, return_edits=False)

Validating the network topology for a trace network maintains consistency between feature editing space and network topology space. Validating a network topology may include all or a subset of the dirty areas present in the network. Validation of network topology is supported synchronously and asynchronously.

Parameter

Description

envelope

Required Dictionary or Envelope. The envelope of the area to validate.

{
    "xmin": <minimum x-coordinate>,
    "ymin": <minimum y-coordinate>,
    "xmax": <maximum x-coordinate>,
    "ymax": <maximum y-coordinate>,
    "spatialReference": {
    "wkid": <spatial reference well-known identifier>,
    "latestWkid": <the current wkid value associated with the wkid>
    }
}

return_edits

Optional Boolean. Returned results are organized in a layer-by-layer fashion. If return_edits is set to True, each layer may have edited features returned in an editedFeatures object. The editedFeatures object returns full features including the original features prior to delete; the original and current features for updates; and the current rows for inserts, which may contain implicit changes (for example, as a result of a calculation rule).

The response includes no editedFeatures and ‘exceededTransferLimit = true’ if the count of edited features to return is more than the maxRecordCount. If clients are using this parameter to maintain a cache, they should invalidate the cache when exceededTransferLimit = true is returned. If the server encounters an error when generating the list of edits is the response, exceededTransferLimit = true is also returned.

Edited features are returned in the spatial reference of the feature service as defined by the service’s spatialReferenceobject or by the spatialReference of the layer’s extent object.

Returns

Dictionary indicating ‘success’ or ‘error’

UtilityNetworkManager

class arcgis.features._utility.UtilityNetworkManager(url, version=None, gis=None)

The Utility Network Service exposes analytic capabilities (tracing) as well as validation of network topology and management of subnetworks (managing sources, updating subnetworks, exporting subnetworks, and so on). The Utility Network Service is conceptually similar to the Network Analysis Service for transportation networks.

Inputs

Description

url

Required String. The web endpoint to the utility service.

version

Optional Version. The Version class where the branch version will take place.

gis

Optional GIS . The GIS connection object.

apply_overrides(adds=None, deletes=None)

Deprecated since version 2.1.0.

Network attributes support the ability to have their values overridden without having to edit features and validate the network topology (build the index). The utility network also supports the ability to place ephemeral connectivity (for example, jumpers in an electrical network) between two devices or junctions without having to edit features or connectivity associations and validate the network topology (build the index). When specified by the client, a trace operation may optionally incorporate the network attribute and connectivity override values when the trace is run on.

associations()

The associations resource provides access to operations that allow you to query and extract useful information from the associations table of a utility network.

Available starting at Enterprise 10.9.1

Returns

A dictionary with two keys

{“associations”:list, “success”: bool}

disable_subnetwork_controller(network_source_id, global_id, terminal_id, out_sr=None)

A subnetwork controller (or simply, a source or a sink) is the origin (or destination) of resource flow for a subpart of the network. Examples of subnetwork controllers are circuit breakers in electric networks, or town border stations in gas networks. Subnetwork controllers correspond to devices that have the Subnetwork Controller network capability set. A source is removed with disable_subnetwork_controller.

Parameter

Description

network_source_id

Required String. The network source ID that the subnetwork controller participates in.

global_id

Required String. The global ID of the device being disabled as a network controller.

terminal_id

Required String. The terminal ID of the device being disabled as a network controller.

out_sr

Required int. The output spatial reference as a wkid.

disable_topology()

Disables the network topology for a utility network. When the topology is disabled, feature and association edits do not generate dirty areas. Analytics and diagram generation can’t be performed if the topology is not present.

When the topology is disabled, the following happens:

  • All current rows in the topology tables are deleted.

  • No dirty areas are generated from edits.

  • Remaining error features still exist and can be cleaned up without the overhead of dirty areas.

To perform certain network configuration tasks, the network topology must be disabled.

  • This operation must be executed by the portal utility network owner.

  • The topology can be disabled in the default version or in a named version.

Returns

Dictionary indicating ‘success’ or ‘error’

enable_subnetwork_controller(network_source_id, global_id, terminal_id, subnetwork_controller_name, tier_name, subnetwork_name=None, description=None, notes=None, out_sr=None)

A subnetwork controller is the origin (or destination) of resource flow for a subpart of the network (e.g., a circuit breaker in electric networks, or a town border station in gas networks). Controllers correspond to Devices that have the Subnetwork Controller network capability set.

Parameter

Description

network_source_id

Required String. The network source ID that the subnetwork controller participates in.

global_id

Required String. The global ID of the device being enabled as a network controller.

terminal_id

Required String. The terminal ID of the device being enabled as a network controller.

subnetwork_controller_name

Required String. The name of the subnetwork controller.

tier_name

Required String. The name of the tier.

subnetwork_name

Optional String. Specifies the name of the subnetwork.

description

Optional String. Represents the description of the subnetwork controller.

notes

Optional String. The notes associated with the subnetwork controller.

out_sr

Optional Integer. The output spatial reference as a wkid (integer).

enable_topology(error_count=10000)

Enabling the network topology for a utility network is done on the DEFAULT version. Enabling is not supported in named versions. When the topology is enabled, all feature and association edits generate dirty areas, which are then consumed when the network topology is updated.

When topology is enabled, the following happens: - Any existing errors are deleted. - The topology is updated for the full extent of the network. - Any newly discovered errors are added to the dirty areas sublayer. - The topology is marked as enabled.

Note

The active portal account must be licensed with the ArcGIS Utility Network user type extension to use this operation.

Parameter

Description

error_count

Optional Integer. Sets the threshold when the enable_topology will stop if the maximum number of errors is met. The default value is 10,000.

Returns

Dictionary indicating ‘success’ or ‘error’

export_subnetwork(domain_name, tier_name, subnetwork_name, trace_configuration=None, export_acknowledgement=False, result_type=None, result_types=None, moment=None, run_async=False, out_sr=None, pbf=False)

The export_subnetwork operation is used to export information about a subnetwork into a JSON file. That information can then be consumed by outside systems such as outage management and asset tracking. The exportSubnetwork operation allows you to delete corresponding rows in the Subnetwork Sources table as long as the IsDeleted attribute is set to True. This indicates a source feeding the subnetwork has been removed.

Parameter

Description

domain_name

Required String. The name of the domain network of which the subnetwork is a part.

tier_name

Required String. The name of the tier of which the subnetwork is a part.

subnetwork_name

Required String. The name of the subnetwork.

trace_configuration

Optional Dictionary or TraceConfiguration object. Specifies the collection of trace configuration parameters. See: Trace

export_acknowledgement

Optional Boolean. Specify whether the export is acknowledged.

result_types

Optional list of dictionaries. Specifies the type of results to return.

[
    {
        "type" : "features" | "geometries" | "network" | "connectivity" | "controllers" | "associations" | "aggregatedGeometry" |
        "diagram" | "elements" |  "associations",
        "includeGeometry" : true | false,
        "includePropagatedValues": true | false,
        "includeDomainDescriptions": true | false,
        "networkAttributeNames" :["attribute1Name","attribute2Name",...],
        "diagramTemplateName": <value>,
        "resultTypeFields":[{"networkSourceId":<int>,"fieldname":<value>},...]
    },...
]

moment

Optional Integer. Specify the session moment if you do not want to use the current moment.

out_sr

Optional Integer. Optional parameter specifying the output spatial reference.

pbf

Optional Boolean. If true, the response will be in PBF format.

Returns

A dictionary with keys and value types of:

{
“moment”: int,
”url”: str,
”subnetworkHasBeenDeleted”: bool,
”success”: bool
}

locations()

The locations resource provides access to an operation that allows you to query the locatability of a provided set of objects and optionally synthesize geometry to be returned.

Introduced at Enterprise 10.9.1

Returns

“success” if able to reach locations, else “error”

property properties

returns the properties for the service

query_associations(elements=None, moment=None, types=None, return_deletes=False)

The query operation allows you to query the associations table and return association information for network features in a utility network.

Available starting at Enterprise 10.9.1

Parameter

Description

elements

Required List of Dictionary. The feature or object elements for which the association is querried.

[{
    "networkSourceId": <int>,
    "globalId" : <guid>,
    "terminalId": <int> //optional
}]

moment

Optional Epoch time in milliseconds. Specify if you do not want to use the current moment.

types

Optional List of String(s). Specify the association types to be queried.

Values:

“connectivity” | “attachment” | “contianment” | “junctionEdgeFromConnectivity” | “junctionMidspanConnectivity” | “junctionEdgeToConnectivity”

return_deletes

Optional Boolean. Specify whether to return logically deleted associations.

query_locations(elements, max_geom_count, moment=None, attachment_associations=False, connectivity_associations=False, containment_associations=False, locations=False, out_sr=None)

The query operation queries the locatability of the provided set of objects and optionally synthesizes geometry to be returned for each object in a geometry bag as a collection of points and polylines.

Parameter

Description

elements

Required List of Dictionary. The set of objects for which to get locatability and synthesize the geometries.

[{
    "sourceId": <int>,
    "globalIds" : [<guid>],
}]

max_geom_count

Required Int. The maximum number of geometries that can be synthesized and returned in the result.

moment

Optional Epoch time in milliseconds. Specify if you do not want to use the current moment.

attachment_associations

Optional Boolean. Whether to synthesize the geometry representing the structural attachment associations.

conectivity_associations

Optional Boolean. Whether to synthesize the geometry representing the connectivity associations.

containment_associations

Optional Boolean. Whether to synthesize the geometry representing the containment associations.

locations

Optional Bool. Specify whether to synthesize the geometry representing the derived location of the object. This option only affects the results when objects are features or nonspatial objects.

out_sr

Optional Dictionary or Integer. The output spatial reference.

Returns

A dictionary with keys and value types of

{“exceededTransferLimit”: bool,
”objects”: list,
”associations”: list,
”success”: bool}

query_network_moments(moments_to_return=None, moment=None)

The query_network_moments operation returns the moments related to the network topology and operations against the topology. This includes when the topology was initially enabled, when it was last validated, when the topology was last disabled (and later enabled), and when the definition of the utility network was last modified.

Parameter

Description

moments_to_return

Optional List of Strings. Represents the collection of validate moments to return. Default is all.

Values:

[ “initialEnableTopology” | “fullValidateTopology” | “partialValidateTopology” | “enableTopology” | “disableTopology” | “definitionModification” | “updateIsConnected” | “indexUpdate” | “all”]

Example:

moments_to_return=[“enableTopology”,”initialEnableTopology”]

moment

Optional Integer. Specify the session moment if you do not want to use the current moment.

Returns

A dictionary with keys and value types of:

{“networkMoments”: list,
”validateNetworkTopology”: bool,
”success”: bool}

query_overrides(attribute_ids=None, all_attributes=False, all_connectivity=False)

Deprecated since version 2.1.0.

Network attributes support the ability to have their values overridden without having to edit features and validate the network topology (build the index). The utility network also supports the ability to place ephemeral connectivity (e.g., jumpers in an electrical network) between two devices or junctions without having to edit features or connectivity associations and validate the network topology (build the index). This operation allows the client to query all the overrides associated with the network attributes (by network attribute id). In addition, all connectivity overrides are returned.

synthesize_association_geometries(attachment_associations=False, connectivity_associations=False, containment_associations=False, count=200, extent=None, out_sr=None, moment=None)

The synthesize_association_geometries operation is used to export geometries representing associations that are synthesized as line segments corresponding to the geometries of the devices at the endpoints. All features associated with an association must be in the specified extent in order for the geometry to be synthesized. If only zero or one of the devices/junctions intersects the extent, then no geometry will be synthesized.

Parameter

Description

attachment_associations

Optional Boolean. Whether to return attachment associations.

connectivity_associations

Optional Boolean. Represents whether to return connectivity associations.

containment_associations

Optional Boolean. Whether to return containment associations.

count

Required Int. Represents the maximum number of geometries that can be synthesized and returned in the result.

extent

Required Dictionary. Represents the envelope of the area to synthesize association geometries.

{
    "xmin": <minimum x-coordinate>,
    "ymin": <minimum y-coordinate>,
    "xmax": <maximum x-coordinate>,
    "ymax": <maximum y-coordinate>,
    "spatialReference": {
    "wkid": <spatial reference well-known identifier>,
    "latestWkid": <the current wkid value associated with the wkid>
    }
}

out_sr

Optional Dictionary. Represents the output spatial reference.

moment

Optional Integer. Specify the session moment if you do not want to use the current moment.

Returns

A dictionary with keys and value types of:

{“maxGeometryCountExceeded”: bool,
”associations”: list,
”success”: bool}

trace(locations, trace_type, moment=None, configuration=None, result_type=None, result_types=None, trace_config_global_id=None, out_sr=None, pbf=False)

A trace refers to a pre-configured algorithm that systematically travels a network to return results. Generalized traces allow you to trace across multiple types of domain networks. For example, running a Connected trace from your electric network through to your gas network. An assortment of options is provided with trace to support various analytic work flows. All traces use the network topology to read cached information about network features. This can improve performance of complex traces on large networks. Trace results are not guaranteed to accurately represent a utility network when dirty areas are present. The network topology must be validated to ensure it reflects the most recent edits or updates made to the network.

Note

The active portal account must be licensed with the ArcGIS Utility Network user type extention to use this operation.

Parameter

Description

locations

Required list of dictionaries. The locations for starting points and barriers. An empty array must be used when performing a subnetwork trace if a subnetworkName is provided as part of the configuration—for example, locations=[].

The location is ignored by the trace if the following required properties are not defined:

  • percentAlong : required for edge features and objects.

  • terminalID : required for junction features and objects.

[{
    "traceLocationType" : "startingPoint" | "barrier",
    "globalId" : <guid>,
    "terminalId" : <int>,   // optional
    "percentAlong" : <double>, // optional
    "isFilterBarrier" : true | false // optional Introduced at 10.8.1
}]

trace_type

Required string. Specifies the core algorithm that will be executed to analyze the network. Can be configured using the configuration parameter.

Values:

‘connected’ | ‘subnetwork’ | ‘subnetworkController’ | ‘upstream’ | ‘downstream’ | ‘loops’ | ‘shortestPath’ | ‘isolation’

moment

Optional Integer. Specifies the session moment. This should only be specified if you do not want to use the current moment.

Example: moment = <Epoch time in milliseconds>

configuration

Optional dictionary or TraceConfiguration object. Specifies the collection of trace configuration properties. Depending on the trace_type, some properties are required.

To see all configuration properties see: Trace Configuration Properties

result_types

Optional parameter specifying hte types of results to return.

trace_config_global_id

Optional String. The global ID of a named trace configuration. When specified, this configuration is used instead of the traceConfiguration parameter. Additionally, named trace configurations are persisted with their own trace type so the trace type parameter is ignored.

out_sr

Optional Integer. The output spatial reference.

pbf

Optional Boolean. If True, the results are returned in the PBF format. The default is False.

Returns

A dictionary with keys and value types of:

{
“traceResults”: {
“elements”: list,
”diagramName”: str,
”globalFunctionResults”: list,
”kFeaturesForKNNFound”: bool,
”startingPointsIgnored” bool,
”warnings”: list
}
”success”: bool
}

trace_configurations()

The trace_configurations resource provides access to all trace configuration operations for a utility network. It is returned as an array of named trace configurations with the creator, name, and global ID for each.

Returns

An instance of TraceConfigurationsManager Class

traverse_associations(elements, moment=None, type='unspecified', direction='descending', dirty_filter='none', error_filter='none', stop_at_first_spatial=True, max_depth=None)

The traverse_associations operation allows you to obtain and extract useful information from the associations table in a utility network.

The type parameter is used to provide the following predefined traversal types:

  • dirtyAreaExpansion—Returns associations and objects that have been modified and are marked as dirty. Completes a downward traversal, followed by an ascending traversal, with an exit filter on the first spatial feature in each direction.

  • firstContainers—Completes an ascending traversal on containment associations, with an exit filter on the first spatial feature.

  • spatialParents—Completes an ascending traversal on all association types, with an exit filter on the first spatial feature.

  • topContainers—Completes an ascending traversal to return associations and objects with no exit filter.

  • errorsNotModified—Completes a downward traversal to return associations in error, with an exit filter on the first spatial feature.

  • modifiedObjects—Completes a downward traversal to return associations that are dirty, with an exit filter on the first spatial feature.

To create a custom traversal the direction, dirty_filter, error_filter, stop_at_first_spatial, and max_depth parameters can be used. When a traversal type is specified using the type parameter other than the default unspecified`, these parameters are ignored.

Available starting at Enterprise 10.9.1

Note

Associations are not traversed from spatial features to nonspatial objects and back to spatial features when the exit filter is placed on the first spatial feature.

Parameter

Description

elements

Required List of Dictionary. The feature or object elements for which the association is queried.

[{
    "networkSourceId": <int>,
    "globalId" : <guid>,
    "terminalId": <int> //optional
}]

moment

Optional Epoch time in milliseconds. Specify if you do not want to use the current moment.

type

Optional String. Specify the association types to be queried.

Values:

“unspecified” | “dirtyAreaExpansion” | “firstContainers” | “spatialParents” | “topContainers” | “errorsNotModified” | “modifiedObjects”

direction

Optional String. Specify the direction of the association traversal.

Values:

“ascending” | “descending”

dirty_filter

Optional String. Specify whether to filter based on the dirty status of the association.

Note

When dirty_filter and error_filter are specified together, the filters are combined using the AND expression

Values:

“none” | “dirty” | “notDirty”

error_filter

Optional String. Specify whether to filter associations based on the error code.

Values:

“none” | “inError” | “notInError”

stop_at_first_spatial

Optional Bool. Specify whether to stop the traversal of associations from nonspatial objext to feature when a spatial feature is encountered. The traversal will stop at the feature and will not traverse to the next nonspatial object.

max_depth

Optional Integer. Control how many hops through the association graph are allowed in either the ascending or descending direction.

update_is_connected()

Utility network features have an attribute called IsConnected that lets you know if a feature is connected to a source or sink, and therefore it could potentially be part of an existing subnetwork. The update_is_connected operation updates this attribute on features in the specified utility network. This operation can only be executed on the default version by the portal utility network owner.

update_subnetwork(domain_name, tier_name, subnetwork_name=None, all_subnetwork_tier=False, continue_on_failure=False, trace_configuration=None)

A subnetwork is updated by calling the update_subnetwork operation. With this operation, one or all of the subnetworks in a single tier can be updated. When a subnetwork is updated, four things can occur; the Subnetwork Name attribute is updated for all features in the subnetwork, the record representing the subnetwork inside the SubnetLine class is refreshed, the Subnetworks table is updated and finally diagrams are generated or updated for the subnetwork.

Parameter

Description

domain_name

Required String. The name fo the domain network that the subnetwork is a part of.

tier_name

Required String. The name of the tier that the subnetwork is a part of.

subnetwork_name

Optional String. Represents the name of the subnetwork to update. If this parameter is not specified, the all_subnetwork_tier parameter should be set to True. Otherwise an error will occur.

all_subnetwork_tier

Optional Bool. Set to True when all the subnetworks in a tier need to be updated.

continue_on_failure

Optional Bool. Continue updating subnetworks when all_subnetwork_tier is True and a failure occurs when processing a subnetwork.

trace_configuration

Optional Dictionary. Represents the collection of trace configuration parameters. See trace method to get parameters.

Returns

Dictionary of the JSON response.

validate_topology(envelope, run_async=False, return_edits=False, validate_set=None, out_sr=None)

Validating the network topology for a utility network maintains consistency between feature editing space and network topology space. Validating a network topology may include all or a subset of the dirty areas present in the network. Validation of network topology is supported synchronously and asynchronously.

Parameter

Description

envelope

Required Dictionary. The envelope of the area to validate.

{
    "xmin": <minimum x-coordinate>,
    "ymin": <minimum y-coordinate>,
    "xmax": <maximum x-coordinate>,
    "ymax": <maximum y-coordinate>,
    "spatialReference": {
    "wkid": <spatial reference well-known identifier>,
    "latestWkid": <the current wkid value associated with the wkid>
    }
}

run_async

Optional Boolean. If Turem the request is processed as an asynchronous job. The URL is returned to check the status of a job.

return_edits

Optional Boolean. Returned results are organized in a layer-by-layer fashion. If return_edits is set to True, each layer may have edited features returned in an editedFeatures object. The editedFeatures object returns full features including the original features prior to delete; the original and current features for updates; and the current rows for inserts, which may contain implicit changes (for example, as a result of a calculation rule).

The response includes no editedFeatures and ‘exceededTransferLimit = true’ if the count of edited features to return is more than the maxRecordCount. If clients are using this parameter to maintain a cache, they should invalidate the cache when exceededTransferLimit = true is returned. If the server encounters an error when generating the list of edits is the response, exceededTransferLimit = true is also returned.

Edited features are returned in the spatial reference of the feature service as defined by the service’s spatialReferenceobject or by the spatialReference of the layer’s extent object.

validate_set

Optional List of Dictionary. Introduced at Enterprise 10.9.1, it specifies the set of features and objects to validate.

[
    {
        "sourceId": <int>,
        "globalIds": [<guid>]
    }
]

out_sr

Optional integer. The output spatial reference.

Returns

Dictionary indicating ‘success’ or ‘error’

ValidationManager

class arcgis.features._validation.ValidationManager(url, version=None, gis=None)

The Validation Server is responsible for exposing the management capabilities necessary to support evaluation of geodatabase rules.

evaluate(evaluation, area=None, changes_in_version=False, selection=None, return_edits=False)

Runs the topology rules and returns new errors if they exist.

Evaluation can be performed on different types of geodatabase rules (controlled by the evaluationType):

  • Topology rules

  • Validation and batch calculation attribute rules

Parameter

Description

evaluation

Required List of Strings. A list of evaluation types.

Values:

“validationRules” | “calculationRules” | “topologyRules”

Example:

evaluation=[“calculationRules”]

area

Optional Envelope /Dict. Extent of the area to evaluate.

changes_in_version

Optional Boolean. representing whether to perform the evaluation on the features that have changed in the version (default is false). Does not apply to the DEFAULT version.

When set to true, the evaluationDate property for the version is updated. This is listed as a property for a version and can be accessed using the version resource and the version infos operation.

selection

Optional List. A set of features to evaluate. This is an array of layers and the global IDs or Object IDs of the features to examine.

If the evaluation_type is topology this parameter is ignored.

Syntax

[{
“id” : <layerId1>,
“globalIds” : [ <globalId> ],
“objectIds” : [ <objectId> ]
},
{
“id” : <layerId2>,
“globalIds” : [ <globalId> ].
“objectIds” : [ <objectId> ]
}]

return_edits

Optional Boolean. returns features edited due to feature evaluation. Results returned are organized in a layer by layer fashion. If return_edits is set to true, each layer may have edited features returned.

The default for this parameter is false. Always set to true when evaluating topology for a parcel fabric.

Returns

The number of new errors identified along with the moment.

property properties

service properties

update_error(error_features, version=None, return_edits=False, **kwargs)

Updates errors on the validation tables.

Parameter

Description

error_features

Required List. The error features to be updated.

Syntax:

error_features = [{
“errorType” : “object” | “point” | “line” |
“polygon”,
“features” : [
{
“globalId” : <guid>,
“fields” : {
“name1” : <value1>,
“name2” : <value2>
}}]}]

return_edits

Optional Boolean. return_edits returns features edited due to errors update. Results returned are organized in a layer by layer fashion. If it is set to True, each layer may have edited features returned in an editedFeatures object.

The editedFeatures object returns full features including the original features prior to delete, the original and current features for updates and the current rows for inserts which may contain implicit changes (e.g. as a result of a calculation rule ).

The response includes no editedFeatures and exceededTransferLimit=True if the count of edited features to return is more than the maxRecordCount. If clients are using this parameter to maintain a cache, they should invalidate the cache when exceededTransferLimit = True is returned. If the server encounters an error when generating the list of edits is the response, exceededTransferLimit = True is also returned.

Edited features are returned in the spatial reference of the feature service as defined by the services spatialReference object or by the spatialReference of the layers extent object.

The default for this parameter is False.

Returns

Dictionary indicating ‘success’ or ‘error’

WebHookServiceManager

class arcgis.features.managers.WebHookServiceManager(url, fc, gis)

The WebHookServiceManager allows owners and administrators wire feature service specific events to FeatureLayerCollection.

create(name, hook_url, change_types=<WebHookEvents.ALL: '*'>, signature_key=None, active=False, schedule_info=None, payload_format='json', content_type=None)

Creates a new Feature Collection Web Hook

Parameter

Description

name

Required String. Use valid name for a webhook. This name needs to be unique per service.

hook_url

Required String. The URL to which the payloads will be delivered.

change_types

Optional WebHookEvents or String. The default is “WebHookEvents.ALL”, which means all events. This is a comma separated list of values that will fire off the web hook. The list each supported type is below.

signature_key

Optional String. If specified, the key will be used in generating the HMAC hex digest of value using sha256 hash function and is return in the x-esriHook-Signature header.

active

Optional bool. Enable or disable call backs when the webhook is triggered.

schedule_info

Optional Dict or WebHookScheduleInfo. Allows the trigger to be used as a given schedule.

Example Dictionary:

{
“name” : “Every-5seconds”,
“startAt” : 1478280677536,
“state” : “enabled”
“recurrenceInfo” : {
“frequency” : “second”,
“interval” : 5
}
}

payload_format

Optional String. The payload can be sent in pretty format or standard. The default is json.

content_type

Optional String. The Content Type is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file.

A list of allowed web hook triggers is shown below.

Name

Triggered When

*

Wildcard event. Any time any event is triggered.

FeaturesCreated

A new feature is created

FeaturesUpdated

Any time a feature is updated

FeaturesDeleted

Any time a feature is deleted

FeaturesEdited

Any time a feature is edited (insert or update or delete)

AttachmentsCreated

Any time adding a new attachment to a feature

AttachmentsUpdated

Any time updating a feature attachment

AttachmentsDeleted

Any time an attachment is deleted from a feature

LayerSchemaChanged

Any time a schema is changed in a layer

LayerDefinitionChanged

Any time a layer definition is changed

FeatureServiceDefinitionChanged

Any time a feature service is changed

Returns

A WebHook object

delete_all_hooks()

The delete_all_hooks operation will permanently remove the specified webhook.

Returns

Bool, True if successful

disable_hooks()

The disable_hooks will turn off all web hooks for the current service.

Returns

Bool, True if successful

enable_hooks()

The enable_hooks operation restarts a deactivated webhook. When activated, payloads will be delivered to the payload URL when the webhook is invoked.

Returns

Bool, True if successful

property list

Get a list of web hooks on the FeatureLayerCollection

Returns

tuple[WebHook]

property properties

Gets the properties for the WebHook Service Manager and returns a PropertyMap object

WebHook

class arcgis.features.managers.WebHook(url, gis)

The Webhook represents a single hook instance.

delete()

Deletes the current webhook from the system

Returns

Boolean, True if successful

edit(name=None, change_types=None, hook_url=None, signature_key=None, active=None, schedule_info=None, payload_format=None)

Updates the existing WebHook’s Properties.

Parameter

Description

name

Optional String. Use valid name for a webhook. This name needs to be unique per service.

hook_url

Optional String. The URL to which the payloads will be delivered.

change_types

Optional WebHookEvents or String. The default is “*”, which means all events. This is a comma separated list of values that will fire off the web hook. The list each supported type is below.

signature_key

Optional String. If specified, the key will be used in generating the HMAC hex digest of value using sha256 hash function and is return in the x-esriHook-Signature header.

active

Optional bool. Enable or disable call backs when the webhook is triggered.

schedule_info

Optional WebHookScheduleInfo or Dict. Allows the trigger to be used as a given schedule.

Example Dictionary:

{
“name” : “Every-5seconds”,
“startAt” : 1478280677536,
“state” : “enabled”,
“recurrenceInfo” : {
“frequency” : “second”,
“interval” : 5
}
}

payload_format

Optional String. The payload can be sent in pretty format or standard. The default is json.

A list of allowed web hook triggers is shown below.

Name

Triggered When

*

Wildcard event. Any time any event is triggered.

FeaturesCreated

A new feature is created

FeaturesUpdated

Any time a feature is updated

FeaturesDeleted

Any time a feature is deleted

FeaturesEdited

Any time a feature is edited (insert or update or delete)

AttachmentsCreated

Any time adding a new attachment to a feature

AttachmentsUpdated

Any time updating a feature attachment

AttachmentsDeleted

Any time an attachment is deleted from a feature

LayerSchemaChanged

Any time a schema is changed in a layer

LayerDefinitionChanged

Any time a layer definition is changed

FeatureServiceDefinitionChanged

Any time a feature service is changed

Returns

Response of edit as a dict.

property properties

Returns the WebHook’s properties

Returns

PropertyMap

WebHookEvents

class arcgis.features.managers.WebHookEvents(value)

Provides the allowed webhook enumerations for the captured events.

ALL = '*'
ATTACHMENTSCREATED = 'AttachmentsCreated'
ATTACHMENTSDELETED = 'AttachmentsDeleted'
ATTACHMENTSUPDATED = 'AttachmentsUpdated'
FEATURESCREATED = 'FeaturesCreated'
FEATURESDELETED = 'FeaturesDeleted'
FEATURESEDITED = 'FeaturesEdited'
FEATURESERVICEDEFINITIONCHANGED = 'FeatureServiceDefinitionChanged'
FEATURESUPDATED = 'FeaturesUpdated'
LAYERDEFINITIONCHANGED = 'LayerDefinitionChanged'
LAYERSCHEMACHANGED = 'LayerSchemaChanged'

WebHookScheduleInfo

class arcgis.features.managers.WebHookScheduleInfo(name, start_at, state='enabled', frequency='minute', interval=5)

This dataclass provides information on how to schedule a webhook.

Parameter

Description

name

Required string. The name of the scheduling task.

start_at

Required datetime.datetime. The start date.

state

Optional String. The state of the task, this can be enabled or disabled.

frequency

Optional String. The default is minute. The time interval to run each task. The allows values are: second, minute, hour, day, week, month, year.

interval

Optional Integer. The value for with the frequency describes.

as_dict()

returns the dataclass as a dictionary

frequency: str = 'minute'
interval: int = 5
name: str
start_at: datetime.datetime
state: str = 'enabled'

NetworkDiagramManager

class arcgis.features._network_diagram.NetworkDiagramManager(url, version=None, gis=None)

The Network Diagram service resource represents a network diagram service published with ArcGIS Server. The resource provides information about the service itself (name, type, default diagram template) and exposes various functions to access published network diagrams, create new network diagrams and store them, edit and maintain network diagrams, and so on.

The Network Diagram service supports some operations which allow retrieving network diagrams, getting the characteristics of the diagrams you want (diagram info, consistency state), creating new network diagrams and deleting network diagrams.

Note

The active portal account must be licensed with the ArcGIS Utility Network user type extension or the ArcGIS Trace Network user type extension to use the utility network and network diagram services.

Inputs

Description

url

Required String. The web endpoint to the utility service.

version

Required Version. The Version class where the branch version will take place.

gis

Optional GIS. The GIS connection object.

create_diagram_from_features(template, initial_features)

The create_diagram_from_features operation is performed on a Network Diagram Service resource. The result of this operation is a Diagram Information JSON object.

It is used to create a new temporary network diagram.

Parameter

Description

template

Required string. The name of the diagram template the new network diagram will be based on.

initial_features

Required list of strings. A list of utility network features Global IDs from which the new diagram is going to be built.

Returns

A dictionary of the diagram information.

delete_diagram(name)

The delete_diagram operation is performed on a Network Diagram Service resource.

Parameter

Description

name

Required string. The name of the network diagram to delete.

Returns

The moment (date) the delete_diagram operation happens.

diagram(name)

The Diagram resource represents a single network diagram under a Network Diagram service.

Parameter

Description

name

Required string. The name of the network diagram.

property diagram_dataset

The Diagram Dataset resource regroups the info related to each diagram template under a Network Diagram service. It returns an array of diagram template info.

diagrams(moment=None)

The Network Diagrams resource represents all the network diagrams under a Network Diagram service. It is returned as an array of network diagram names. By default, only the diagrams in Default are returned.

Parameter

Description

moment

Optional int. The session moment.

Returns

A list of diagram names.

find_diagram_infos(diagrams_names, moment=None)

The find_diagram_infos operation is performed on a Network Diagram Service resource. The result of this operation is an array of Diagram Information JSON objects.

Parameter

Description

diagram_names

Required list of strings. Each string corresponds to a diagram name for which you want to get diagram information.

moment

Optional Integer. A session moment.

Returns

Diagram info object for each of the diagram names specified in input.

find_diagram_names(moment=None, extent=None, where=None, features=None, exclude_system_diagrams=False)

The find_diagram_names operation is performed on a Network Diagram Service resource. The result of this operation is an array of strings, each one corresponding to a network diagram’s name.

This operation is used to retrieve the set of diagrams that cover a given extent, verify a particular WHERE clause, or contain specific utility network features or diagram features.

Parameter

Description

moment

Optional integer. The session moment.

extent

Optional dictionary representing the extent that you want the network extent of the resulting diagrams to intersect.

Syntax: ``` {

“xmin”: <xmin>, “ymin”: <ymin>, “xmax”: <xmax>, “ymax”: <ymax>, “zmin”: <zmin>, “zmax”: <zmax>, “mmin”: <mmin>, “mmax”: <mmax>, “spatialReference”: {<spatialReference>}

where

Optional string. Any legal SQL WHERE clause operating on some fields in the diagrams table is allowed. See table below for the exact list of field names that can be used.

features

Optional dictionary. A set of utility network feature Global IDs, or network diagram feature Global IDs represented in a given diagram that are included in the resulting queried diagrams.

The dictionary is composed of two keys: * globalIDs - An array of utility network feature Global IDs (case 1), or an array of network diagram feature Global IDs (case 2). * diagram - For case 1, NULL, or for case 2, the diagram name referencing the specified network diagram feature Global IDs.

exclude_system_diagrams

Optional bool. If True, the operation returns any diagrams except for the subnetwork system diagrams. If False (default), the operation returns any diagram.

WHERE CLAUSE FIELDS:

Field

Type

name

String

tag

String

creationDate

Date

creator

String

lastUpdateDate

Date

lastUpdateBy

String

Returns

An array of strings, each one corresponding to a diagram name.

property properties

returns the properties for the service

query_consistency_state(diagrams_names, moment=None)

The query_consistency_state operation is performed on a Network Diagram Service resource.

Parameter

Description

diagram_names

Required list of strings. Each string corresponds to a diagram name for which you want to get diagram information.

moment

Optional Integer. A session moment.

Returns

It returns the consistency state for each of the diagram names specified in input.

template(name)

The Template resource represents a single diagram template under a Network Diagram service. It is returned as a JSON object that provides the list of the diagram layouts and their property sets, which are preset for the template.

The Template resource doesn’t support any operation nor any child resource.

Parameter

Description

name

Required string. The name of the template.

property templates

The Diagram Templates resource represents all the diagram templates under a Network Diagram service. It returns an array of template names.

Diagram

class arcgis.features._network_diagram.Diagram(url, version=None, gis=None)

The Diagram resource represents a single network diagram under a Network Diagram service. It is returned as a JSON Diagram Information object.

It supports three child resources: * Diagram Map—Mimics a map service resource for the network diagram. * Dynamic Layers—Describes the sublayers under the diagram layer. * Layer Definitions—Details the layer and labeling properties that define each sublayer under the diagram layer.

append_features(added_features)

The append_features operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment (date) the appendFeatures operation happens for a stored diagram.

It is used to append a set of utility network feature to the diagram resource.

Parameter

Description

added_features

Required list of strings. The strings are utility network feature Global IDs, the features being appended to the diagram resource.

apply_layout(layout_name, layer_params=None, junction_ids=None, container_ids=None, edge_ids=None, run_async=False)

The apply_layout operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment (date) the applyLayout operation happens for a stored diagram.

It is used to apply a specific diagram algorithm on all or parts of the resource diagram content.

Parameter

Description

layout_name

Required string. The name of the algorithm layout to execute.

Values: “AngleDirectedDiagramLayout” | “CompressionDiagramLayout” | “ForceDirectedDiagramLayout” | “GeoPositionsDiagramLayout” | “GridDiagramLayout” | “LinearDispatchDiagramLayout” | “MainLineTreeDiagramLayout” | “MainRingDiagramLayout” | “PartialOverlappingEdgesDiagramLayout” | “RadialTreeDiagramLayout” | “RelativeMainlineDiagramLayout” | “ReshapeEdgesDiagramLayout” | “RotateTreeDiagramLayout” | “SeparateOverlappingEdgesDiagramLayout” | “SmartTreeDiagramLayout” | “SpatialDispatchDiagramLayout”

layout_params

Optional dictionary. The algorithm layer parameters.

`Specific Property Parameters <https://developers.arcgis.com/rest/services-reference/enterprise/appendix-diagram-layout-property-set-objects.htm\>`_

Example:
layoutParams = {
“type”: “PropertySet”,
“propertySetItems”: [

“are_containers_preserved”, false, “is_active”, false, “iterations_number”, 20, “repel_factor”, 1, “degree_freedom”, 1

]

}

junction_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of junction object Ids that will be processed.

container_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of container object Ids that will be processed.

edge_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of edge object Ids that will be processed.

run_async

Optional bool. Specify whether the layout algorithm will run synchronously or asynchronously.

If False, the layout algorithm will run synchronously and can fail if its execution exceeds the service timeout—600 seconds by default. This is the default.

If True, the layout algorithm will run asynchronously. This option dedicates server resources to run the layout algorithm with a longer time-out. Running asynchronously can be interesting when executing layout that are time consuming—for example, Partial Overlapping Edges—and applying to large diagrams—more than 25,000 features.

apply_template_layouts(junction_ids=None, container_ids=None, edge_ids=None)

The apply_template_layouts operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment the applyTemplateLayouts operation happens for a stored diagram.

It is used to re-execute the list of the layout algorithms currently configured on the template the resource diagram is based on.

Parameter

Description

junction_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of junction object Ids that will be processed.

container_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of container object Ids that will be processed.

edge_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of edge object Ids that will be processed.

clear_flags(flag_type)

The clear_flags operation is performed on a Diagram resource. This operation returns the moment (date) the clear_flags operation happens when it applies on a stored diagram.

It is used to clear all root junction, end junction, pivot junction and barrier flags on the resource diagram.

Parameter

Description

flag_type

Required string. The type of flag you want to clear in the diagram.

Values: “esriDiagramRootJunction” | “esriDiagramEndJunction” | “esriDiagramPivotJunction” | “esriDiagramBarrierEdge” | “esriDiagramBarrierJunction”

diagram_map()

The Diagram Map resource mimics a map service resource. It is returned as a Map service by the REST API.

Note

This map REST endpoint is the one you can add as content to your web maps.

dynamic_layers(all_layers=False)

The Dynamic Layers resource describes the sublayers under the diagram layer.

Parameter

Description

all_layers

Optional bool. If True, all layers are cached whether they contain diagram features or not. If False, only the layers that contain diagram features are cached.

Returns

An array of JSON object layers with their SQL query. Each JSON object layer item in the array provides the following information: * “id”—The ID of the layer * “source”—The layer source internal information: * “type”—“workspaceLayer” * “workspaceID”—“Diagram” * “layerID”—The internal layer ID * “definitionExpression”-The filtering expression based on the diagram GUID

export_diagram_map(size, dpi=None, bbox=None, format='PNGS', transparent=False, map_scale=None, rotation=0, bbox_sr=None, image_sr=None, moment=None)

The Export operation is performed on a Diagram Map resource. The result of this operation is a map image that represents the diagram specified in the URL.

Parameter

Description

size

Required string. The size (“width, height”) of the exported image in pixels.

Example: size=”600, 600”

dpi

Optional string. The device resolution of the exported image (dots per inch). If the dpi is not specified, an image with a default of 96 will be exported.

Example: dpi=”600, 600”

bbox

Optional string. The extent(bounding box) of the exported image. Unless the bbox_sr parameter has been specified, the bbox assumed to be in the spatial reference of the map.

The bbox coordinates should always use a period as a decimal separator, even in countries where traditionally a comma is used.

Example: bbox=”-104, 35.6, -94.32, 41”

format

Optional string. The format of the exported image.

Values: “PNG32” | “PNG24” | “PNG” | “JPG” | “DIB” | “TIFF” | “EMF” | “PS” | “PDF” | “GIF” | “SVG” | “SVGZ” | “BMP”

transparent

Optional bool. If true, the image will be exported with the background color of the map set as its transparent color. The default is false. Only the “PNG” and “GIF” formats support transparency.

Internet Explorer 6 does not display transparency correctly for png24 image formats.

map_scale

Optional int. Use this parameter to export a map image at a specific scale, with the map centered around the center of the specified bbox.

rotation

Optional int. Use this parameter to export a map image rotated at a specific angle, with the map centered around the center of the specified bounding box (bbox). It could be a positive or negative number.

bbox_sr

Optional string. The well-known ID that is the spatial reference of the bbox.

If none is specified, the spatial reference of the map is used.

image_sr

Optional string. The well-known ID that is the spatial reference of the exported image.

If none is specified, the spatial reference of the map is used.

moment

Optional int. The session moment.

extend(extend_type=None, from_features=None)

The extend operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment the edit operation happens for a stored diagram.

It is used to extend the diagram resource content one connectivity level, optionally regarding to the traversability over the network.

Parameter

Description

extend_type

Optional string. The type of extend you want to process.

Values: “esriDiagramExtendByAttachment” | “esriDiagramExtendByConnectivity” | “esriDiagramExtendByTraversability” | “esriDiagramExtendByContainment”

from_features

Optional list of strings. Diagram feature Global IDs, those diagram features being those from which the extend process will execute.

find_diagram_features(from_features, include_aggregations, add_connectivity_associations, add_structural_attachments, from_diagram=None, moment=None)

The find_diagram_features operation is performed on a Diagram resource. It returns an array of diagram feature JSON objects for the input fromDiagram.

This is the operation to use to search for the utility network features associated with a set of diagram features that are referenced in the diagram resource.

Parameter

Description

from_features

Required list of strings. Depending on whether you want to retrieve diagram features associated with utility network features (case#1) or with diagram features that are represented in another diagram (case#2), an array of utility network feature Global IDs (case#1), or an array of network diagram feature Global IDs (case#2).

include_aggregations

Required boolean. Case#1—When the fromFeatures reference utility network feature Global IDs: * True—The operation returns the diagram features that strictly represent those utility network features in the diagram resource, and the diagram features that are associated with those utility network features but not represented in the diagram resource where they are reduced or collapsed. * False—The operation only returns the diagram features associated with those utility network features that are not reduced nor collapsed in the diagram resource; that is, it only returns the diagram features associated with those utility network features that are visibly represented in the diagram resource.

Case#2—When the fromFeatures reference diagram feature Global IDs represented in another diagram: * True—The operation returns the diagram features associated with the same utility network features those diagram features are, whether those features are reduced or collapsed in this other diagram and/or in the resource diagram. * False—The operation only returns the diagram features associated with the same utility network features that are visibly represented in this other diagram and in the resource diagram.

add_connectivity_associations

Required boolean. When the from_features reference utility network feature Global IDs:

  • True—The operation also adds any connectivity association

diagram edges for which it has just retrieved both the “from” and “to” diagram junctions. * False—The operation doesn’t add any connectivity association diagram edges represented in the diagram resource.

add_structural_attachments

Required boolean. When the from_features reference utility network feature Global IDs:

  • True—The operation also adds any structural attachment

diagram edges for which it has just retrieved both the “from” and “to” diagram junctions. * False—The operation doesn’t add any structural attachment diagram edges represented in the diagram resource.

from_diagram

Optional string. The name of the diagram the feature Global IDs specified for the from_features parameters belong to, or null when the from_features parameter references utility network features.

moment

Optional integer. The session moment.

find_initial_network_objects(moment=None)

The find_initial_network_objects operation is performed on a Diagram resource. It returns an array of network feature globalIDs.

This is the operation to use to search for the set of network features used as input for the diagram build.

Parameter

Description

moment

Optional integer. A session moment.

find_network_features(from_features, include_aggregations, moment=None)

The find_network_features operation is performed on a Diagram resource. It returns an array of network feature global IDs.

This is the operation to use to search for the diagram features referenced in the diagram resource that are associated with a set of utility network features or a set of diagram features represented in another network diagram.

Parameter

Description

from_features

Required list of strings. A list of diagram network feature global IDs.

include_aggregations

Required boolean. * True—The operation returns all the network features associated with the diagram features specified in the from_features parameter, whether those features are reduced or collapsed in the diagram resource. * False—The operation only returns the network features associated with diagram features specified in the from_features parameter that are not reduced or collapsed in the diagram resource; that is, it only returns the network features associated with the specified diagram features that are visibly represented in the diagrams.

moment

Optional integer. A session moment.

get_aggregations(moment=None)

The get_aggregations operation is performed on a Diagram resource. The result of this operation is an array of Diagram Aggregation JSON objects.

It returns all the diagram aggregations in the diagram resource.

Parameter

Description

moment

Optional integer. A session moment.

get_flags(flag_type, moment=None, out_sr=None)

The get_flags operation is performed on a Diagram resource. The result of this operation is a JSON Information object that returns the list of diagram element IDs bringing a flag, with its flag type and its location.

It is used to get the root junction, end junction, pivot junction, and barrier flag on a particular diagram feature.

Parameter

Description

flag_type

Required string. The type of flag you want to search for on the diagram resource.

Values: “esriDiagramRootJunction” | “esriDiagramEndJunction” | “esriDiagramPivotJunction” | “esriDiagramBarrierEdge” | “esriDiagramBarrierJunction”

moment

Optional integer. A session moment.

out_sr

Optional dictionary or string to specify the spatial reference of the returned geometry.

identify_diagram_map(geometry, tolerance, image_display, map_extent, geometry_precision=None, return_field_name=False, return_unformatted_values=False, return_z=False, return_m=False, return_geometry=True, max_allowable_offset=None, geometry_type='esriGeometryPoint', sr=None, moment=None)

The Identify operation is performed on a Diagram Map resource. The result of this operation is an identify results resource.

Parameter

Description

geometry

Required string or dictionary. The geometry to identify on. The type of the geometry is specified by the geometryType parameter. The structure of the geometries is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for points and envelopes, you can specify the geometries with a simpler comma-separated syntax.

Syntax:

  • JSON structures: geometry=<geometryType>&geometry={ geometry}

  • Point simple syntax: geometry=esriGeometryPoint&geometry=<x>,<y>

  • Envelope simple syntax: geometry=esriGeometryEnvelope&geometry=<xmin>,<ymin>,<xmax>,<ymax>

Example:

  • JSON structures: geometry=esriGeometryPoint&geometry={x: -104, y: 35.6}

  • Point simple syntax:geometry=esriGeometryPoint&geometry=-104,35.6

  • Envelope simple syntax: geometry=esriGeometryEnvelope&geometry=-104,35.6,-94.32,41

tolerance

Required int. The distance in screen pixels from the specified geometry within which the identify should be performed.

image_display

Required string. The screen image display parameters (width, height, and DPI) of the map being currently viewed.

The mapExtent and the imageDisplay parameters are used by the server to determine the layers visible in the current extent. They are also used to calculate the distance on the map to search based on the tolerance in screen pixels.

Syntax: image_display=”<width>,<heigth>,<dpi>”

map_extent

Required string. The extent or bbox fo the map currently being viewed. Unless the sr parameter has been specified, the map_extent is assumed to be in the spatial reference of the map.

The map_extent and image_display parameters are used by the server to determine the layers visible in the current extent. They are also used to calculate the distance on the map to seach based on the tolerance in screen pixels.

Syntax: map_extent=”<xmin>, <ymin>, <xmax>, <ymax>”

geometry_precision

Optional int. Specify the number of decimal places in the response geometries returned by the operation. Does not apply to m and z values.

return_field_name

Optional bool. If True, field names will be returned instead of field aliases.

return_unformatted_values

Optional bool. If True, the values in the result will not be formatted. Numbers will be returned as is and dates will be returned as epoch values.

return_z

Optional bool. If True, z value will be included in the results if the features have z-values.

Only applies if return_geometry=True

return_m

Optional bool. If True, m value will be included in the results if the features have m-values.

Only applies if return_geometry=True

return_geometry

Optional bool. If True, the result set will include the geometries associated with each result.

max_allowable_offset

Optional int. This option can be used to specify the maximum allowable offset to be used for generalizing geometries returned by the identify operation. The max_allowable_offset is in the units of the sr. If sr is not specified, max_allowable_offset is assumed to be in the unit of the spatial reference of the map.

geometry type

Optional string. The type of geometry specified by the geometry parameter. The geometry type could be a point, line, polygon, or an envelope. The default geometry type is a point (“esriGeometryPoint”).

Values: “esriGeometryPoint” | “esriGeometryMultipoint” | “esriGeometryPolyline” | “esriGeometryPolygon” | “esriGeometryEnvelope”

sr

Optional string. The well-known ID fo the spatial reference of the input and output geometries as well as the map_extent.

If sr is not specified, the geometry and the map_extent are assumed to be in the spatial reference of the map, and the output geometries are also in the spatial reference of the map.

moment

Optional int. The session moment.

layer_definitions(all_layers=False, moment=None)

The Layers Definitions resource details all the layer and labeling properties that define each sublayer under the diagram layer.

Parameter

Description

all_layers

Optional bool. If True, all layers are cached whether they contain diagram features or not. If False, only the layers that contain diagram features are cached.

moment

Optional int. The session moment.

manage_flag(flag_type, flag_id, action)

The manage_flag operation is performed on a Diagram resource. This operation returns the moment the manageFlag operation happens when it applies on a stored diagram.

It is used to add or remove root junction, end junction, pivot junction and barrier flags on a particular diagram feature.

Parameter

Description

flag_type

Required string. The type of flag you want to search for on the diagram resource.

Values: “esriDiagramRootJunction” | “esriDiagramEndJunction” | “esriDiagramPivotJunction” | “esriDiagramBarrierEdge” | “esriDiagramBarrierJunction”

flag_id

Required string. The diagram element id of the diagram feature to which you want the flag to be added or from which you want the flag to be removed.

action

Required string. The flag operation to execute: * “add” - to add a new flag on a particular diagram feature. * “remove” - to remove a flag from a particular diagram feature.

overwrite_from_features(initial_features)

The overwrite_from_features operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment (date) the overwriteFromFeatures operation happens for a stored diagram.

It is used to overwrite the diagram resource content from a set of utility network feature Global IDs.

Parameter

Description

initial_features

Required list of strings. A list of utility network feature Global IDs, those features being the ones used to overwrite the diagram resource.

property properties

returns the properties for the service

query_diagram_content(moment=None, add_diagram_info=False, add_geometries=False, add_attributes=False, add_aggregations=False, use_value_names=False, out_sr=None)

The query_diagram_content operation is performed on a diagram resource. It returns the diagram content in a simple format that reflects basic connectivity. Other optional information can also be returned, such as diagram feature geometry, network element attributes with their string descriptions rather than raw values for coded domain values, aggregated elements, and diagram properties.

Parameter

Description

moment

Optional int. The session moment.

add_diagram_info

Optional bool. * True—The operation also returns some extra information on the diagram, such as its template, the diagram statistics, its creation and last update dates, and the diagram extent. * False—The operation doesn’t return extra information on the diagram (default).

add_geometries

Optional bool. * True—The operation returns each diagram feature with its geometry. * False—The operation doesn’t return the diagram feature geometries (default).

add_attributes

Optional bool. * True—The operation also returns the attributes of the utility network feature associated with each diagram feature. * False—The operation doesn’t return any attributes (default).

add_aggregations

Optional bool. * True—The operation returns each diagram feature with the list of the utility network elements it aggregates with their asset group and asset type values. * False—The operation doesn’t return any aggregations (default)

use_value_names

Optional bool. For the cases in which the associated network feature attributes or aggregations are exported, that is, add_attributes = True or add_aggregations = True, the method to use to export coded domain and subtype values:

  • True—Coded domain and subtype values will be

exported using their string descriptions rather than raw values. * False—Coded domain and subtype values will be exported as raw values. This is the default.

out_sr

Optional dictionary or string. The spatial reference of the returned geometry.

query_elements_by_extent(extent=None, moment=None, add_contents=False, return_junctions=True, return_edges=True, return_containers=True, return_geometry=True, out_sr=None)

The query_elements_by_extent operation is performed on a diagram resource. The result of this operation is a JSON object composed of three arrays—one for the resulting diagram junctions, another for the resulting diagram edges, and the third one for the diagram containers.

It returns the set of diagram features (diagram junctions, diagram edges, or diagram containers) represented in the diagram resource that intersects a specified envelope—this one being optionally enlarged to include any containers that may be partially within it.

Parameter

Description

extent

Optional dictionary. Represent the extent you want the resulting diagram features to intersect.

Without specifying this parameter, the operation returns all the diagram features in the resource diagram.

{
    "xmin": <xmin>,
    "ymin": <ymin>,
    "xmax": <xmax>,
    "ymax": <ymax>,
    "zmin": <zmin>,
    "zmax": <zmax>,
    "mmin": <mmin>,
    "mmax": <mmax>,
    "spatialReference": <spatialReference>
}

moment

Optional int. The session moment.

add_contents

Optional bool. * False —To return the diagram features which strictly intersect the specified envelope (default) * True—To enlarge the searching envelope so it includes the extent of any containers that are partially within the specified envelope

return_junctions

Optional bool. * True—To return the diagram junctions (default) * False—To not return the diagram junctions

return_edges

Optional bool. * True—To return the diagram edges (default) * False—To not return the edges junctions

return_containers

Optional bool. * True—To return the diagram containers (default) * False—To not return the diagram containers

return_geometry

Optional bool. * True—To return each queried diagram feature with its geometry (default) * False—To not return the geometry.

out_sr

Optional dictionary or string representing the spatial reference of the returned geometry.

query_elements_by_ids(junction_ids=None, container_ids=None, edge_ids=None, moment=None, add_connected=False, return_geometry=True, out_sr=None)

The query_elements_by_ids operation is performed on a diagram resource. The result of this operation is a JSON object composed of three arrays—one for the resulting diagram junctions, another for the resulting diagram edges, and the third one for the diagram containers.

It returns the set of diagram features—that is, diagram junctions, diagram edges, or diagram containers—represented in the diagram resource with the specified ObjectIDs. Then when specifying diagram edge ObjectIDs, optionally, extend the resulting set of diagram elements to the junctions they are connected to or when specifying diagram container ObjectIDs, optionally, extend the resulting set of diagram elements to the edge, junction, or container diagram elements they contain.

Parameter

Description

junction_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of junction object Ids that will be processed.

container_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of container object Ids that will be processed.

edge_ids

Optional list. For the case you want the layout algorithm to execute on a diagram part. A list of edge object Ids that will be processed.

moment

Optional integer. The session moment.

add_connected

Optional bool. * False-Doesn’t enlarge the returned diagram junction to those that are from or to junctions of the specified edge_ids. (default) * True-Enlarges the returned diagram junctions to those that are from or to junctions of the specifies edge_ids.

return_geometry

Optional bool. * False-Return each queried feature without its geometry. * True-Return each queried feature with its geometry. (default)

out_sr

Optional dictionary or string representing the spatial reference for the returned geometry.

save_layout(junctions=None, containers=None, edges=None)

The save_layout operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment (date) the saveLayout operation happens for a stored diagram.

It is used to apply and save new geometries that may have been computed for a set of diagram features represented in the diagram resource.

Parameter

Description

junctions

Optional list of dictionaries. Provide the new geometry for each edited junction, those diagram junctions being identified thanks to their Diagram Element ID.

Syntax: junctions=[{“ID”: <jctDEID1>, “geometry”: <geometry1>}, …]

containers

Optional list of dictionaries. Provide the new geometry for each edited container, those diagram containers being identified thanks to their Diagram Element ID.

Syntax: containers=[{“ID”: <containerDEID1>, “geometry”: <geometry1>}, …]

edges

Optional list of dictionaries. Provide the new geometry for each edited edge, those diagram edges being identified thanks to their Diagram Element ID.

Syntax: containers=[{“ID”: <edgeDEID1>, “geometry”: <geometry1>}, …]

store(name, access)

The store operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment the store operation happens.

It is used to store the temporary network diagram resource in the database.

Parameter

Description

name

Required string. The name of the network diagram to be stored.

access

Required string. The access right level you want to set for the stored diagram.

Values: * “esriDiagramPublicAccess” - Anyone will have full access rights on the diagram; that is, view/edit/update/overwrite/delete permissions on it. * “esriDiagramProtectedAccess” - Anyone will have view and read access rights on the diagram, but they will have no permission for editing/update/overwriting/nor deleting the diagram. * “esriDiagramPrivateAccess” - No access to the diagram—nor to view nor to edit it—for anyone except its owner

update()

The update operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment the update operation happens for a stored diagram.

It is used to update the diagram resource content; that is, synchronize its content from the network features used to initially generate it, and so reflect any changes that may have impacted those network features into the diagram.

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