Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

ArcGIS API for PythonAPI Reference

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

classarcgis.features.managers.AttachmentManager(layer:FeatureLayer,version:str|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

RequiredFeatureLayer . The Feature Layerthat supports attachments.

version

Required Version or string. TheVersion class wherethe branch version will take place or theversion name.

add(oid:str,file_path:str,keywords:str|None=None,return_moment:bool=False)bool

Adds an attachment to aFeatureLayer. Adding an attachmentis 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 featureattachment. The content type, size, and name of the attachment willbe derived from the uploaded file.

keywords

Optional string. Sets a text value that is stored as the keywordsvalue for the attachment. This parameter can be set when the layer hasan attachmentProperties property that includes “name”: “keywords”with “isEnabled”: True. If the attachments have keywords enabledand 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 timeattachments were added. If True, the server will return the timein the response’seditMoment key. The default is False.

Returns:

A JSON Response stating ‘success’ or ‘error’

count(where:str|None=None,attachment_where:str|None=None,object_ids:str|None=None,global_ids:str|None=None,attachment_types:str|None=None,size:tuple[int]|list[int]|None=None,keywords:str|None=None)int

The count operation returns the total number of attachments that satisfythe specific criteria entered as arguments to the method. The defaultcount is the number of attachments for all features in the layer.

Parameters

Description

where

Optional String. Clause to specify the set of featuresfor which to return the attachment count.

attachment_where

Optional String. Clause to specify criteria to apply tothe attachments table for which specific attachments toinclude in the count value.

object_ids

Optional List. List ofobject_id values to be queriedfor which to count the number of attachments.

global_ids

Optional List. List ofglobal_id values to be queriedfor which to count the number of attachments.

attachment_types

Optional String. Value specifying the specific formatof attachments to count. SeeattachmentTypes attheQuery Attachmentspage for a list of options to use.

size

Optional Integer or integer range. Value or values toto query attachments of a specific size.

Returns:

Integer of total number of attachments.

# Usage Example 1: Default>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_organizational_profile")>>>flyr_item=gis.content.get("<item id>")>>>att_mgr=flyr_item.attachments>>>att_mgr.count()9# Usage Example 2: List of Object Ids:>>>att_mgr.count(object_ids=[1,3])5# Usage Example 3: List of Global Ids:>>>att_mgr.count(global_ids=['{D432BA85-8702-437D-B740-C214DDE65846}'])2
delete(oid:str,attachment_id:str,return_moment:bool=False,rollback_on_failure:bool=True)bool

Removes an attachment from aFeatureLayer . Deleting an attachment is a feature update;it requires the Update capability. The deleteAttachments operation is performed on afeature 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 timeattachments were deleted. If True, the server will report the timein the response’seditMoment key. The default value is False.

rollback_on_failure

Optional boolean. Specifies whether the edits should be appliedonly if all submitted edits succeed. If False, the server will applythe 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:str|None=None,attachment_id:str|None=None,save_path:str|None=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 valueto download data from.

attachment_id

Optional string. Id of the attachment to download. This is onlyhonored 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:str)

Get the list of attachments for a given OBJECT ID

Parameter

Description

oid

Required string of the object id

Result:

A list of attachments

search(where:str='1=1',object_ids:str|None=None,global_ids:str|None=None,attachment_types:str|None=None,size:tuple[int]|list[int]|None=None,keywords:str|None=None,show_images:bool=False,as_df:bool=False,return_metadata:bool=False,return_url:bool=False,max_records:int|None=None,offset:int|None=None,*,attachment_where:str|None=None)

Thesearch method allows querying the layer for its attachments and returns the results asa Pandas DataFrame or dict

Parameter

Description

where

Required string. The definition expression to be applied tothe related layer/table. From the list of records that arerelated to the specified object Ids, only those records thatconform 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 bequeried.

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 bequeried.

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 specifiedglobal id.

attachment_types

Optional list/string. The file format that is supported byquery 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 isspecified 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 thespecified file size range (1000 - 15000) bytes.

keywords

Optional string. When attachments are uploaded, keywords canbe 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 isset to False, this parameter will be ignored.

as_df

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

return_metadata

Optional Boolean. If true, metadata stored in theexifInfocolumn will be returned for attachments that haveexifInfo.This option is supported only when “name”: “exifInfo” in thelayer’s attachmentProperties includes “isEnabled”: true. Whenset to false, or not set, None is returned forexifInfo.

return_url

Optional Boolean. Specifies whether to return the attachmentURL. The default is false. This parameter is supported if thesupportsQueryAttachmentsWithReturnUrl property is true on thelayer. Applications can use this URL to download the attachmentimage.

max_records

Optional Integer. This option fetches query results up to theresultRecordCount specified. WhenresultOffset is specifiedand this parameter is not, the feature service defaults to themaxRecordCount. The maximum value for this parameter is thevalue of the layer’smaxRecordCount property. This parameteronly applies ifsupportPagination is true.

offset

Optional Integer. This parameter is designed to be used inconjunction withmax_records to page through a long list ofattachments, one request at a time. This option fetches queryresults by skipping a specified number of records. The queryresults start from the next record (i.e., resultOffset + 1).The default value is 0. This parameter only applies whensupportPagination is true. You can use this option to fetchrecords that are beyondmaxRecordCount property.

attachment_where

Optional str. The definition expression to be applied to theattachments table. Only those records that conform to thisexpression will be returned. You can get the attachments tablefield names to use in the expression by checking the layer’sattachmentProperties.

Returns:

A Pandas DataFrame or Dict of the attachments of theFeatureLayer

update(oid:str,attachment_id:str,file_path:str,return_moment:bool=False)bool

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 featureattachment.

return_moment

Optional boolean. Specify whether the response will report the timeattachments were deleted. If True, the server will report the timein the response’seditMoment key. The default value is False.

Result:

JSON response stating ‘success’ or ‘error’

SyncManager

classarcgis.features.managers.SyncManager(featsvc)

Manager class for manipulating replicas for syncing disconnected editing ofFeatureLayer .This class is not created by users directly.An instance of this class, called ‘replicas’, is available as a property of theFeatureLayerCollection 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:list[int],retention_period:int,period_unit:str='days',min_server_gen:str|None=None,replica_id:str|None=None,future:bool=False)

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

Only the owner or the organization administrator can cleanup changetracking 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 thechange tracking information. Change tracking information will becleaned up if they are older than the retention period.

period_unit

Optional String. The units of the retention period.

Values:

days,seconds,minutes, orhours

min_server_gen

Optional String. In addition to the retention period, the changetracking can be cleaned by its generation numbers. Older trackinginformation that has older generation number than themin_server_gen will be cleaned.

replica_id

Optional String. The change tracking can also be cleaned by thereplica_id in addition to theretention_period and themin_server_gen.

future

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

Returns:

Boolean or Iffuture=True, then the result is aFuture object. Callresult() to get the response.

create(replica_name:str,layers:list[int],layer_queries:dict[str,Any]|None=None,geometry_filter:dict[str,str]|None=None,replica_sr:dict[str,Any]|int|None=None,transport_type:str='esriTransportTypeUrl',return_attachments:bool=False,return_attachments_databy_url:bool=False,asynchronous:bool=False,attachments_sync_direction:str='none',sync_model:str='none',data_format:str='json',replica_options:dict[str,Any]|None=None,wait:bool=False,out_path:str|None=None,sync_direction:str|None=None,target_type:str='client',transformations:list[str]|None=None,time_reference_unknown_client:bool|None=None)

The create operation is performed on aFeatureLayerCollection resource. Thisoperation creates a replica on the server between the feature serviceand the client based on replica definition criteria supplied by theclient.

The feature service must have theSync capability. Seepublishing criteriafor details on how to publish services and set capabilities.TheSync overviewprovides additional details and links for details.

The response to this method includes thereplicaID,replicageneration number, and data similar to the response from thequery() operation ona service. This information should be kept track of by the client becauseit will be needed when synchronizing changes in the local data with thereplica created on the server.

SeeSync response typesdetails on the response received.

The operations allows for register exiting data for the replica byusing thereplica_options argument, a dictionary whose key-value pairs aredetailedhere.

For full details seeCreate 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 geometryparameters, the layer_queries parameter can be used to further definewhat is replicated. This parameter allows you to set properties on aper layer or per table basis. Only the properties for the layers andtables 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 fromfilters moduleto filter results by a spatial relationship with another geometry.

replica_sr

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

transport_type

The transport_type represents the response format. If thetransport_type is esriTransportTypeUrl, the JSON response is containedin a file, and the URL link to the file is returned. Otherwise, theJSON object is returned directly. The default is esriTransportTypeUrl.If async is true, the results will always be returned as iftransport_type is esriTransportTypeUrl. If dataFormat is sqlite, thetransportFormat will always be esriTransportTypeUrl regardless of howthe parameter is set.

Values:

esriTransportTypeUrl | esriTransportTypeEmbedded.

return_attachments

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

return_attachments_databy_url

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

asynchronous

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

attachments_sync_direction

Client can specify the attachmentsSyncDirection when creating areplica. AttachmentsSyncDirection is currently a createReplica propertyand cannot be overridden during sync.

Values:

none, upload, bidirectional

sync_model

This parameter is used to indicate that the replica is being createdfor per-layer sync or per-replica sync. To determine which model typesare supported by a service, query the supportsPerReplicaSync,supportsPerLayerSync, and supportsSyncModelNone properties of the FeatureService. By default, a replica is created for per-replica sync.If syncModel is perReplica, the syncDirection specified during syncapplies to all layers in the replica. If the syncModel is perLayer, thesyncDirection 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. ThereplicaServerGen tells the server the point in time from which to sendback changes. If sync_model is perLayer, the response will include anarray of server generation numbers for the layers in layerServerGens. AperLayer sync model requires the layerServerGens on sync. ThelayerServerGens tell the server the point in time from which to sendback changes for a specific layer. sync_model=none can be used to exportthe data without creating a replica. Query the supportsSyncModelNoneproperty of the feature service to see if this model type is supported.

See theRollbackOnFailure 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. Thedefault is json.

Values:

filegdb, json, sqlite, shapefile

replica_options

This parameter instructs the create operation to create a new replicabased on an existing replica definition (refReplicaId). It can be usedto specify parameters for registration of existing data for sync. Theoperation will create a replica but will not return data. TheresponseType returned in the create response will beesriReplicaResponseTypeInfo.

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 downloadwhen the target_type is server. If set, only bidirectional is supportedwhen target_type is client. If set, only upload or download aresupported 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 isclient. This option was added at 10.5.1.

transformations

Optional List. Introduced at 10.8. This parameter applies a datumtransformation on each layer when the spatial reference used ingeometry is different from the layer’s spatial reference.

time_reference_unknown_client

Setting time_reference_unknown_client as true indicates that the client iscapable of working with data values that are not in UTC. If its not setto 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 returnedas-is from the database, rather than as date values in UTC. Non-hosted featureservices can be set to use an unknown time zone using ArcGIS Server Manager.Setting the time zones to unknown also sets the datesInUnknownTimeZone layer propertyas true. Currently, hosted feature services do not support this setting.This setting does not apply to editor tracking date fields which arestored 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 ableto work with feature services that have an unknown time setting.The timeReferenceUnknownClient parameter prevents these clients from workingwith the service in order to avoid problems..Setting this parameter to true indicates that the client is capable of working withunknown date values that are not in UTC.

Returns:

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

create_replica_item(replica_name:str,item:Item,destination_gis:GIS,layers:list[int]|None=None,extent:dict[str,Any]|None=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

RequiredGIS 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:str)

Parameter

Description

replica_id

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

Returns:

The replica information

get_list()

returns all the replicas for the feature layer collection

sync_replicated_items(parent:Item,child:Item,replica_name:str)

Synchronizes two replicated items between portals

Parameter

Description

parent

RequiredItem that points to the feature servicethat is the parent dataset. (source)

child

RequiredItem that points to the feature servicethat 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:str,transport_type:str='esriTransportTypeUrl',replica_server_gen:int|None=None,return_ids_for_adds:bool=False,edits:list[dict[str,Any]]|None=None,return_attachment_databy_url:bool=False,asynchronous:bool=False,sync_direction:str='snapshot',sync_layers:str='perReplica',edits_upload_id:dict|None=None,edits_upload_format:str|None=None,data_format:str='json',rollback_on_failure:bool=False)

The synchronize operation synchronizes data between a local copy of datacreated by a client and a feature service based on areplica_id valueobtained when creating the replica. SeeSync overviewfor more information on the process.

The client obtains thereplica_id by first calling thecreate() operation. Synchronizeapplies the client’s data changes by importing them onto the server. Itthen exports the changes from the server that have taken place since thelast time the client retrieved the server’s data. Edits can be suppliedin theedits parameter or by using theedits_uploads_id andedits_upload_format arguments to identify a file item containing theedits that were previously uploaded using theupload() method.

The response for this operation includes areplicaID value, newreplica generation number, or layer’s generation numbers. The responsehas edits or layers according to thesync_direction/sync_layersarguments. Presence of layers and edits in the response is indicated by theresponseTypekey.

If theresponseType value isesriReplicaResponseTypeEdits oresriReplicaResponseTypeEditsAndData, the result of this operation caninclude lists of edit results for each layer/table edited. Each editresult identifies a single feature in a layer or row in a table andindicates if the edits were successful or not. If an edit is notsuccessful, the edit result also includes an error code and an errordescription.

  • Ifsync_model isperReplica andsync_direction is download orbidirectional, thesynchronize()operation’s response will have edits.

  • Ifsync_direction issnapshot, the response will have replacement data.

  • Ifsync_model isperLayer, andsync_layers havesync_directionas download or bidirectional, the response will have edits.

  • Ifsync_layers havesync_direction as download or bidirectionalfor some layers and snapshot for other layers, the response will have editsand data.

  • Ifsync_direction for all the layers is snapshot, the response willhave replacement data.

  • Ifsync_model isperReplica, thecreate()andsynchronize() responsescontainreplicaServerGen values.

  • Ifsync_model isperLayer, thecreate()andsynchronize() responses containlayerServerGens values.

SeeSynchronize Replicafor full details on the operation.

Parameter

Description

replica_id

Required string. The ID of the replica you want to synchronize.

transport_type

Optional String. Represents the format of the response. The defaultvalue isesriTransportTypeUrl.

Values:

  • esriTransportTypeUrl - the response is contained in a file and athe URL link to the file is returned

  • esriTransportTypeEmbedded - a JSON object is returned in theresponse

Note

Ifasynchronous isTrue ordata_format=sqllite, theresponse is always returned by URL.

replica_server_gen

Required Integer. A generation number that allows the server to keeptrack of what changes have already been synchronized.A newreplicaServerGen is sent with the response. Clients shouldpersist this value and use it with the next call tosynchronize.

Note

Applies whensync_model isperReplica

return_ids_for_adds

Optional Boolean. IfTrue, theobjectIDs andglobalIDs offeatures added during the synchronize will be returned to the clientin theaddResults sections of the response. Otherwise, the IDs arenot returned. The default isFalse.

edits

Optional list of dictionaries. Contains The edits the client wantsto apply to the service.

Note

This argument can be omitted if theedits_upload_id andedits_upload_format arguments are provided instead.

The edits are provided as a list where each element is a dictionarywhose key-value pairs provide:

  • id - The layer or table ID

  • features - a dictionary of inserts, updates, and deletes. Newfeatures and updates are provided as lists offeatures.Deletes are provided as lists ofglobalIDs.

  • attachments - a dictionary of inserts, updates, and deletes. Deletescan be specified as a list ofglobalIDs. Updates and adds arespecified using the following set of properties:

    • globalid - The globalID of the attachment that is to be added or updated.

    • parentGlobalid - The globalID of the feature associated with the attachment.

    • contentType - Describes the file type of the attachment (for example, image/jpeg).

    • name - The file name (for example, hydrant.jpg).

    • data - The base 64 encoded data if embedding the data. Only required if the attachmentis embedded.

    • url - The location where the service will upload the attachment file (for example,http://machinename/arcgisuploads/Hydrant.jpg). Only required if the attachment is notembedded.

    Note

    If embedding the attachment, set thedata property, otherwise seturl.

Seeeditsfor full details on formatting.

return_attachment_databy_url

IfTrue, a reference to a URL will be provided for each attachmentreturned. Otherwise, attachments are embedded in the response. Thedefault isTrue.

Note

Only applies if attachments are included in the replica.

asynchronous

IfTrue, the request is processed as an asynchronous job and a URLis returned that a client can visit and check the status. See theasynchronous operationsfor more information. The default is False.

sync_direction

Optional String. Determines whether to upload, download, or uploadand download. By default, a replica is synchronized bi-directionally.Only applicable whensync_model isperReplica. Ifsync_modelisperLayer, thesync_layers argument contains this information.

Values:

  • download -

    The changes that have taken place on the server since last download arereturned. Client does not need to send any changes. If the changes are sent, servicewill ignore them.

  • upload -

    The changes submitted in the edits or editsUploadID/editsUploadFormatparameters are applied, and no changes are downloaded from the server.

  • bidirectional -

    The changes submitted in the edits or editsUploadID/editsUploadFormatparameters are applied, and changes on the server are downloaded. This is the defaultvalue.

  • snapshot -

    The current state of the features is downloaded from the server. If any editsare specified, they will be ignored.

sync_layers

Required List of dictionaries specifying layer level criteria for theoperation ifsync_model isperLayer. The information in thedictionary allows a client to specify layer level generation numbers,and can also be used to specify individual directions forsynchronization per layer.

Syntax:

>>>flc.replicas.synchronize(...                             sync_layers = [                                            {                                             "id": <layer id>,                                             "serverGen": <generation number1>,                                             "serverSibGen": <sib generation number>,                                             "syncDirection": "<sync_direction1>"                                             },                                   ...                                ]                              ...                              )

Note

This parameter is ignored whensync_model isperReplica

  • IfsyncDirection value isbidirectional ordownload,serverGen is required

  • TheserverSibGen is only needed when syncing for replicas wherethetarget_type argument wasserver when created

  • For replicas where thesyncModel value isperLayer, theserverSibGenserves the purpose of keeping track of changes already received at thelayer level the same wayreplicaServerGen does at the replica level.It is updated when a synchronization completes.

  • If this argument is provided andsync_direction is provided, layersin this argument that do not provide asyncDirection value will usethe value ofsync_direction. Ifsync_direction is not specified,the defaultbidirectional is used.

edits_upload_id

Optional String. The ID for the uploaded item that contains the editsthe client wants to apply to the service. Used in conjunction withedits_upload_format.

Note

This is theid value returned when the edits were addedto the service resources usingupload().

edits_upload_format

Optional String. The data format of the data referenced inedit_upload_id.

data_format

Optional String. The format for the data returned in the response.The default value isjson.

Values:

  • json - data is embedded in the response

  • sqlite - a mobile geodatabase is returned which can be used inArcGIS runtime applications

rollback_on_failure

Optional Boolean. Determines the behavior when there are errorswhile importing edits on the server during the operation. This onlyapplies whensync_direction isupload orbidirectional, orthesyncDirection key of an individualsync_layers element isupload orbidirectional. See theRollback On Failure andSync Modeldocumentation for full details.

  • WhenTrue, if an error occurs while importing edits on theserver, all edits are rolled back and not applied. Theoperation returns an error in the response. Use this settingwhen the edits are such that you will either want all or noneapplied.

  • WhenFalse, if an error occurs while importing an edit on theserver, the operation skips the edit and continues.that were skipped are returned in the edits results withinformation describing why the edits were skipped. This is thedefault value.

close_replica

Optional Boolean. Indicates whether to unregister the replicaupon completion. The default value isFalse.

  • IfTrue, the replica will be unregistered when operationcompletes.

  • IfFalse, the replica can continue to be synchronized.

out_path

optional String. Path of a folder to save the output to a file.

Returns:

A Python dictionary with various keys depending upon inputs.

unregister(replica_id:str)

Unregister a replica from a feature layer collection

Parameter

Description

replica_id

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

FeatureLayerCollectionManager

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

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

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

add_to_definition(json_dict:dict[str,Any],future:bool=False)

The add_to_definition operation supports adding a definitionproperty to a hosted feature layer collection service. The result of thisoperation is a response indicating success or failure with errorcode and description.

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

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The formatcan be derived from theproperties property.For layer level modifications, run updates on each individual featureservice layer object.

Find more information on what this dictionary can contain at:https://developers.arcgis.com/rest/services-reference/enterprise/feature-service/#json-response-syntax

future

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

Returns:

JSON message as dictionary whenfuture=False else Iffuture=True,then the result is aFuture object. Callresult() to get the response.

create_view(name:str,spatial_reference:dict[str,Any]|None=None,extent:dict[str,int]|None=None,allow_schema_changes:bool=True,updateable:bool=True,capabilities:str='Query',view_layers:list[int]|None=None,view_tables:list[int]|None=None,*,description:str|None=None,tags:str|None=None,snippet:str|None=None,overwrite:bool|None=None,set_item_id:str|None=None,preserve_layer_ids:bool=True,visible_fields:list[str]|None=None,query:str|None=None,folder:Folder|str|None=None)

Creates a view of an existing feature service. You can create a view, if you need a different view of the datarepresented by a hosted feature layer, for example, you want to apply different editor settings, apply differentstyles or filters, define which features or fields are available, or share the data to different groups thanthe 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 aview of the data in the hosted feature layer, which means updates made to the data appear in the hosted featurelayer and all of its hosted feature layer views. However, since the view is a separate layer, you can changeproperties 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-onlyfeature 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 aservice’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 FeatureLayerCollectionthat you want in the view.

view_tables

Optional list. Specify list of tables present in the FeatureLayerCollectionthat 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

Not supported.

Note

To overwrite the data used in a hosted feature layer view, youmust overwrite the hosted feature layer from which it wascreated. See theArcGIS Online Overwrite hosted feature layersor theArcGIS Enterprise Overwrite hosted feature layersdocumentation for requirements and considerations foroverwriting. See alsoConsiderations when creating hosted feature layer viewsfor additional criteria for overwriting.

set_item_id

Optional String. If set, the item id is defined by the user ratherthan the system. The parameter requiresArcGIS Enterprise 11.1 or higher.

Note

This parameter is not available for ArcGIS Online.

preserve_layer_ids

Optional Boolean. Preserves the layer’sid on it’s definition whenTrue. The default isTrue.

visible_fields

Optional list[str] or None. A list of visible fields to display.

query

Optional String. A SQL statement that defines the view.

folder

Optional string or Folder. The folder to which the view will be saved.

Returns:

Returns the newly createdItem for the view.

delete_from_definition(json_dict:dict[str,Any],future:bool=False)

The delete_from_definition operation supports deleting adefinition property from a hosted feature layer collection service. The result ofthis operation is a response indicating success or failure witherror code and description.SeeDelete 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 formatcan be derived from theproperties property.For layer level modifications, run updates on each individual featureservice layer object.

future

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

Returns:

JSON message as dictionary whenfuture=False else Iffuture=True,then the result is aFuture object. Callresult() to get the response.

classmethodfromitem(item:Item)

Thefromitem method is used to create aFeatureLayerCollection from aItem class.

Parameter

Description

item

A requiredItem object. The item needed to convert toaFeatureLayerCollection object.

Returns:

AFeatureLayerCollection object.

propertygenerate_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:str,name:str=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.

propertylayers:list

Returns a list ofFeatureLayerManager to work with FeatureLayers

Returns:

List[FeatureLayerManager]

overwrite(data_file:str)

Overwrite all the features and layers in a hosted feature layer collection service. This operation removesall 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. In older versions of Enterprise (pre-11.2), 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 thislayer.

Parameter

Description

data_file

Required string. Path to the file used to overwrite the hostedfeature layer collection.

Returns:

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

propertyproperties

Theproperties property retrieves and set properties of this object.

refresh()

refreshes a feature layer collection

swap_view(index:int,new_source:FeatureLayer|Table,future:bool=False)dict|Future

Swaps the Data Source Layer with a different parent layer.

Parameter

Description

index

Required int. The index of the layer on the view to replace.

new_source

Required FeatureLayer or Table. The layer to replace the existingsource with.

future

Optional Bool. When True, a Future object will be returned else aJSON object.

Returns:

dict | concurrent.futures.Future

propertytables:list

Returns a list ofFeatureLayerManager to work with tables

Returns:

List[FeatureLayerManager]

update_definition(json_dict:dict[str,Any],future:bool=False)

The update_definition operation supports updating a definitionproperty in a hosted feature layer collection service. The result of thisoperation is a response indicating success or failure with errorcode and description.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The formatcan be derived from theproperties property.For layer level modifications, run updates on each individual featureservice layer object.

future

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

Returns:

JSON message as dictionary whenfuture=Falsewhenfuture=True,Future object is returned. Callresult() to get the response.

propertywebhook_manager:WebHookServiceManager
Returns:

WebHookServiceManager

FeatureLayerManager

classarcgis.features.managers.FeatureLayerManager(url,gis=None,**kwargs)

If theuser has the appropriate privileges to access this class, it allowsfor updating the definition of aFeatureLayer.This class is not typically initialized by end users, but instead accessedas themanager property of theFeatureLayer.

# Usage Example>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_user_profile")>>>item=gis.content.search("Flood Damage","Feature Layer")[0]>>>flood_flyr=item.layers[0]>>>flood_mgr=flood_flyr.manager>>>type(flood_mgr)<class'arcgis.features.managers.FeatureLayerManager'>
add_to_definition(json_dict:dict[str,Any],future:bool=False)

This method adds a definition property to a previously published service.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The formatcan be derived from theproperties property. For layer levelmodifications, run updates on each individual feature layer of theservice.

Find more information on what this dictionary can contain at:https://developers.arcgis.com/rest/services-reference/enterprise/layer-feature-service/#json-response-syntax

future

Optional boolean. The default isFalse, which means to run themethod synchronously and wait for results. IfTrue, the method runsasynchronously.

  • Asynchronous operation only supported in ArcGIS Online andArcGIS Enterprise.

Returns:

  • If run synchronously (future=False), a JSON message as a dictionary indicating ‘success’ or ‘error’

  • If run asynchronously (future = True):

    • OnArcGIS Enterprise and ArcGIS Online, aFutureobject. Callresult() to get the response.

    • Asynchronous operation not supported in ArcGIS Online for Kubernetes.

# Usage Example: ArcGIS Enterprise for Kubernetes:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_kubernetes_profile")>>>item=gis.content.get("<feature_layer_item_id>")>>>fl=item.layers[0]>>>new_field={"fields":[{"name":"Loc Identifier","type":"esriFieldTypeString","alias":"safa","nullable":True,"editable":True,"length":256,}]}>>>res=fl.manager.add_to_definition(json_dict=add_field)>>>res{'success':True}# Usage Example 2: ArcGIS Online asynchronous>>>gis=GIS(profile="your_online_profile")>>>item=gis.content.get("<feature_layer_item_id>")>>>fl=item.layers[0]>>>new_field={"fields":[{"name":"Loc Identifier","type":"esriFieldTypeString","alias":"safa","nullable":True,"editable":True,"length":256,}]}>>>future=fl.manager.add_to_definition(json_dict=add_field,future=True)>>>res=future.result()>>>res{'submissionTime':<time_value>,'lastUpdatedTime':<time_value>,'status':'Completed'}
propertycontingent_values:dict[str,Any]

returns the contingent values for the service endpoint

delete_from_definition(json_dict:dict[str,Any],future:bool=False)

This method deletes a definition property from a hosted feature layer.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 formatcan be derived from theproperties property.For layer level modifications, run updates on each individual featureservice layer object.Only include the items you want to remove from the FeatureService or layer.

future

Optional boolean. The default isFalse, which means to run themethod synchronously and wait for results. IfTrue, the method runsasynchronously.

  • Asynchronous operation only supported in ArcGIS Online andArcGIS Enterprise.

Returns:

  • If run synchronously (future=False), a JSON message as a dictionary indicating ‘success’ or ‘error’

  • If run asynchronously (future = True):

    • OnArcGIS Enterprise and ArcGIS Online, aFutureobject. Callresult() to get the response.

    • Asynchronous operation not supported in ArcGIS Online for Kubernetes.

propertyfield_groups:dict[str,Any]

returns the field groups for the service endpoint

classmethodfromitem(item:Item,layer_id:int=0)

Creates aFeatureLayerManager object from a GIS Item.

Parameter

Description

item

Required of typeFeatureService that representsaFeatureLayerCollection .

layer_id

Required int. Id of the layer in theFeatureLayerCollection

Returns:

FeatureLayer created from the layer provided.

propertyproperties

Theproperties property retrieves and set properties of this object.

refresh()

refreshes a service

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

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

Note

Thetruncate method is restricted tolayers that:

  • do not serve as the origin in a relationship with otherlayers

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

  • do not havesync 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. Thedefault is False. It is recommended to set asynchronous=True forlarge datasets.

wait

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

Returns:

JSON Message as dictionary indicatingsuccess orerror

update_definition(json_dict:dict[str,Any],future:bool=False)

This method modifies a definition of a hosted feature layer.

Parameter

Description

json_dict

Required dict. The part to add to the hosted service. The formatcan be derived from theproperties property.For layer level modifications, run updates on each individual featureservice layer object.

future

Optional boolean. The default isFalse, which means to run themethod synchronously and wait for results. IfTrue, the method runsasynchronously.

  • Asynchronous operation only supported in ArcGIS Online andArcGIS Enteprise.

Returns:

  • If run synchronously (future=False), a JSON message as a dictionary indicating ‘success’ or ‘error’

  • If run asynchronously (future = True):

    • OnArcGIS Enterprise and ArcGIS Online, aFutureobject. Callresult() to get the response.

    • Asynchronous operation not supported in ArcGIS Online for Kubernetes.

VersionManager

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

VersionManager allows users to manage the branch versioning forFeatureLayerCollectionservices. The Version Management Service is responsible for exposing the managementcapabilities necessary to support feature services that work with branch versioneddatasets.

See theVersion Management Service for more information

Parameter

Description

url

Required String. The URI to the web resource.

gis

RequiredGIS . The enterprise connection to the Portal site. A connectioncan be passed in such as a Service Directory connection.

flc

OptionalFeatureLayerCollection . This is the parent container thatthe branch versioning is enabled on.

propertyall

returns all visible versions on a service

create(name:str,permission:str='public',description:str='')dict

Create the named version off of DEFAULT. The version is associatedwith the specified feature service. During creation, the descriptionand 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. Thedefault 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:str,mode:str|None=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 specificstate of edit or read. If None is provided (default) the versionis created without entering a mode.

Values:

  • edit - starts editing mode

  • read - starts reading mode

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

propertylocks

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

Returns:

List of locked versions

propertyproperties

returns the service properties

purge(version:str,owner:str|None=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:str|None=None,show_hidden:bool=False)

For the specified feature service, return the info of all versionsthat the client has access to. If the client is the service owner(the user that published the service), all versions are accessibleand 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 bereturned.

Returns:

Dictionary indication ‘success’ or ‘error’

Version

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

AVersion represents a single branch in the version tree.

Parameter

Description

url

Required String. The URI to the web resource.

gis

RequiredGIS . The enterprise connection to the Portal site.

flc

OptionalFeatureLayerCollection . This is the parent container thatthe branch versioning is enabled on.

session_guid

Optional String. A session id generated by the client used to createand release locks associated with reading and editing the version. Ifno session_guid is provided, a new one will be generated.

mode

Optional String. If a user wants to start either editing or readingon creation of the Version, it can be specified here. This is usefulwhen a user is using theVersion with awith statement.

Allowed Values:

  • edit - starts an edit session

  • read - starts a read session

alter(owner:str|None=None,version:str|None=None,description:str|None=None,permission:str|None=None)

Thealter 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()

Theconflicts operation allows you to view the conflicts by layerand type (update-update, update-delete, delete-update) that wereidentified during the last Reconcile operation. The features thatare 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:str)

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

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)

Thedifferences operation allows you to view differences betweenthe current version and the default version. The two versions canbe 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 isobjectIds.

Values :

“objectIds” | “features”

moment

Required String. Moment used to compare current version withdefault.

from_moment

Optional string. Time epoch value in milliseconds specifying thetime from which to obtain the differences between this valueand the specifiedmoment argument value.

Note

  • By default, if this parameter is not specified, thedifferences operation returns the edits (inserts, updates, and deletes) at the specified value of themoment 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 shouldbe returned. If not specified, the differences for all layers willbe returned.

future

Optional boolean. IfTrue, the method runs as an asynchronousjob returning a _URL_ value to inspect the status of the job. Thedefault value isFalse.

Returns:

Dictionary with adifferences key indicating the variousinserts,updates,ordeletes for each layer.

edit(layer:FeatureLayer,adds:FeatureSet|list|None=None,updates=None,deletes=None,use_global_ids=False,rollback_on_failure=True)

Theedit operation allows users to apply changes to the current version. The editsession must be in the mode ofedit or an exception will be raised.

Inputs

Description

layer

RequiredFeatureLayer . The layer to performthe edit on.

adds

OptionalFeatureSet /List. The array offeatures to be added.

updates

OptionalFeatureSet /List. The array offeatures to be updated.

deletes

OptionalFeatureSet /List. String of OIDs toremove from service

use_global_ids

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

rollback_on_failure

Optional boolean. Optional parameter tospecify if the edits should be applied onlyif all submitted edits succeed. If false, theserver will apply the edits that succeedeven if some of the submitted edits fail.If true, the server will apply the editsonly if all edits succeed. The defaultvalue is true.

Returns:

Dictionary

inspect(conflicts:list[dict[str,Any]],inspect_all:bool=False,set_inspected:bool=False)

Theinspect operation allows the client to annotate conflictsfrom the conflict set that was obtained during the last reconcileoperation. Users can mark the conflicts as being inspected;additionally, a description or note can be associated with theconflict.

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 conflictsas being inspected.

set_inspected

Optional Boolean. If True, the examined values will be set toinspected. Ifinspect_all is True, this parameter is ignored.

Returns:

Boolean. True if successful else False.

propertylayers

returns the layers in theFeatureLayerCollection

propertymode

Themode allows version editors to start and stop edit, read, orview mode.

Parameter

Description

value

Required string.

Values:

  • edit - calls thestart_editing method and creates a lock

  • read - calls thestart_reading method and creates a lock

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

propertyparcel_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 theirbranch to the default version. The client can only post changes ifthe branch version has not been modified since the last reconcile.If the default version has been modified in the interim, the clientwill have to reconcile again before posting.

Parameter

Description

rows

Optional List of dictionaries representing the features or objectsfor posting a subset of edits in the current version. TheobjectIds specified must be edits contained within the currentversion, which can be obtained from thedifferences() method. Theposted edits will no longer exist in the current version, anotherreconcile() is necessaryto 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 asynchronousjob. The results are returned as a Url pointing to a location thatindicates the status of the job.

Returns:

Boolean.True or a job URL if successful, elseFalse.

propertyproperties

returns the service properties

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

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

Parameter

Description

end_with_conflict

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

with_post

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

conflict_detection

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

The default isbyObject.

Note

This parameter was introduced at ArcGIS Enterprise 10.9

Values:

byObject | byAttribute

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

Note

This parameter was introduced at ArcGIS Enterprise 10.9.1

The default isFalse.

Returns:

Boolean.

Iffuture=True, then the result is aFuture object. Callresult() to get the response.

restore(rows:list[dict[str,Any]])

Therestore method allows users to restore rows from a commonancestor version. This method is intended to be used when aDeleteUpdate 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

propertysave_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. Whenstart_readingis enabled, it will prevent other users from editing or reconciling theversion.

Returns:

Boolean. True if successful else False.

stop_editing(save:bool|None=None)

Starts an edit session for the current user.

Parameter

Description

save

Optional Boolean. States if the values should be saved. If the valueis set, it will override thesave_edits property.

Returns:

Boolean. True if successful else False.

stop_reading()

Stops and releases a reading session.

Returns:

Boolean. True if successful else False.

propertytables

returns the tables in theFeatureLayerCollection

propertyutility

provides access to the utility service manager

propertyvalidation

Provides access to a validation manager.

Returns:

ValidationManager

ParcelFabricManager

classarcgis.features._parcel.ParcelFabricManager(url,gis,version,flc)

The Parcel Fabric Server is responsible for exposing parcel managementcapabilities to support a variety of workflows from different clientsand systems.

Parameter

Description

url

Required String. The URI to the service endpoint.

gis

RequiredGIS. The enterprise connection.

version

RequiredVersion. This is the version object where the modificationwill occur.

flc

RequiredFeatureLayerCollection . This is the parent container forParcelFabricManager.

analyze_least_squares_adjustment(analysis_type:str='CONSISTENCY_CHECK',convergence_tolerance:float=0.05,parcel_features:dict[str,Any]|None=None,future:bool=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 theinput parcels. A least-squares adjustment is a mathematical procedure that uses statisticalanalysis to estimate the most likely coordinates for connected points in a measurement network.

Useapply_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 onparcel lines for inconsistencies and mistakes. Fixed or weighted control points will not beused by the adjustment.

  • WEIGHTED_LEAST_SQUARES - A weighted least-squares adjustment will be run to compute updatedcoordinates for parcel points. The parcels being adjusted should connect to at least two fixedor 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 leastsquares adjustment is run repeatedly (in iterations) until the solution converges. The solution isconsidered converged when maximum coordinate shift encountered becomes less than the specified convergencetolerance.

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. IfTrue, the request is processed as anasynchronous job and a URL is returned that points a locationdisplaying the status of the job.

The default isFalse.

Returns:

Boolean.True if successful elseFalse

apply_least_squares_adjustment(movement_tolerance:float=0.05,update_attributes:bool=True,future:bool=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 storedin the AdjustmentLines and AdjustmentPoints feature classes are applied to the corresponding parcel line, connection line,and parcel fabric point feature classes.

Useanalyze_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 betweenthe adjustment point and the parcel fabric point is greater than the specified tolerance, the parcel fabricpoint 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 withstatistical metadata. The XY Uncertainty, Error Ellipse Semi Major, Error Ellipse Semi Minor, andError Ellipse Direction fields will be updated with the values stored in the same fields in the AdjustmentPointsfeature class.

The default isTrue

future

Optional boolean. IfTrue, the request is processed as an asynchronous job and a URL is returned that points a locationdisplaying the status of the job.

The default isFalse.

Returns:

Boolean.True if successful elseFalse

assign_to_record(features:list[dict[str,Any]],record:str,write_attribute:str,moment:int|str|None=None,future:bool=False)

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

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 specifiedparcel features.

write_attribute

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

Allowed Values:

CreatedByRecord orRetiredByRecord

moment

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Boolean.True if successful otherwiseFalse

build(extent:dict|Envelope|None=None,moment:int|str|None=None,return_errors:bool=False,record:str|None=None,future:bool=False)

Abuild will fix known parcel fabric errors.

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

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

Parameter

Description

extent

OptionalEnvelope . 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 whenthey do not want to use the current moment

return_errors

Optional Boolean. IfTrue, a verbose response will be given if errorsoccured. The default isFalse.Deprecated

record

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Boolean.True if successful elseFalse

change_type(parcels:list[dict[str,Any]],target_type:str,parcel_subtype:int|str=0,moment:int|str|None=None,future:bool=False)

Changes a set of parcels to a new parcel type. It creates newpolygons and lines and deletes them from the source type. Thisis used when a parcel was associated in the wrong parcel type subtypeand/or when creating multiple parcels as part of a build process.Example: when lot parcels are created as part of a subdivision, theroad 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 meaningno subtype required.

moment

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Boolean.True if successful elseFalse

clip(parent_parcels:list[dict[str,Any]],clip_record:str|None=None,clipping_parcels:list[dict[str,Any]]|None=None,geometry:Polygon|None=None,moment:int|str|None=None,option:str|None=None,area_unit:str|None=None,future:bool=False)

Clip cuts a new child parcel into existing parent parcels. Commonlyit retires the parent parcel(s) it cuts into to generate a reminderchild parcel. This type of split is often part of aparcel splitmetes 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 clipinto the parent parcels. Parcel lineage is created if the child‘clipping_parcels’ and the parcels being clipped are of the sameparcel type.

Syntax:

clipping_parcels=<"id":"parcelguid","layerId":"<layerid>"...>

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

Note

Eitherclipping_parcels orgeometry 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

Eitherclipping_parcels orgeometry is required.

moment

Optional String. This should only be specified by the client whenthey 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 statedareas of the clipped parcels. The stated area of the clipped parcelswill be calculated if the stated areas exist on the parent parcelsbeing clipped.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

copy_lines_to_parcel_type(parent_parcels:list[dict[str,Any]],record:str,target_type:int|str,moment:int|str|None=None,mark_historic:bool=False,use_source_attributes:bool=False,attribute_overrides:dict[str,Any]|None=None,use_polygon_attributes:bool=False,parcel_subtype:int|None=None,future:bool=False)

Copy lines to parcel type is used when the construction of thechild parcel is based on parent parcel geometry. It creates acopy of the parent parcels lines that the user can modify (insert,delete, update) before they build the child parcels. If the sourceparcel 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 legalrecord.

target_type

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

moment

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

mark_historic

Optional Boolean. Mark the parent parcels historic. The default isFalse.

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 newchild parcel lines when it is set toTrue. The default isFalse.

use_polygon_attributes

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

attribute_overrides

Optional Dictionary. To set fields on the child parcel lines with aspecific 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. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

create_seeds(record:str,moment:int|str|None=None,extent:dict|Envelope|None=None,future:bool=False)

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

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

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

Parameter

Description

record

Required String. AGUID representing the record that will beassigned to the features set as current or historic.

moment

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

extent

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

delete(parcels:list[dict[str,Any]],moment:int|str|None=None,future:bool=False)

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

Parameter

Description

parcels

Required List. The parcels to erase.

moment

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

divide(divide_parcel_guid:str,divide_parcel_type:int|str|None,divide_record:str,divide_option:str,divide_number_of_parts:int|str,divide_part_area:float|int,divide_line_bearing:float,divide_left_side:bool,divide_distribute_remainder:bool,default_area_unit:int|str|None=None,divide_cogo_line_bearing:float=None,divide_associated_lines:bool=False,future:bool=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 identifierguid of theparcel being divided.

divide_parcel_type

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

divide_record

Required String. Parameter for the unique identifierguid of therecord 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 willbe 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. Adefault value of 0 will be applied.

divide_line_bearing

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

divide_left_side

Required Boolean. Parameter indicating if area being divided isstarting from the leftmost edge of the parcel. Any remainder areawill be to the right of the divided parts. IfFalse, the area beingdivided starts from the rightmost edge of the parcel and any remainderarea will be to the left of the divided parts.

This parameter is required for theEqualArea andEqualWidthdivide options.

Note

This value is ignored when dividing by proportional area. Adefault value ofFalse will be applied.

divide_distribute_remainder

Required Boolean. Indicates whether to distribute or merge theremainder area after the divide is performed. This parameter is usedfor theEqualArea andEqualWidth divide options.

Note

This value is ignored when dividing by proportional area. Adefault value ofFalse will be applied.

default_area_unit

Required Integer. The units in which area will be stored. The parameteris specified as a domain code from thePF_AreaUnits parcel fabricdomain.

#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 fieldof the dividing lines.

divide_associated_lines

Optional boolean. If true, boundary lines of divided parcels will be split.The original parent lines will be set as historic.

The default isFalse.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

duplicate(parcels:list[dict[str,Any]],parcel_type:int|str,record:str,parcel_subtype:int|str|None=None,repeat_count:int|str|None=None,update_field:str=None,start_value:int|str|None=None,increment_value:int|str|None=None,moment:int|str|None=None,future:bool=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. AGUID representing the record that will beassigned 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 (thedefault is the version current moment). This should only bespecified by the client when they do not want to use the currentmoment.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

propertylayer

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

merge(parent_parcels:list[dict[str,Any]],target_parcel_type:str,attribute_overrides:dict[str,Any]|None=None,child_name:str|None=None,default_area_unit:int|None=None,merge_record:str|None=None,merge_into:str|None=None,moment:int|str|None=None,future:bool=False)

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

Parameter

Description

parent_parcels

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

target_parcel_type

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

attribute_overrides

Optional List. A list of attributes to set on the child parcel, ifthey 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 historyis created.

merge_into

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

moment

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

area_unit

Optional Integer. Represents the default area units to be used whencalculating the stated area of the merged parcel. The stated area ofthe merged parcel will be calculated if the stated areas exist onthe parcels being merged.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

propertyproperties

returns the properties of the service

reassign_features_to_record(source_record:str,target_record:str,delete_source_record:bool,future:bool=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 recordpolygon of the target record will be updated to match the cumulative geometry of all theparcels associated to it.

The Created By Record or Retired By Record attribute field of theparcel features is updated with the global ID of the assignedrecord.

Parameter

Description

source_record

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

Syntax:

source_record=<guid>

target_record

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

Syntax

target_record=<guid>

delete_source_record

Required Bool. Parameter indicating whether to delete the originalsource record.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Boolean

reconstruct_from_seeds(extent:dict|Envelope,future:bool=False)

This operation constructs parcels from seeds enclosed by parcel lines in the specified extent. The tool reconstructs parcels regardless of the parcellines 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 intoparcels.

Syntax:

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

set_line_label_position(parcel_line_features:list[dict[str,Any]],future:bool=False)

Theset_line_label_position() sets the label position of the line’s COGO dimension to theleft 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 withlabel positions that will be updated.

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

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

transfer_parcel(transfer_parcel_feature:dict[str,Any],target_parcel_features:list[dict[str,Any]],record:str,default_area_unit:int,source_parcel_features:list[dict[str,Any]]|None=None,future:bool=False)

Thetransfer_parcel() method supports workflows for transferringa 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 landwill be transferred. These parcels will be merged with the transferparcel and will become larger.

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

record

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

default_area_unit

Required Integer. The units in which area will be stored. The parameteris specified as a domain code from thePF_AreaUnits parcel fabricdomain.

#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 whichland will be transferred. These parcels will be clipped and willbecome smaller.

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

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

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

update_history(features:list[dict[str,Any]],record:str,moment:int|str|None=None,set_as_historic:bool=False,future:bool=False)

Sets the specified parcel features to current or historic using thespecified record. If setting current parcels as historic, theRetired By Record field of the features is updated with the GlobalID of the specified record. If setting historic parcels as current,the Created By Record field of the features is updated with theGlobal 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. AGUID representing the record that will beassigned to the features set as current or historic.

moment

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

set_as_historic

Optional Boolean. Boolean parameter representing whether to set thefeatures as historic (True). IfFalse, features will be set ascurrent.

future

Optional boolean. IfTrue, the request is processed as an asynchronousjob and a URL is returned that points a location displaying the statusof the job.

The default isFalse.

Returns:

Dictionary indicating ‘success’ or ‘error’

TopographicProductionManager

classarcgis.features._topographic.TopographicProductionManager(url,gis=None)

The Topographic Production Service resource represents a topographicproduction server object extension (SOE). It is the entry pointfor all functionality related to creating topographic products in ArcGIS Server.This resource provides information about the service and enablesthe 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 ServerAdvanced license and a Production Mapping Server orDefense Mapping Server license.

Inputs

Description

url

Required String. The web endpoint to the topographic service.

gis

Optional GIS. The enterprise connection tothe Portal site. A connection can be passedin such as a Service Directory connection.

add_product(product_definition:dict,raster:str=None,ancillary_layers:list[dict]=None)

The add_product operation adds a definition of a map product tothe 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 toinclude 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 thesame portal site as the server object extension (SOE)or services that are publicly available.The featureClass, map, and layerIndex propertiesin the array are optional. If the dataset isidentifiable from the feature service, it is notnecessary to provide the featureClass property.The default values are 0 for layerIndex and BaseMapfor map.

Returns:

True if succeeded and False if failed.

calculate_extent(name:str,version:str,area_interest_layer:str,input_geometry:dict,out_sr:str)

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 theproduct’s area of interest.

input_geometry

Required dictionary. A geometry defining the centerof the custom extent. A point geometry.

out_sr

Required string. The coordinate system for theextent that is returned.

Returns:

True if success and False otherwise.

generate_product(name:str,version:str|list[dict],area_interest_layer:str,area_interest_feature_id:str,output_type:dict,custom_area_interest:list[dict]|None=None,layer_exclusion:list[str]|None=None,ancillary_layers:list[dict]|None=None,output_settings:dict|None=None)

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

Parameter

Description

name

Required string. The name of the product.This parameter’s value must match one of the product names from “https://<topographicProductionServer-url>/products”.

version

Required list of dictionaries or string. The version of the product to generate.The product version name must match aname value listed in theproducts endpoint.

Starting at Enterprise 11.2, the following properties can be included:*extractionDatabase - Overwrite theextractionDatabase value at the map product level.*operationOverrides - Overwrite the values in tehparameters key-value pairs with the specified IDS.*excludeOperations - Exclude the specified IDs.

The following example includes three product versions: TRD_4_5, TRD_4_5_1, and TRD_4_6. The TRD_4_5 productversion showsoperationOverrides andexcludedOperations available at Enterprise11.2:

[{"name":"TRD_4_5","template":"MTM50_Layout.pagx""extractionDatabase":"","operationOverrides":[{"id":"26C62049-A11F-4D5B-BC80-00CF3597555C","parameters":[{"name":"input_map","value":"Map"},]},"excludedOperations":["45B62049-A11F-4D5B-BC80-00CF3597555C",...]},{"name":"TRD_4_5_1","template":"MTM50_Layout.pagx"},{"name":"TRD_4_6","template":"MTM50_Layout.pagx"}]

area_interest_layer

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

area_interest_feature_id

Required string. The Object ID of the area of interestfeature in the area_interest_layer.

Note

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

output_type

Required string value that specifies the output type.Supported values include “aprx” , “ppkx” , “pagx” , “pdf” , and “tiff” .

Additional files can be formatted using theoutputFiles parameter.Use JSON to customize the output type of a file.SupportedoutputFiles values include Geodatabase , Raster , ProductTemplate , and Project .

Syntax:{"outputType":"pdf","outputFiles":["Geodatabase","Raster","ProductTemplate","Project"]}

Note

By default, the APRX and PAGX output types are exported as ZIP files that include a file geodatabase.

custom_area_interest

Optional list dictionary. The features defining theproduct’s area of interest. One feature is allowed atthe current release.

layer_exclusion

Optional list of strings. The list of layer urls toexclude from the product.

ancillary_layers

Optional list of dictionaries. Additional layers toinclude 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 layersof the final product and don’t extract data to thelocal geodatabase.

Note

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

output_settings

Optional dictionary. The predefined settings for a PDFor TIFF output type. Allowed inputs can either be the nameof a preset file included with the ArcGIS Production Mapping,the ArcGIS Defense Mapping Enterprise product files, or aJSON data structure that identifies the output settings inone of the formats detailed here:Properties

This parameter was added at Enterprise11.0.

Returns:

A dictionary with the jobId and statusUrl.

jobs_manager()

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

Returns:

TopographicProductionJobManager

product(name:str,include_def:bool=True)

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

Parameter

Description

name

Required string. The name of the product.

include_def

Optional bool. Specifies whether the fulljson definition of the map product isincluded.

products(include_def:bool=True)

The products operation retrieves the products that a TopographicProduction Service resource supports.

Parameter

Description

include_def

Optional bool. Specifies whether the fulljson definition of the map product isincluded.

Returns:

The products that are supported as a dictionary.

propertyproperties

returns the properties for the service

remove_product(name:str)

The remove_product operation removes a product from the TopographicProduction 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:str,description:str|None=None,enabled:bool|None=None,sheet_id_field:str|None=None,raster:str|None=None,versions:dict|list[dict]|None=None,ancillary_layers:dict|None=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 aproduct is disabled, thegenerate_productoperation 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 andversions. There are two formats.

If the operation isadd orupdate:```{

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

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

]

If the operation isremove:```{

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

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

]

}

Starting at ArcGIS Enterprise11.2, additional properties can be applied:

  • extractionDatabase - Overwrites the extractionDatabase value at the map product level.

  • operationOverrides - Overwrites the parameters key-value pairs on an existing operation with the provided ID. The ID must match an existing operation.

  • excludedOperations - The operations pertaining to the IDs provided are excluded.

The following example usesoperationOverrides to identify an operation andoverride its parameter key-value pairs with the ones provided andexcludedOperations to identify operations that will be excluded:

[{"name":"TRD_4_5","template":"MTM50_Layout.pagx""extractionDatabase":"","operationOverrides":[{"id":"26C62049-A11F-4D5B-BC80-00CF3597555C","parameters":[{"name":"input_map","value":"Map"},]},"excludedOperations":["45B62049-A11F-4D5B-BC80-00CF3597555C",...]}]

ancillary_layers

Optional dictionary.Indicates the product layers.

Use the following format to add or update layers:

{"operation":"<add | update>","layers":[{"layer":"<url of layer>","featureClass":"<name of feature class to extract to>","map":"<name of map layer will be inserted into>","layerIndex":"<insertion index of layer>"},...]}

Use the following format to remove the layer:

Returns:

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

TopographicProductionJobManager

classarcgis.features._topographic.TopographicProductionJobManager(url:str,gis:GIS)
cancel_job(job_id:str)

The cancel operation cancels a job submitted through thegenerate_productREST 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:str,msg_level:str=None)

The job operation tracks the status of a job executed by thegenerate_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 associatedwith the job.

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

Note

Regardless of the msgLevel value,any errors that a job contains areincluded in the messages array ofthe 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:int|None=None,start_date:datetime=None,end_date:datetime=None,msg_level:str|None=None)

The query operation retrieves the status of jobs executed by thegenerate_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 witha 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 jobsthat started on or after the start date andtime specified. The date and time should beUTC and in ISO 8601 format. If time is notspecified, then midnight is used in thefollowing format: 00:00:00.

end_date

Optional datetime. Retrieves all the jobsthat ended on or after the end date andtime specified. The date and time should beUTC and in ISO 8601 format. If time is notspecified, then 23:59:59 is used.

msg_level

Optional string. The message level associatedwith the job.

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

Note

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

TraceConfiguration

classarcgis.features._trace_configuration.TraceConfiguration(domain_network_name:str,tier_name:str,shortest_path_network_attribute_name:str|None=None,propagators:list[dict]|None=None,target_tier_name:str|None=None,subnetwork_name:str|None=None,filter_bitset_network_attribute_name:str|None=None,traversability_scope:TraversabilityScopeEnum|str|None=TraversabilityScopeEnum.JUNCTIONS_AND_EDGES,filter_scope:FilterScopeEnum|str|None=FilterScopeEnum.JUNCTIONS_AND_EDGES,condition_barriers:list[dict]|None=None,function_barriers:list[dict]|None=None,filter_barriers:list[dict]|None=None,filter_function_barriers:list[dict]|None=None,functions:list[dict]|None=None,nearest_neighbor:dict|None=None,output_filters:list[dict]|None=None,output_conditions:list[dict]|None=None,include_containers:bool=False,include_content:bool=False,include_structures:bool=False,include_barriers:bool=True,validate_consistency:bool=True,validate_locatability:bool=False,include_isolated:bool=False,ignore_barriers_at_starting_points:bool=False,include_up_to_first_spatial_container:bool=False,allow_indeterminate_flow:bool|None=None,use_digitized_direction:bool=False,synthesize_geometry:bool=False)

Parameter

Description

domain_network_name

Required string. Specifies the name of the domain networkwhere the trace is starting. This is required forsubnetwork-based traces.

tier_name

Required string. Specifies the name of the tier where thetrace is starting. This is required for subnetwork-basedtraces and is ignored whenuse_digitized_direction is True.

shortest_path_network_attribute_name

Required string for a shortest path trace; otherwise,it’s optional. It specifies the network attribute nameused 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 anupstream or downstream trace ends. This is ignored whenuse_digitized_direction is True.

subnetwork_name

Optional string. Specifies the name of the subnetwork thatbe traced. The starting points of the trace are the controllersof this subnetwork.

filter_bitset_network_attribute_name

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

traversability_scope

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

filter_scope

Optional FilterScopeEnum or string specifying the networkelement types to which the filter barriers or filterfunction barriers apply. The default is junctionsAndEdges.

condition_barriers

Optional list of dictionaries.Each dictionary representsnetwork attribute or category conditions that serve asbarriers (the default is null).If is_specific_value is true, the network attribute iscompared to a specific value; otherwise, the networkattribute 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 representsa 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 representsnetwork attribute or category conditions that serve asbarriers (the default is null). If is_specific_value istrue, the network attribute is compared to a specific value;otherwise, the network attribute is compared toanother 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 representsa 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 representsa function. Each function can have an optional list ofnetwork 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 neededfor 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 featuresreturned 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 containersin the trace result. The default is false.

include_content

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

include_structures

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

include_barriers

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

validate_consistency

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

validate_locatability

Optional property specifying whether to validate whethertraversed junction or edge objects have the necessarycontainment, attachment, or connectivity association intheir association hierarchy. The default is false.

include_isolated

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

ignore_barriers_at_starting_points

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

include_up_to_first_spatial_container

Optional property specifying whether to limit the containersreturned in the trace result. This property depends on theinclude_containers property and no-ops if include_containersis false. If includeContainers is true and this propertyis true, containment associations up to and including thefirst spatial container are returned; otherwise, allcontainment associations are returned. The default is false.

allow_indeterminate_flow

Optional property specifying whether network featureswith indeterminate flow stop traversability or are includedin the trace results. This property is only honored whenrunning an upstream, downstream, or isolation trace.

use_digitized_direction

Optional boolean. Introduced at Enterprise 11.3, this propertyspecifies whether the direction of flow will be based on thedigitized direction of the line, from global ID to global ID ofthe edge object in association, and the Flow direction attribute.Applies when thetrace_type is ‘upstream’ or ‘downstream’, otherwiseit is ignored. The default is false.

synthesize_geometry

Optional boolean. Introduced at Enterprise 11.3, this propertyspecifies whether the geometries will be inferred and created(synthesized) for associations and edge objects traversedduring a trace operation. This property is only applicable whenusing the ‘aggregatedGeometry’ type forresult_type. The defaultis false.

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'
classmethodfrom_config(config)TraceConfiguration

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
synthesize_geometry:bool=False
target_tier_name:str|None=None
tier_name:str
to_dict()
traversability_scope:TraversabilityScopeEnum|str|None='junctionsAndEdges'
use_digitized_direction:bool=False
validate_consistency:bool=True
validate_locatability:bool=False

TraceConfigurationsManager

classarcgis.features._utility.TraceConfigurationsManager(url,version=None,gis=None,service_url=None)

The traceConfigurations resource provides access to all trace configurationoperations for a network service. It is returned as an array of named traceconfigurations with the creator, name, and global ID for each.

The TraceConfigurationsManager allows methods to be done on a trace configuration.

alter(global_id:str,name:str|None=None,description:str|None=None,trace_type:str='connected',trace_config:dict|TraceConfiguration|None=None,result_types:list[dict]|None=None,tags:list[str]|None=None)dict

The alter operation provides the ability to alter a single namedtrace configuration. A named trace configuration can only be alteredby an administrator or the creator of the configuration.For example, you can update an existing trace configuration toaccommodate changes in the network or address incorrectly set parameterswithout the need to delete and re-create a trace configuration.This enables existing map services to continue use of the named traceconfiguration without requiring the map to be republished.

Parameter

Description

global_id

Required String. Specifying the global ID ofthe named trace configuration to alter.

name

Optional String. The altered name of the traceconfiguration.

description

Optional String. Specify the altered descriptionof the trace configuration.

trace_type

Optional String. Specify the core algorithm thatwill be used to analyze the network. Trace typescan be configured using thetrace_config parameter.

Values:

“connected” | “subnetwork” | “upstream” | “subnetworkController” | “downstream” | “loops” | “shortenPath” | “isolation”

trace_config

Optional Dictionary or instance of TraceConfigurationclass. Specify the collection ofaltered trace configuration properties.

See:Properties

result_types

Optional List of Dictionary. Specify the alteredtypes of results to return.

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

tags

Optional List of String(s). Specify the altereduser-provided tags.

Returns:

A dictionary with key “success” indicating True or False.

create(name:str,trace_type:str,trace_config:dict|TraceConfiguration,description:str|None=None,result_types:list[dict]|None=None,tags:list[str]|None=None)dict

The create operation on the traceConfigurations resource provides theability to create a single named trace configuration. Named traceconfigurations store the properties of a complex trace in a utilitynetwork and can be shared through a map service consumed by a web mapor field app. Multiple parameters and properties are provided withthe create operation that support the analytic workflows associatedwith the trace operation.

If your trace configuration already exists, use the query method to find it.

Parameter

Description

name

Required String. The altered name of the traceconfiguration.

trace_type

Required String. Specify the core algorithm thatwill be used to analyze the network. Trace typescan be configured using thetrace_config parameter.

Values:

“connected” | “subnetwork” | “upstream” | “subnetworkController” | “downstream” | “loops” | “shortenPath” | “isolation”

trace_config

Required Dictionary or TraceConfiguration object.Specify the collection ofaltered trace configuration properties.

See:Properties

description

Optional String. Specify the altered descriptionof the trace configuration.

result_types

Optional List of Dictionary. Specify the alteredtypes of results to return.

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

tags

Optional List of String(s). Specify the altereduser-provided tags.

Returns:

A dictionary with key “success” indicating True or False.

delete(global_ids:list[str])dict

The delete operation provides the ability to delete one or more namedtrace configurations in a utility network. A named trace configurationcan only be deleted by an administrator or its creator.

Returns:

A dictionary with key “success” indicating True or False.

list()dict

List of all trace configurations in a service.

Returns:

A dictionary with two keys: {“traceConfigurations”: list, “success”: bool}

query(global_ids:list[str]|None=None,creators:list[str]|None=None,tags:list[str]|None=None,names:list[str]|None=None,as_trace_configuration_class:bool=False)dict

The query operation returns all properties from one or morenamed trace configurations in a utility network.

Parameter

Description

global_ids

Optional list of strings. Specify the globalIDs of the named trace configs to be queried.

creators

Optional list of strings. The creators ofthe named trace configurations to be queried.

tags

Optional list of strings. The user tags ofthe named trace configurations to be queried.

names

Optional list of strings. The names of thenamed trace configurations to be queried.

as_trace_configuration_class

Optional boolean. If True the list for“traceCongifurations” in return will be a listof TraceConfiguration class instances. If False,the list will be a list of dictionaries of traceconfiguration instances. The default is False.

Returns:

A dictionary with two keys: {“traceConfigurations”: list, “success”: bool}

TraceNetworkManager

classarcgis.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. TheVersion class where the branch version will take place.

gis

Optional GIS. TheGIS connection object.

propertyproperties

returns the properties for the service

query_network_moments(moments_to_return:list[str]=['all'],moment:str|None=None)dict

Thequery_network_moments operation returns the moments relatedto the network topology and operations against the topology. Thisincludes when the topology was initially enabled, when it was lastvalidated, 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 toreturn. Default is all.

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

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

moment

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

trace(locations:list[dict],trace_type:str,moment:str|None=None,configuration:dict|TraceConfiguration|None=None,result_types:list[dict]|None=None,run_async:bool=False)dict

A trace refers to a preconfigured algorithm that systematicallytravels a network to return results. Multiple parameters and propertiesare 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 whendirty areas are present. The network topology must be validated to ensure that itreflects the most recent edits or updates made to the network.

Note

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

Parameter

Description

locations

Required list of dictionaries. The locations forstarting points and barriers. An empty array mustbe used when performing a subnetwork trace if asubnetworkName is provided as part of theconfiguration - for example,locations=[].

The location is ignored by the trace if the followingrequired 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 thatwill be executed to analyze the network. Can beconfigured using theconfiguration parameter.

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

moment

Optional Integer. Specifies the session moment. Thisshould only be specified if you do not want to usethe current moment.

Example: moment = <Epoch time in milliseconds>

configuration

Optional dictionary or instance of TraceConfigurationclass. Specifies the collection oftrace configuration properties. Depending on thetrace_type, some properties are required.

To see all configuration properties see:Trace Configuration Properties

result_types

Optional parameter specifying hte types of resultsto return.

Note

ArcGIS Enterprise 10.9.1 or later is required whenusing theconnectivity type.

Returns:

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

a Dictionary of the Trace Results is returned.

trace_configurations()TraceConfigurationsManager

Thetrace_configurations resource provides access to all traceconfiguration 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:dict[str,Any]|Envelope,return_edits:bool=False)dict

Validating the network topology for a trace network maintainsconsistency between feature editing space and network topology space.Validating a network topology may include all or a subset of thedirty areas present in the network. Validation of network topologyis supported synchronously and asynchronously.

Parameter

Description

envelope

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

{"xmin":<minimumx-coordinate>,"ymin":<minimumy-coordinate>,"xmax":<maximumx-coordinate>,"ymax":<maximumy-coordinate>,"spatialReference":{"wkid":<spatialreferencewell-knownidentifier>,"latestWkid":<thecurrentwkidvalueassociatedwiththewkid>}}

return_edits

Optional Boolean. Returned results are organized in a layer-by-layer fashion.Ifreturn_edits is set to True, each layer may have edited featuresreturned in an editedFeatures object.The editedFeatures object returns full features including the originalfeatures 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 shouldinvalidate the cache when exceededTransferLimit = true is returned.If the server encounters an error when generating the listof edits is the response, exceededTransferLimit = true is also returned.

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

Returns:

Dictionary indicating ‘success’ or ‘error’

UtilityNetworkManager

classarcgis.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 ofsubnetworks (managing sources, updating subnetworks, exportingsubnetworks, and so on). The Utility Network Service is conceptuallysimilar to the Network Analysis Service for transportation networks.

Inputs

Description

url

Required String. The web endpoint to the utility service.

version

OptionalVersion. TheVersion class where the branch version will take place.

gis

OptionalGIS . TheGIS connection object.

associations()dict

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

Note

Available starting at Enterprise 10.9.1

Returns:

A dictionary with two keys

{"associations":list,"success":bool}
disable_subnetwork_controller(network_source_id:str,global_id:str,terminal_id:str,out_sr:int|None=None)dict

A subnetwork controller (or simply, a source or a sink) is theorigin (or destination) of resource flow for a subset (or subnetwork)of the network. Examples of subnetwork controllers are circuit breakersin electric networks, town border stations in gas networks, and pumpstations in water networks. Subnetwork controllers correspond to devicesthat have theSubnetwork Controller network category set. A source isremoved with this method.

Parameter

Description

network_source_id

Required String. The network source ID that the subnetworkcontroller participates in.

global_id

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

terminal_id

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

out_sr

Required int. The output spatial reference as a wkid.

disable_topology()dict

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

When the network topology is disabled, the following happens:

  • All current rows in the topology tables are deleted.

  • No dirty areas are generated from edits.

  • Existing errors remain and can be addressed prior to enabling thenetwork topology, without the overhead of dirty areas.

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

  • Operation must be executed by the portal utility network owner.

  • The topology can be disabled in the default version or in a namedversion. If the toplogy is disabled in a named version, thereconcile process can be used to inherit the state from the defaultbranch version.

Returns:

Dictionary indicating ‘success’ or ‘error’

enable_subnetwork_controller(network_source_id:str,global_id:str,terminal_id:str,subnetwork_controller_name:str,tier_name:str,subnetwork_name:str|None=None,description:str|None=None,notes:str|None=None,out_sr:int|None=None)dict

A subnetwork controller is the origin (or destination) of resourceflow for a subset (or subnetwork) of the network (e.g., a circuitbreaker in electric networks, a town border station in gas networks, orpump stations in water networks). Controllers correspond to Devices thathave theSubnetwork Controller network category set.

Parameter

Description

network_source_id

Required String. The network source ID that the subnetwork controllerparticipates in.

global_id

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

terminal_id

Required String. The terminal ID for the terminal on the device beingenabled 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:int=10000)dict

Enabling the network topology for a utility network is done on theDEFAULT version. Enabling isnot supported in named versions.When the network topology is enabled, all feature and association editsgenerate dirty areas, which are then cleaned when the network topologyis validated.

When the network topology is enabled, the following happens:- Existing errors are deleted.- The topology is built for the full extent of the network.- Error dirty areas are created for any newly discovered errors.- The network topology is marked as enabled.

Note

The active portal account must be licensed with theAdvanced Editinguser type extension to use this operation.

Parameter

Description

error_count

Optional Integer. Sets the threshold when theenable_topology willstop if the maximum number of errors is met. The default value is10,000.

Returns:

Dictionary indicating ‘success’ or ‘error’

export_subnetwork(domain_name:str,tier_name:str,subnetwork_name:str,trace_configuration:dict|TraceConfiguration|None=None,export_acknowledgement:bool=False,result_type:list[dict]|None=None,result_types:list[dict]|None=None,moment:int|None=None,run_async:bool=False,out_sr:int|None=None,pbf:bool=False)dict

Theexport_subnetwork operation is used to export information about asubnetwork into a JSON file. That information can then be consumed byoutside systems such as outage management and asset tracking. Theoperation allows you to delete corresponding rows in the Subnetworkstable as long as theIsDeleted attribute is set toTrue. Thisindicates a subnetwork controller feeding the subnetwork has beenremoved.

Parameter

Description

domain_name

Required String. The name of the domain network of which the subnetworkis 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 thecollection of trace configuration parameters.See:Trace

export_acknowledgement

Optional Boolean. Specify whether the export is acknowledged.

result_type

** Deprecated, useresult_types instead. **

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. Unix Epoch time in milliseconds. Specify thesession 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.The default from the REST is False. In Pro, starting at 3.3, the default is True so makesure to setpbf to True if you want to mimic that response.

Returns:

A dictionary with keys and value types of:

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

Note

When the Features, Connectivity, or Containment and attachmentassociationsresult_types options are specified, the output.json file includes asourceMapping element which allows youto look up the layer name associated with eachnetworkSourceId.

locations()dict

Thelocations resource provides access to an operation that allowsyou to query the locatability of a provided set of objects andoptionally synthesize geometry to be returned.

Introduced at Enterprise 10.9.1

Returns:

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

propertyproperties

returns the properties for the service

query_associations(elements:list[dict]|None=None,moment:int|None=None,types:list[str]|None=None,return_deletes:bool=False)dict

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

Note

Available starting at Enterprise 10.9.1

Parameter

Description

elements

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

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

moment

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

types

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

Values:

  • “connectivity”

  • “attachment”

  • “containment”

  • “junctionEdgeFromConnectivity”

  • “junctionMidspanConnectivity”

  • “junctionEdgeToConnectivity”

return_deletes

Optional Boolean. Specify whether to return logically deleted associations.

query_locations(elements:list[dict],max_geom_count:int,moment:int|None=None,attachment_associations:bool=False,connectivity_associations:bool=False,containment_associations:bool=False,locations:bool=False,out_sr:int|dict|None=None)dict

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

Parameter

Description

elements

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

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

max_geom_count

Required Integer. The maximum number of geometries that can be synthesizedand returned in the result.

moment

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

attachment_associations

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

connectivity_associations

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

containment_associations

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

locations

Optional Boolean. Specify whether to synthesize the geometry representingthe derived location of the object. This option only affects theresults 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:list[str]|None=None,moment:int|None=None)dict

Thequery_network_moments operation returns the moments relatedto the network topology and operations against the topology. Thisincludes when the topology was initially enabled, when it was lastvalidated, 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 toreturn. Default is all.

Values:

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

>>># Example Usage:>>>query_network_moments(moments_to_return=["enableTopology","initialEnableTopology"],                          ...)

moment

Optional Integer. Unix Epoch time in milliseconds. Specify thesession 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}

synthesize_association_geometries(attachment_associations:bool=False,connectivity_associations:bool=False,containment_associations:bool=False,count:int=200,extent:dict=None,out_sr:int|dict[str,Any]|None=None,moment:int|None=None)dict

Thesynthesize_association_geometries operation is used to exportgeometries representing associations that are synthesized as linesegments corresponding to the geometries of the devices at theendpoints. All features associated with an association must be inthe 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 thatcan be synthesized and returned in the result.

extent

Required Dictionary. Represents the envelope of the area tosynthesize association geometries.

{"xmin":<minimumx-coordinate>,"ymin":<minimumy-coordinate>,"xmax":<maximumx-coordinate>,"ymax":<maximumy-coordinate>,"spatialReference":{"wkid":<spatialreferencewell-knownidentifier>,"latestWkid":<thecurrentwkidvalueassociatedwiththewkid>}}

out_sr

Optional Dictionary. Represents the output spatial reference.

moment

Optional Integer. Unix Epoch time in milliseconds. Specify thesession 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:list[dict],trace_type:str,moment:int|None=None,configuration:dict|TraceConfiguration|None=None,result_type:list[dict]|None=None,result_types:list[dict]|None=None,trace_config_global_id:str|None=None,out_sr:int|None=None,pbf:bool=False)dict

A trace refers to a pre-configured algorithm that systematically travelsa network to return results. Generalized traces allow you to traceacross multiple types of domain networks. For example, running aConnected trace through your electric network. An assortment of optionsis provided with trace to support various analytic workflows. All tracesuse the network topology to read cached information about networkfeatures. This is done to improve performance of complex traces on largenetworks. Trace results are not guaranteed to accurately represent autility network when dirty areas are present. The network topology must bevalidated to ensure it reflects the most recent edits or updates made tothe network

Note

The active portal account must be licensed with theAdvanced Editinguser type extension to use this operation.

Note

When the Elements, Features, Connectivity, or Containment and attachmentassociations result_types options are specified, the output .json fileincludes a sourceMapping element. This element allows you to look up thelayer name associated with each networkSourceId. To learn more, seeConfigure a trace

Returns:

A dictionary with keys and value types of:

{
“traceResults”: {
“elements”: list,
}
”success”: bool
}

trace_configurations()TraceConfigurationsManager

Thetrace_configurations resource provides access to all traceconfiguration 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:

ATraceConfigurationsManager object.

traverse_associations(elements:list[dict],moment:int|None=None,type:str='unspecified',direction:str='descending',dirty_filter:str='none',error_filter:str='none',stop_at_first_spatial:bool=True,max_depth:int|None=None)dict

Thetraverse_associations operation allows you to obtain and extract usefulinformation from the associations table in a utility network.

Thetype 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 thedirection,dirty_filter,error_filter,stop_at_first_spatial, andmax_depth parameters can be used. When a traversal type is specified using the type parameter other than the defaultunspecified`, these parameters are ignored.

Available starting at Enterprise 10.9.1

Note

Associations are not traversed from spatial features to nonspatial objectsand back to spatial features when the exit filter is placed on the firstspatial feature.

Parameter

Description

elements

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

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

moment

Optional Epoch time in milliseconds. Specify if you do not want touse 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 statusof the association.

Note

Whendirty_filter anderror_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 theerror code.

Values:

“none” | “inError” | “notInError”

stop_at_first_spatial

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

max_depth

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

update_is_connected()dict

Utility network features have an attribute calledIsConnected thatlets you know if a feature is connected to a subnetwork controller, andcould potentially be part of an existing subnetwork. This operationupdates this attribute on features in the specified utility network.This operation can only be executed on the default version by the portalutility network owner.

update_subnetwork(domain_name:str,tier_name:str,subnetwork_name:str|None=None,all_subnetwork_tier:bool=False,continue_on_failure:bool=False,trace_configuration:dict|None=None)dict

A subnetwork is updated by calling the update_subnetwork operation. Withthis operation, one or all of the subnetworks in a single tier can beupdated. When a subnetwork is updated, four things can occur; theSubnetwork Name attribute is updated for all features in the subnetwork,the record representing the subnetwork inside the SubnetLine featureclass is generated or updated, rows for the subnetwork controllers in theSubnetworks table are updated, and diagrams are generated or updated forthe subnetwork.

Parameter

Description

domain_name

Required String. The name of the domain network that the subnetworkis 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. Ifthis parameter is not specified, theall_subnetwork_tier parametershould be set toTrue, otherwise an error will occur.

all_subnetwork_tier

Optional Boolean. Set toTrue when all the subnetworks in a tierneed to be updated.

continue_on_failure

Optional Boolean. Continue updating subnetworks whenall_subnetwork_tierisTrue and a failure occurs when processing a subnetwork.

trace_configuration

Optional Dictionary. Represents the collection of trace configurationparameters. Seetrace method to get parameters.

Returns:

Dictionary of the JSON response.

validate_topology(envelope:dict[str,Any],run_async:bool=False,return_edits:bool=False,validate_set:list[dict]|None=None,out_sr:int|None=None)dict

Validating the network topology for a utility network maintainsconsistency between feature editing space and network topology space.Validating a network topology may include all or a subset of thedirty areas present in the network. Validation of network topologyis supported synchronously and asynchronously.

Parameter

Description

envelope

Required Dictionary. The envelope of the area to validate.

{"xmin":<minimumx-coordinate>,"ymin":<minimumy-coordinate>,"xmax":<maximumx-coordinate>,"ymax":<maximumy-coordinate>,"spatialReference":{"wkid":<spatialreferencewell-knownidentifier>,"latestWkid":<thecurrentwkidvalueassociatedwiththewkid>}}

run_async

Optional Boolean. IfTrue the request is processed as anasynchronous 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.Ifreturn_edits is set to True, each layer may have edited featuresreturned in aneditedFeatures object.The editedFeatures objectreturns full features including the original features prior toto delete; the original and current features for updates; and thecurrent 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 shouldinvalidate the cache when exceededTransferLimit = true is returned.If the server encounters an error when generating the listof edits is the response, exceededTransferLimit = true is also returned.

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

validate_set

Optional List of Dictionary. Introduced at Enterprise 10.9.1, it specifiesthe 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

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

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

evaluate(evaluation:list[str],area:dict[str,Any]|None=None,changes_in_version:bool=False,selection:list[dict[str,Any]]|None=None,return_edits:bool=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

OptionalEnvelope /Dict. Extent of the area to evaluate.

changes_in_version

Optional Boolean. representing whether to perform the evaluation onthe 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 isupdated. This is listed as a property for a version and can beaccessed using the version resource and the version infos operation.

selection

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

If theevaluation_type istopology 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. Ifreturn_edits is set to true, each layer may have edited featuresreturned.

The default for this parameter is false. Always set to true whenevaluatingtopology for a parcel fabric.

Returns:

The number of new errors identified along with the moment.

propertyproperties

service properties

update_error(error_features:list[dict[str,Any]],version:str|None=None,return_edits:bool=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 toerrors update. Results returned are organized in a layer by layerfashion. If it is set toTrue, each layer may have edited featuresreturned in an editedFeatures object.

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

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

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

The default for this parameter is False.

Returns:

Dictionary indicating ‘success’ or ‘error’

WebHookServiceManager

classarcgis.features.managers.WebHookServiceManager(url,fc,gis)

TheWebHookServiceManager allows owners and administrators wire featureservice specific events toFeatureLayerCollection.

create(name:str,hook_url:str,change_types:WebHookEvents|str=WebHookEvents.ALL,signature_key:str|None=None,active:bool=False,schedule_info:dict[str,Any]|WebHookScheduleInfo|None=None,payload_format:str='json',content_type:str|None=None)WebHook

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 acomma separated list of values that will fire off the web hook. The listeach supported type is below.

signature_key

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

active

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

schedule_info

Optional Dict orWebHookScheduleInfo. 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 isjson.

content_type

Optional String. The Content Type is used to indicate the media type of theresource. The media type is a string sent along with the file indicatingthe 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:

AWebHook object

delete_all_hooks()bool

Thedelete_all_hooks operation will permanently remove the specified webhook.

Returns:

Bool, True if successful

disable_hooks()bool

Thedisable_hooks will turn off all web hooks for the current service.

Returns:

Bool, True if successful

enable_hooks()bool

Theenable_hooks operation restarts a deactivated webhook. Whenactivated, payloads will be delivered to the payload URL when thewebhook is invoked.

Returns:

Bool, True if successful

propertylist:tuple

Get a list of web hooks on theFeatureLayerCollection

Returns:

tuple[WebHook]

propertyproperties:PropertyMap

Gets the properties for the WebHook Service Manager and returnsa PropertyMap object

WebHook

classarcgis.features.managers.WebHook(url,gis)

The Webhook represents a single hook instance.

delete()bool

Deletes the current webhook from the system

Returns:

Boolean, True if successful

edit(name:str|None=None,change_types:WebHookEvents|str|None=None,hook_url:str|None=None,signature_key:str|None=None,active:bool|None=None,schedule_info:WebHookScheduleInfo|dict[str,Any]|None=None,payload_format:str|None=None)dict

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

OptionalWebHookEvents or String.The default is “*”, which means all events. This is acomma separated list of values that will fire off the web hook. The listeach supported type is below.

signature_key

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

active

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

schedule_info

OptionalWebHookScheduleInfo 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 isjson.

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.

propertyproperties:PropertyMap

Returns the WebHook’s properties

Returns:

PropertyMap

WebHookEvents

classarcgis.features.managers.WebHookEvents(value,names=None,*,module=None,qualname=None,type=None,start=1,boundary=None)

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

classarcgis.features.managers.WebHookScheduleInfo(name:str,start_at:datetime,state:str='enabled',frequency:str='minute',interval:int=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 beenabled ordisabled.

frequency

Optional String. The default isminute. 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()dict[str,Any]

returns the dataclass as a dictionary

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

NetworkDiagramManager

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

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

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

Note

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

Inputs

Description

url

Required String. The web endpoint to the utility service.

version

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

gis

Optional GIS. TheGIS connection object.

create_diagram_from_features(template:str,initial_features:list[str])

The create_diagram_from_features operation is performed on a Network DiagramService 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 thenew network diagram will be based on.

initial_features

Required list of strings. A list of utility networkfeatures Global IDs from which the new diagram is goingto be built.

Returns:

A dictionary of the diagram information.

delete_diagram(name:str)

The delete_diagram operation is performed on a Network Diagram Serviceresource.

Parameter

Description

name

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

Returns:

The moment (date) the delete_diagram operation happens.

diagram(name:str)

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

Parameter

Description

name

Required string. The name of the network diagram.

propertydiagram_dataset

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

diagrams(moment:int|None=None)

The Network Diagrams resource represents all the network diagramsunder a Network Diagram service. It is returned as an array of networkdiagram 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:list[str],moment:int|None=None)

The find_diagram_infos operation is performed on a Network Diagram Serviceresource. 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 adiagram 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:int|None=None,extent:dict|None=None,where:str|None=None,features:dict[str,Any]|None=None,exclude_system_diagrams:bool=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 toa network diagram’s name.

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

Parameter

Description

moment

Optional integer. The session moment.

extent

Optional dictionary representing the extent that youwant the network extent of the resulting diagrams tointersect.

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 operatingon some fields in the diagrams table is allowed. Seetable below for the exact list of field names that canbe used.

features

Optional dictionary. A set of utility network featureGlobal IDs, or network diagram feature Global IDsrepresented in a given diagram that are included in theresulting queried diagrams.

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

exclude_system_diagrams

Optional bool. If True, the operation returns anydiagrams except for the subnetwork system diagrams. IfFalse (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.

propertyproperties

returns the properties for the service

query_consistency_state(diagrams_names:list[str],moment:int|None=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 adiagram 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 templateunder a Network Diagram service. It is returned as a JSONobject that provides the list of the diagram layouts and theirproperty 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.

propertytemplates

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

Diagram

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

The Diagram resource represents a single network diagram under a NetworkDiagram 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:list[str])

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 operationhappens 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 networkfeature Global IDs, the features being appended to thediagram resource.

apply_layout(layout_name:str,layer_params:dict[str,Any]|None=None,junction_ids:list=None,container_ids:list=None,edge_ids:list=None,run_async:bool=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 ofthe resource diagram content.

Parameter

Description

layout_name

Required string. The name of the algorithm layout toexecute.

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 algorithmto execute on a diagram part. A list of junction object Idsthat will be processed.

container_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of container object Idsthat will be processed.

edge_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of edge object Idsthat will be processed.

run_async

Optional bool. Specify whether the layout algorithm willrun synchronously or asynchronously.

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

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

apply_template_layouts(junction_ids:list|None=None,container_ids:list|None=None,edge_ids:list|None=None)

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

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

Parameter

Description

junction_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of junction object Idsthat will be processed.

container_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of container object Idsthat will be processed.

edge_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of edge object Idsthat will be processed.

clear_flags(flag_type:str)

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

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

Parameter

Description

flag_type

Required string. The type of flag you want to clear inthe 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:bool=False)

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

Parameter

Description

all_layers

Optional bool. If True, all layers are cached whetherthey contain diagram features or not.If False, only the layers that contain diagram featuresare 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:str,dpi:str|None=None,bbox:str|None=None,format:str='PNGS',transparent:bool=False,map_scale:str|None=None,rotation:int|None=0,bbox_sr:str|None=None,image_sr:str|None=None,moment:int|None=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 theexported image in pixels.

Example: size=”600, 600”

dpi

Optional string. The device resolution of the exportedimage (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 exportedimage. Unless the bbox_sr parameter has been specified,the bbox assumed to be in the spatial reference ofthe map.

The bbox coordinates should always use a period as adecimal separator, even in countries where traditionallya 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 exportedwith the background color of the map set as itstransparent color. The default is false.Only the “PNG” and “GIF” formats support transparency.

Internet Explorer 6 does not display transparencycorrectly for png24 image formats.

map_scale

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

rotation

Optional int. Use this parameter to export a map imagerotated at a specific angle, with the map centeredaround 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 spatialreference of the bbox.

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

image_sr

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

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

moment

Optional int. The session moment.

extend(extend_type:str=None,from_features:list[str]=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 theextend process will execute.

find_diagram_features(from_features:list[str],include_aggregations:bool,add_connectivity_associations:bool,add_structural_attachments:bool,from_diagram:str|None=None,moment:int|None=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 featuresassociated with a set of diagram features that are referenced in the diagram resource.

Parameter

Description

from_features

Required list of strings. Depending on whether youwant to retrieve diagram features associated withutility network features (case#1) or with diagramfeatures 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 utilitynetwork feature Global IDs:*True—The operation returns the diagram features thatstrictly represent those utility network features in thediagram resource, and the diagram features that are associatedwith those utility network features but not represented inthe diagram resource where they are reduced or collapsed.*False—The operation only returns the diagram featuresassociated with those utility network features that arenot reduced nor collapsed in the diagram resource; that is,it only returns the diagram features associated with thoseutility network features that are visibly representedin the diagram resource.

Case#2—When the fromFeatures reference diagram featureGlobal IDs represented in another diagram:*True—The operation returns the diagram featuresassociated with the same utility network featuresthose diagram features are, whether those featuresare reduced or collapsed in this other diagram and/orin the resource diagram.*False—The operation only returns the diagram featuresassociated with the same utility network features thatare visibly represented in this other diagramand in the resource diagram.

add_connectivity_associations

Required boolean. When the from_features reference utilitynetwork 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 connectivityassociation diagram edges represented in the diagram resource.

add_structural_attachments

Required boolean. When the from_features referenceutility 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 structuralattachment diagram edges represented in thediagram resource.

from_diagram

Optional string. The name of the diagram the featureGlobal IDs specified for the from_features parametersbelong to, or null when the from_features parameterreferences utility network features.

moment

Optional integer. The session moment.

find_initial_network_objects(moment:int|None=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 networkfeatures used as input for the diagram build.

Parameter

Description

moment

Optional integer. A session moment.

find_network_features(from_features:list[str],include_aggregations:bool,moment:int|None=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 referencedin the diagram resource that are associated with a set of utilitynetwork features or a set of diagram featuresrepresented in another network diagram.

Parameter

Description

from_features

Required list of strings. A list of diagram networkfeature global IDs.

include_aggregations

Required boolean.*True—The operation returns all the network featuresassociated with the diagram features specified in thefrom_features parameter, whether those featuresare reduced or collapsed in the diagram resource.*False—The operation only returns the network featuresassociated with diagram features specified in thefrom_features parameter that are not reduced orcollapsed in the diagram resource; that is, it onlyreturns the network features associated with the specifieddiagram features that are visibly represented in the diagrams.

moment

Optional integer. A session moment.

get_aggregations(moment:int|None=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:str,moment:int|None=None,out_sr:str|dict|None=None)

The get_flags operation is performed on a Diagram resource.The result of this operation is a JSON Information object thatreturns the list of diagram element IDs bringing a flag, with itsflag 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 searchfor 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 spatialreference of the returned geometry.

identify_diagram_map(geometry:str|dict,tolerance:int,image_display:str,map_extent:str,geometry_precision:int|None=None,return_field_name:bool=False,return_unformatted_values:bool=False,return_z:bool=False,return_m:bool=False,return_geometry:bool=True,max_allowable_offset:int|None=None,geometry_type:str='esriGeometryPoint',sr:str|None=None,moment:int|None=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 thespecified geometry within which the identify should beperformed.

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 areused by the server to determine the layers visiblein the current extent. They are also used to calculatethe distance on the map to search based on the tolerancein screen pixels.

Syntax: image_display=”<width>,<heigth>,<dpi>”

map_extent

Required string. The extent or bbox fo the map currentlybeing viewed. Unless the sr parameter has been specified,the map_extent is assumed to be in the spatial referenceof the map.

Themap_extent andimage_display parameters areused by the server to determine the layers visible inthe current extent. They are also used to calculatethe distance on the map to seach based on thetolerancein screen pixels.

Syntax: map_extent=”<xmin>, <ymin>, <xmax>, <ymax>”

geometry_precision

Optional int. Specify the number of decimal places inthe 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 returnedinstead of field aliases.

return_unformatted_values

Optional bool. If True, the values in the result willnot be formatted. Numbers will be returned as is anddates will be returned as epoch values.

return_z

Optional bool. If True, z value will be included inthe results if the features have z-values.

Only applies ifreturn_geometry=True

return_m

Optional bool. If True, m value will be included inthe results if the features have m-values.

Only applies ifreturn_geometry=True

return_geometry

Optional bool. If True, the result set will includethe geometries associated with each result.

max_allowable_offset

Optional int. This option can be used to specify themaximum allowable offset to be used for generalizinggeometries returned by the identify operation.The max_allowable_offset is in the units of the sr.If sr is not specified, max_allowable_offset isassumed to be in the unit of the spatial reference of the map.

geometry type

Optional string. The type of geometry specified by thegeometry 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 spatialreference of the input and output geometries as wellas the map_extent.

If sr is not specified, the geometry and the map_extentare assumed to be in the spatial reference of the map,and the output geometries are also in the spatial referenceof the map.

moment

Optional int. The session moment.

layer_definitions(all_layers:bool=False,moment:int|None=None)

The Layers Definitions resource details all the layer and labelingproperties that define each sublayer under the diagram layer.

Parameter

Description

all_layers

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

moment

Optional int. The session moment.

manage_flag(flag_type:str,flag_id:str,action:str)

The manage_flag operation is performed on a Diagram resource.This operation returns the moment the manageFlag operation happenswhen it applies on a stored diagram.

It is used to add or remove root junction, end junction, pivotjunction and barrier flags on a particular diagram feature.

Parameter

Description

flag_type

Required string. The type of flag you want to searchfor on the diagram resource.

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

flag_id

Required string. The diagram element id of the diagramfeature to which you want the flag to be added or fromwhich 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 particulardiagram feature.

overwrite_from_features(initial_features:list[str])

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 ofutility network feature Global IDs.

Parameter

Description

initial_features

Required list of strings. A list of utility networkfeature Global IDs, those features being the ones usedto overwrite the diagram resource.

propertyproperties

returns the properties for the service

query_diagram_content(moment:int|None=None,add_diagram_info:bool=False,add_geometries:bool=False,add_attributes:bool=False,add_aggregations:bool=False,use_value_names:bool=False,out_sr:str|dict|None=None)

The query_diagram_content operation is performed on a diagram resource.It returns the diagram content in a simple format that reflects basicconnectivity. Other optional information can also be returned,such as diagram feature geometry, network element attributes with theirstring descriptions rather than raw values for coded domain values, aggregatedelements, and diagram properties.

Parameter

Description

moment

Optional int. The session moment.

add_diagram_info

Optional bool.*True—The operation also returns some extrainformation 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 extrainformation 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 attributesof the utility network feature associated witheach diagram feature.*False—The operation doesn’treturn any attributes (default).

add_aggregations

Optional bool.*True—The operation returns each diagram featurewith the list of the utility network elements itaggregates 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 featureattributes or aggregations are exported, that is,add_attributes = True oradd_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 beexported as raw values. This is the default.

out_sr

Optional dictionary or string. The spatial reference of thereturned geometry.

query_elements_by_extent(extent:dict|None=None,moment:int|None=None,add_contents:bool=False,return_junctions:bool=True,return_edges:bool=True,return_containers:bool=True,return_geometry:bool=True,out_sr:str|dict|None=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—onefor 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 intersectsa specified envelope—this one being optionally enlarged to include anycontainers that may be partially within it.

Parameter

Description

extent

Optional dictionary. Represent the extent you want theresulting diagram features to intersect.

Without specifying this parameter, the operation returnsall 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 strictlyintersect the specified envelope (default)*True—To enlarge the searching envelope so itincludes the extent of any containers that are partiallywithin 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 itsgeometry (default)*False—To not return the geometry.

out_sr

Optional dictionary or string representing the spatialreference of the returned geometry.

query_elements_by_ids(junction_ids:list|None=None,container_ids:list|None=None,edge_ids:list|None=None,moment:int|None=None,add_connected:bool=False,return_geometry:bool=True,out_sr:str|dict|None=None)

The query_elements_by_ids operation is performed on a diagram resource.The result of this operation is a JSON object composed of threearrays—one for the resulting diagram junctions, another for theresulting 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 diagramresource with the specified ObjectIDs. Then when specifying diagram edgeObjectIDs, optionally, extend the resulting set of diagram elements to thejunctions 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 algorithmto execute on a diagram part. A list of junction object Idsthat will be processed.

container_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of container object Idsthat will be processed.

edge_ids

Optional list. For the case you want the layout algorithmto execute on a diagram part. A list of edge object Idsthat will be processed.

moment

Optional integer. The session moment.

add_connected

Optional bool.*False-Doesn’t enlarge the returned diagram junction tothose that are from or to junctions of the specifiededge_ids. (default)*True-Enlarges the returned diagram junctions to thosethat 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 spatialreference for the returned geometry.

save_layout(junctions:list[dict]|None=None,containers:list[dict]|None=None,edges:list[dict]|None=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 aset of diagram features represented in the diagram resource.

Parameter

Description

junctions

Optional list of dictionaries. Provide the new geometryfor each edited junction, those diagram junctions beingidentified thanks to their Diagram Element ID.

Syntax:junctions=[{“ID”: <jctDEID1>, “geometry”: <geometry1>}, …]

containers

Optional list of dictionaries. Provide the new geometryfor each edited container, those diagram containers beingidentified thanks to their Diagram Element ID.

Syntax:containers=[{“ID”: <containerDEID1>, “geometry”: <geometry1>}, …]

edges

Optional list of dictionaries. Provide the new geometryfor each edited edge, those diagram edges beingidentified thanks to their Diagram Element ID.

Syntax:containers=[{“ID”: <edgeDEID1>, “geometry”: <geometry1>}, …]

store(name:str,access:str)

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 tobe stored.

access

Required string. The access right level you want toset for the stored diagram.

Values:* “esriDiagramPublicAccess” - Anyone will have fullaccess rights on the diagram; that is,view/edit/update/overwrite/delete permissions on it.* “esriDiagramProtectedAccess” - Anyone will have viewand read access rights on the diagram, but they will haveno permission for editing/update/overwriting/nordeleting the diagram.* “esriDiagramPrivateAccess” - No access to thediagram—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, synchronizeits content from the network features used to initially generate it,and so reflect any changes that may have impacted those networkfeatures into the diagram.

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


[8]ページ先頭

©2009-2025 Movatter.jp