idx
int64
0
252k
question
stringlengths
48
5.28k
target
stringlengths
5
1.23k
245,800
def clusters ( self ) : if self . _resources is None : self . __init ( ) if "clusters" in self . _resources : url = self . _url + "/clusters" return _clusters . Cluster ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else : ...
returns the clusters functions if supported in resources
245,801
def services ( self ) : if self . _resources is None : self . __init ( ) if "services" in self . _resources : url = self . _url + "/services" return _services . Services ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else :...
Gets the services object which will provide the ArcGIS Server s admin information about services and folders .
245,802
def usagereports ( self ) : if self . _resources is None : self . __init ( ) if "usagereports" in self . _resources : url = self . _url + "/usagereports" return _usagereports . UsageReports ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initia...
Gets the services object which will provide the ArcGIS Server s admin information about the usagereports .
245,803
def kml ( self ) : url = self . _url + "/kml" return _kml . KML ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True )
returns the kml functions for server
245,804
def logs ( self ) : if self . _resources is None : self . __init ( ) if "logs" in self . _resources : url = self . _url + "/logs" return _logs . Log ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else : return None
returns an object to work with the site logs
245,805
def mode ( self ) : if self . _resources is None : self . __init ( ) if "mode" in self . _resources : url = self . _url + "/mode" return _mode . Mode ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else : return None
returns an object to work with the site mode
245,806
def security ( self ) : if self . _resources is None : self . __init ( ) if "security" in self . _resources : url = self . _url + "/security" return _security . Security ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else :...
returns an object to work with the site security
245,807
def system ( self ) : if self . _resources is None : self . __init ( ) if "system" in self . _resources : url = self . _url + "/system" return _system . System ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else : return No...
returns an object to work with the site system
245,808
def uploads ( self ) : if self . _resources is None : self . __init ( ) if "uploads" in self . _resources : url = self . _url + "/uploads" return _uploads . Uploads ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True ) else : retu...
returns an object to work with the site uploads
245,809
def getGroupIDs ( self , groupNames , communityInfo = None ) : group_ids = [ ] if communityInfo is None : communityInfo = self . communitySelf if isinstance ( groupNames , list ) : groupNames = map ( str . upper , groupNames ) else : groupNames = groupNames . upper ( ) if 'groups' in communityInfo : for gp in community...
This function retrieves the group IDs
245,810
def groups ( self ) : return Groups ( url = "%s/groups" % self . root , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = False )
returns the group object
245,811
def group ( self , groupId ) : url = "%s/%s" % ( self . root , groupId ) return Group ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = False )
gets a group based on it s ID
245,812
def invite ( self , users , role , expiration = 1440 ) : params = { "f" : "json" , "users" : users , "role" : role , "expiration" : expiration } return self . _post ( url = self . _url + "/invite" , securityHandler = self . _securityHandler , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _pr...
A group administrator can invite users to join their group using the Invite to Group operation . This creates a new user invitation which the users accept or decline . The role of the user and the invitation expiration date can be set in the invitation . A notification is created for the user indicating that they were ...
245,813
def applications ( self ) : url = self . _url + "/applications" params = { "f" : "json" } res = self . _get ( url = url , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) items = [ ] if "applications" in res . keys ( ) : for apps in res [ 'applications' ] : items . append ( self ....
returns all the group applications to join
245,814
def search ( self , q , start = 1 , num = 10 , sortField = "username" , sortOrder = "asc" ) : params = { "f" : "json" , "q" : q , "start" : start , "num" : num , "sortField" : sortField , "sortOrder" : sortOrder } url = self . _url return self . _get ( url = url , param_dict = params , securityHandler = self . _securit...
The User Search operation searches for users in the portal . The search index is updated whenever users are created updated or deleted . There can be a lag between the time that the user is updated and the time when it s reflected in the search results . The results only contain users that the calling user has permissi...
245,815
def __getUsername ( self ) : if self . _securityHandler is not None and not self . _securityHandler . _username is None : return self . _securityHandler . _username elif self . _securityHandler is not None and hasattr ( self . _securityHandler , "org_url" ) and self . _securityHandler . org_url is not None : from . adm...
tries to parse the user name from various objects
245,816
def user ( self , username = None ) : if username is None : username = self . __getUsername ( ) parsedUsername = urlparse . quote ( username ) url = self . root + "/%s" % parsedUsername return User ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ...
A user resource that represents a registered user in the portal .
245,817
def userContent ( self ) : replace_start = self . _url . lower ( ) . find ( "/community/" ) len_replace = len ( "/community/" ) url = self . _url . replace ( self . _url [ replace_start : replace_start + len_replace ] , '/content/' ) from . _content import User as UserContent return UserContent ( url = url , securityHa...
allows access into the individual user s content to get at the items owned by the current user
245,818
def invitations ( self ) : url = "%s/invitations" % self . root return Invitations ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
returns a class to access the current user s invitations
245,819
def notifications ( self ) : params = { "f" : "json" } url = "%s/notifications" % self . root return Notifications ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
The notifications that are available for the given user . Notifications are events that need the user s attention - application for joining a group administered by the user acceptance of a group membership application and so on . A notification is initially marked as new . The user can mark it as read or delete the not...
245,820
def resetPassword ( self , email = True ) : url = self . root + "/reset" params = { "f" : "json" , "email" : email } return self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
resets a users password for an account . The password will be randomly generated and emailed by the system .
245,821
def expirePassword ( self , hours = "now" ) : params = { "f" : "json" } expiration = - 1 if isinstance ( hours , str ) : if expiration == "now" : expiration = - 1 elif expiration == "never" : expiration = 0 else : expiration = - 1 elif isinstance ( expiration , ( int , long ) ) : dt = datetime . now ( ) + timedelta ( h...
sets a time when a user must reset their password
245,822
def userInvitations ( self ) : self . __init ( ) items = [ ] for n in self . _userInvitations : if "id" in n : url = "%s/%s" % ( self . root , n [ 'id' ] ) items . append ( self . Invitation ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initi...
gets all user invitations
245,823
def notifications ( self ) : self . __init ( ) items = [ ] for n in self . _notifications : if "id" in n : url = "%s/%s" % ( self . root , n [ 'id' ] ) items . append ( self . Notification ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) ) retur...
gets the user s notifications
245,824
def add ( self , statisticType , onStatisticField , outStatisticFieldName = None ) : val = { "statisticType" : statisticType , "onStatisticField" : onStatisticField , "outStatisticFieldName" : outStatisticFieldName } if outStatisticFieldName is None : del val [ 'outStatisticFieldName' ] self . _array . append ( val )
Adds the statistics group to the filter .
245,825
def addFilter ( self , layer_id , where = None , outFields = "*" ) : import copy f = copy . deepcopy ( self . _filterTemplate ) f [ 'layerId' ] = layer_id f [ 'outFields' ] = outFields if where is not None : f [ 'where' ] = where if f not in self . _filter : self . _filter . append ( f )
adds a layer definition filter
245,826
def removeFilter ( self , filter_index ) : f = self . _filter [ filter_index ] self . _filter . remove ( f )
removes a layer filter based on position in filter list
245,827
def geometry ( self , geometry ) : if isinstance ( geometry , AbstractGeometry ) : self . _geomObject = geometry self . _geomType = geometry . type elif arcpyFound : wkid = None wkt = None if ( hasattr ( geometry , 'spatialReference' ) and geometry . spatialReference is not None ) : if ( hasattr ( geometry . spatialRef...
sets the geometry value
245,828
def layers ( self ) : if self . _layers is None : self . __init ( ) lyrs = [ ] for lyr in self . _layers : url = self . _url + "/%s" % lyr [ 'id' ] lyr [ 'object' ] = MobileServiceLayer ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize...
gets the service layers
245,829
def clusters ( self ) : if self . _clusters is not None : self . __init ( ) Cs = [ ] for c in self . _clusters : url = self . _url + "/%s" % c [ 'clusterName' ] Cs . append ( Cluster ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = ...
returns the cluster object for each server
245,830
def editProtocol ( self , clusterProtocolObj ) : if isinstance ( clusterProtocolObj , ClusterProtocol ) : pass else : raise AttributeError ( "Invalid Input, must be a ClusterProtocal Object" ) url = self . _url + "/editProtocol" params = { "f" : "json" , "tcpClusterPort" : str ( clusterProtocolObj . value [ 'tcpCluster...
Updates the Cluster Protocol . This will cause the cluster to be restarted with updated protocol configuration .
245,831
def parameters ( self ) : if self . _parameters is None : self . __init ( ) for param in self . _parameters : if not isinstance ( param [ 'defaultValue' ] , BaseGPObject ) : if param [ 'dataType' ] == "GPFeatureRecordSetLayer" : param [ 'defaultValue' ] = GPFeatureRecordSetLayer . fromJSON ( json . dumps ( param ) ) el...
returns the default parameters
245,832
def getJob ( self , jobID ) : url = self . _url + "/jobs/%s" % ( jobID ) return GPJob ( url = url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url )
returns the results or status of a job
245,833
def executeTask ( self , inputs , outSR = None , processSR = None , returnZ = False , returnM = False , f = "json" , method = "POST" ) : params = { "f" : f } url = self . _url + "/execute" params = { "f" : "json" } if not outSR is None : params [ 'env:outSR' ] = outSR if not processSR is None : params [ 'end:processSR'...
performs the execute task method
245,834
def _get_json ( self , urlpart ) : url = self . _url + "/%s" % urlpart params = { "f" : "json" , } return self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . proxy_port )
gets the result object dictionary
245,835
def results ( self ) : self . __init ( ) for k , v in self . _results . items ( ) : param = self . _get_json ( v [ 'paramUrl' ] ) if param [ 'dataType' ] == "GPFeatureRecordSetLayer" : self . _results [ k ] = GPFeatureRecordSetLayer . fromJSON ( json . dumps ( param ) ) elif param [ 'dataType' ] . lower ( ) . find ( 'g...
returns the results
245,836
def getParameterValue ( self , parameterName ) : if self . _results is None : self . __init ( ) parameter = self . _results [ parameterName ] return parameter
gets a parameter value
245,837
def parentLayer ( self ) : if self . _parentLayer is None : from . . agol . services import FeatureService self . __init ( ) url = os . path . dirname ( self . _url ) self . _parentLayer = FeatureService ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy...
returns information about the parent
245,838
def _chunks ( self , l , n ) : l . sort ( ) newn = int ( 1.0 * len ( l ) / n + 0.5 ) for i in range ( 0 , n - 1 ) : yield l [ i * newn : i * newn + newn ] yield l [ n * newn - newn : ]
Yield n successive chunks from a list l .
245,839
def calculate ( self , where , calcExpression , sqlFormat = "standard" ) : url = self . _url + "/calculate" params = { "f" : "json" , "where" : where , } if isinstance ( calcExpression , dict ) : params [ "calcExpression" ] = json . dumps ( [ calcExpression ] , default = _date_handler ) elif isinstance ( calcExpression...
The calculate operation is performed on a feature service layer resource . It updates the values of one or more fields in an existing feature service layer based on SQL expressions or scalar values . The calculate operation can only be used if the supportsCalculate property of the layer is true . Neither the Shape fiel...
245,840
def validateSQL ( self , sql , sqlType = "where" ) : url = self . _url + "/validateSQL" if not sqlType . lower ( ) in [ 'where' , 'expression' , 'statement' ] : raise Exception ( "Invalid Input for sqlType: %s" % sqlType ) params = { "f" : "json" , "sql" : sql , "sqlType" : sqlType } return self . _post ( url = url , p...
The validateSQL operation validates an SQL - 92 expression or WHERE clause . The validateSQL operation ensures that an SQL - 92 expression such as one written by a user through a user interface is correct before performing another operation that uses the expression . For example validateSQL can be used to validate info...
245,841
def asDictionary ( self ) : template = { "type" : self . _type , "mapLayerId" : self . _mapLayerId } if not self . _gdbVersion is None and self . _gdbVersion != "" : template [ 'gdbVersion' ] = self . _gdbVersion return template
converts the object to a dictionary
245,842
def asDictionary ( self ) : template = { "type" : "dataLayer" , "dataSource" : self . _dataSource } if not self . _fields is None : template [ 'fields' ] = self . _fields return template
returns the value as a dictionary
245,843
def dataSource ( self , value ) : if isinstance ( value , DataSource ) : self . _dataSource = value else : raise TypeError ( "value must be a DataSource object" )
sets the datasource object
245,844
def fields ( self , value ) : if type ( value ) is list : self . _fields = value else : raise TypeError ( "Input must be a list" )
sets the fields variable
245,845
def addCodedValue ( self , name , code ) : i = { "name" : name , "code" : code } if i not in self . _codedValues : self . _codedValues . append ( i )
adds a coded value to the domain
245,846
def removeCodedValue ( self , name ) : for i in self . _codedValues : if i [ 'name' ] == name : self . _codedValues . remove ( i ) return True return False
removes a codedValue by name
245,847
def value ( self ) : return { "type" : self . _type , "name" : self . _name , "range" : [ self . _rangeMin , self . _rangeMax ] }
gets the value as a dictionary
245,848
def exportImage ( self , bbox , imageSR , bboxSR , size = [ 400 , 400 ] , time = None , format = "jpgpng" , pixelType = "UNKNOWN" , noData = None , noDataInterpretation = "esriNoDataMatchAny" , interpolation = None , compression = None , compressionQuality = 75 , bandIds = None , moasiacRule = None , renderingRule = ""...
The exportImage operation is performed on an image service resource The result of this operation is an image resource . This resource provides information about the exported image such as its URL extent width and height . In addition to the usual response formats of HTML and JSON you can also request the image format w...
245,849
def measure ( self , fromGeometry , toGeometry , measureOperation , geometryType = "esriGeometryPoint" , pixelSize = None , mosaicRule = None , linearUnit = None , angularUnit = None , areaUnit = None ) : url = self . _url + "/measure" params = { "f" : "json" , "fromGeometry" : fromGeometry , "toGeometry" : toGeometry ...
The measure operation is performed on an image service resource . It lets a user measure distance direction area perimeter and height from an image service . The result of this operation includes the name of the raster dataset being used sensor name and measured values .
245,850
def computeStatisticsHistograms ( self , geometry , geometryType , mosaicRule = None , renderingRule = None , pixelSize = None ) : url = self . _url + "/computeStatisticsHistograms" params = { "f" : "json" , "geometry" : geometry , "geometryType" : geometryType } if not mosaicRule is None : params [ "mosaicRule" ] = mo...
The computeStatisticsHistograms operation is performed on an image service resource . This operation is supported by any image service published with mosaic datasets or a raster dataset . The result of this operation contains both statistics and histograms computed from the given extent .
245,851
def uploadByParts ( self , registerID , filePath , commit = True ) : url = self . _url + "/%s/uploadPart" % registerID params = { "f" : "json" } with open ( filePath , 'rb' ) as f : mm = mmap . mmap ( f . fileno ( ) , 0 , access = mmap . ACCESS_READ ) size = 1000000 steps = int ( os . fstat ( f . fileno ( ) ) . st_size...
loads the data by small parts . If commit is set to true then parts will be merged together . If commit is false the function will return the registerID so a manual commit can occur .
245,852
def uploads ( self ) : if self . syncEnabled == True : return Uploads ( url = self . _url + "/uploads" , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) return None
returns the class to perform the upload function . it will only return the uploads class if syncEnabled is True .
245,853
def administration ( self ) : url = self . _url res = search ( "/rest/" , url ) . span ( ) addText = "admin/" part1 = url [ : res [ 1 ] ] part2 = url [ res [ 1 ] : ] adminURL = "%s%s%s" % ( part1 , addText , part2 ) res = AdminFeatureService ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _...
returns the hostservice object to manage the back - end functions
245,854
def replicas ( self ) : params = { "f" : "json" , } url = self . _url + "/replicas" return self . _get ( url , params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
returns all the replicas for a feature service
245,855
def createReplica ( self , replicaName , layers , layerQueries = None , geometryFilter = None , replicaSR = None , transportType = "esriTransportTypeUrl" , returnAttachments = False , returnAttachmentsDatabyURL = False , async = False , attachmentsSyncDirection = "none" , syncModel = "none" , dataFormat = "json" , repl...
The createReplica operation is performed on a feature service resource . This operation creates the replica between the feature service and a client based on a client - supplied replica definition . It requires the Sync capability . See Sync overview for more information on sync . The response for createReplica include...
245,856
def replicaStatus ( self , url ) : params = { "f" : "json" } url = url + "/status" return self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url )
gets the replica status when exported async set to True
245,857
def listAttachments ( self , oid ) : url = self . _url + "/%s/attachments" % oid params = { "f" : "json" } return self . _get ( url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url )
list attachements for a given OBJECT ID
245,858
def getAttachment ( self , oid , attachment_id , out_folder = None ) : attachments = self . listAttachments ( oid = oid ) if "attachmentInfos" in attachments : for attachment in attachments [ 'attachmentInfos' ] : if "id" in attachment and attachment [ 'id' ] == attachment_id : url = self . _url + "/%s/attachments/%s" ...
downloads a feature s attachment .
245,859
def create_fc_template ( self , out_path , out_name ) : fields = self . fields objectIdField = self . objectIdField geomType = self . geometryType wkid = self . parentLayer . spatialReference [ 'wkid' ] return create_feature_class ( out_path , out_name , geomType , wkid , fields , objectIdField )
creates a featureclass template on local disk
245,860
def create_feature_template ( self ) : fields = self . fields feat_schema = { } att = { } for fld in fields : self . _globalIdField if not fld [ 'name' ] == self . _objectIdField and not fld [ 'name' ] == self . _globalIdField : att [ fld [ 'name' ] ] = '' feat_schema [ 'attributes' ] = att feat_schema [ 'geometry' ] =...
creates a feature template
245,861
def spatialReference ( self ) : if self . _wkid == None and self . _wkt is not None : return { "wkt" : self . _wkt } else : return { "wkid" : self . _wkid }
returns the geometry spatial reference
245,862
def asJSON ( self ) : value = self . _json if value is None : value = json . dumps ( self . asDictionary , default = _date_handler ) self . _json = value return self . _json
returns a geometry as JSON
245,863
def asArcPyObject ( self ) : if arcpyFound == False : raise Exception ( "ArcPy is required to use this function" ) return arcpy . AsShape ( self . asDictionary , True )
returns the Point as an ESRI arcpy . Point object
245,864
def X ( self , value ) : if isinstance ( value , ( int , float , long , types . NoneType ) ) : self . _x = value
sets the X coordinate
245,865
def Y ( self , value ) : if isinstance ( value , ( int , float , long , types . NoneType ) ) : self . _y = value
sets the Y coordinate
245,866
def Z ( self , value ) : if isinstance ( value , ( int , float , long , types . NoneType ) ) : self . _z = value
sets the Z coordinate
245,867
def wkid ( self , value ) : if isinstance ( value , ( int , long ) ) : self . _wkid = value
sets the wkid
245,868
def asDictionary ( self ) : template = { "xmin" : self . _xmin , "ymin" : self . _ymin , "xmax" : self . _xmax , "ymax" : self . _ymax , "spatialReference" : self . spatialReference } if self . _zmax is not None and self . _zmin is not None : template [ 'zmin' ] = self . _zmin template [ 'zmax' ] = self . _zmax if self...
returns the envelope as a dictionary
245,869
def asArcPyObject ( self ) : env = self . asDictionary ring = [ [ Point ( env [ 'xmin' ] , env [ 'ymin' ] , self . _wkid ) , Point ( env [ 'xmax' ] , env [ 'ymin' ] , self . _wkid ) , Point ( env [ 'xmax' ] , env [ 'ymax' ] , self . _wkid ) , Point ( env [ 'xmin' ] , env [ 'ymax' ] , self . _wkid ) ] ] return Polygon (...
returns the Envelope as an ESRI arcpy . Polygon object
245,870
def _process_response ( self , resp , out_folder = None ) : CHUNK = 4056 maintype = self . _mainType ( resp ) contentDisposition = resp . headers . get ( 'content-disposition' ) contentEncoding = resp . headers . get ( 'content-encoding' ) contentType = resp . headers . get ( 'content-type' ) contentLength = resp . hea...
processes the response object
245,871
def addUsersToRole ( self , rolename , users ) : params = { "f" : "json" , "rolename" : rolename , "users" : users } rURL = self . _url + "/roles/addUsersToRole" return self . _post ( url = rURL , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _prox...
Assigns a role to multiple users
245,872
def serverProperties ( self ) : return ServerProperties ( url = self . _url + "/properties" , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True )
gets the server properties for the site as an object
245,873
def serverDirectories ( self ) : directs = [ ] url = self . _url + "/directories" params = { "f" : "json" } res = self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) for direct in res [ 'directories' ] : directs . ...
returns the server directory object in a list
245,874
def Jobs ( self ) : url = self . _url + "/jobs" return Jobs ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initialize = True )
get the Jobs object
245,875
def configurationStore ( self ) : url = self . _url + "/configstore" return ConfigurationStore ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
returns the ConfigurationStore object for this site
245,876
def EnableEditingOnService ( self , url , definition = None ) : adminFS = AdminFeatureService ( url = url , securityHandler = self . _securityHandler ) if definition is None : definition = collections . OrderedDict ( ) definition [ 'hasStaticData' ] = False definition [ 'allowGeometryUpdates' ] = True definition [ 'edi...
Enables editing capabilities on a feature service .
245,877
def enableSync ( self , url , definition = None ) : adminFS = AdminFeatureService ( url = url , securityHandler = self . _securityHandler ) cap = str ( adminFS . capabilities ) existingDef = { } enableResults = 'skipped' if 'Sync' in cap : return "Sync is already enabled" else : capItems = cap . split ( ',' ) capItems ...
Enables Sync capability for an AGOL feature service .
245,878
def GetFeatureService ( self , itemId , returnURLOnly = False ) : admin = None item = None try : admin = arcrest . manageorg . Administration ( securityHandler = self . _securityHandler ) if self . _securityHandler . valid == False : self . _valid = self . _securityHandler . valid self . _message = self . _securityHand...
Obtains a feature service by item ID .
245,879
def GetLayerFromFeatureServiceByURL ( self , url , layerName = "" , returnURLOnly = False ) : fs = None try : fs = arcrest . agol . FeatureService ( url = url , securityHandler = self . _securityHandler ) return self . GetLayerFromFeatureService ( fs = fs , layerName = layerName , returnURLOnly = returnURLOnly ) except...
Obtains a layer from a feature service by URL reference .
245,880
def GetLayerFromFeatureService ( self , fs , layerName = "" , returnURLOnly = False ) : layers = None table = None layer = None sublayer = None try : layers = fs . layers if ( layers is None or len ( layers ) == 0 ) and fs . url is not None : fs = arcrest . ags . FeatureService ( url = fs . url ) layers = fs . layers i...
Obtains a layer from a feature service by feature service reference .
245,881
def DeleteFeaturesFromFeatureLayer ( self , url , sql , chunksize = 0 ) : fl = None try : fl = FeatureLayer ( url = url , securityHandler = self . _securityHandler ) totalDeleted = 0 if chunksize > 0 : qRes = fl . query ( where = sql , returnIDsOnly = True ) if 'error' in qRes : print ( qRes ) return qRes elif 'objectI...
Removes features from a hosted feature service layer by SQL query .
245,882
def QueryAllFeatures ( self , url = None , where = "1=1" , out_fields = "*" , timeFilter = None , geometryFilter = None , returnFeatureClass = False , out_fc = None , outSR = None , chunksize = 1000 , printIndent = "" ) : if ( url is None ) : return fl = None try : fl = FeatureLayer ( url = url , securityHandler = self...
Performs an SQL query against a hosted feature service layer and returns all features regardless of service limit .
245,883
def contributionStatus ( self ) : import time url = "%s/contributors/%s/activeContribution" % ( self . root , quote ( self . contributorUID ) ) params = { "agolUserToken" : self . _agolSH . token , "f" : "json" } res = self . _get ( url = url , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _...
gets the contribution status of a user
245,884
def user ( self ) : if self . _user is None : url = "%s/users/%s" % ( self . root , self . _username ) self . _user = CMPUser ( url = url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url , initialize = False ) return self . _user
gets the user properties
245,885
def metadataContributer ( self ) : if self . _metaFL is None : fl = FeatureService ( url = self . _metadataURL , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) self . _metaFS = fl return self . _metaFS
gets the metadata featurelayer object
245,886
def set_value ( self , field_name , value ) : if field_name in self . fields : if not value is None : self . _dict [ 'attributes' ] [ field_name ] = _unicode_convert ( value ) else : pass elif field_name . upper ( ) in [ 'SHAPE' , 'SHAPE@' , "GEOMETRY" ] : if isinstance ( value , dict ) : if 'geometry' in value : self ...
sets an attribute value for a given field name
245,887
def get_value ( self , field_name ) : if field_name in self . fields : return self . _dict [ 'attributes' ] [ field_name ] elif field_name . upper ( ) in [ 'SHAPE' , 'SHAPE@' , "GEOMETRY" ] : return self . _dict [ 'geometry' ] return None
returns a value for a given field name
245,888
def asDictionary ( self ) : feat_dict = { } if self . _geom is not None : if 'feature' in self . _dict : feat_dict [ 'geometry' ] = self . _dict [ 'feature' ] [ 'geometry' ] elif 'geometry' in self . _dict : feat_dict [ 'geometry' ] = self . _dict [ 'geometry' ] if 'feature' in self . _dict : feat_dict [ 'attributes' ]...
returns the feature as a dictionary
245,889
def geometry ( self ) : if arcpyFound : if self . _geom is None : if 'feature' in self . _dict : self . _geom = arcpy . AsShape ( self . _dict [ 'feature' ] [ 'geometry' ] , esri_json = True ) elif 'geometry' in self . _dict : self . _geom = arcpy . AsShape ( self . _dict [ 'geometry' ] , esri_json = True ) return self...
returns the feature geometry
245,890
def fields ( self ) : if 'feature' in self . _dict : self . _attributes = self . _dict [ 'feature' ] [ 'attributes' ] else : self . _attributes = self . _dict [ 'attributes' ] return self . _attributes . keys ( )
returns a list of feature fields
245,891
def geometryType ( self ) : if self . _geomType is None : if self . geometry is not None : self . _geomType = self . geometry . type else : self . _geomType = "Table" return self . _geomType
returns the feature s geometry type
245,892
def value ( self ) : if self . mosaicMethod == "esriMosaicNone" or self . mosaicMethod == "esriMosaicCenter" or self . mosaicMethod == "esriMosaicNorthwest" or self . mosaicMethod == "esriMosaicNadir" : return { "mosaicMethod" : "esriMosaicNone" , "where" : self . _where , "ascending" : self . _ascending , "fids" : sel...
gets the mosaic rule object as a dictionary
245,893
def fromJSON ( jsonValue ) : jd = json . loads ( jsonValue ) features = [ ] if 'fields' in jd : fields = jd [ 'fields' ] else : fields = { 'fields' : [ ] } if 'features' in jd : for feat in jd [ 'features' ] : wkid = None spatialReference = None if 'spatialReference' in jd : spatialReference = jd [ 'spatialReference' ]...
returns a featureset from a JSON string
245,894
def spatialReference ( self , value ) : if isinstance ( value , SpatialReference ) : self . _spatialReference = value elif isinstance ( value , int ) : self . _spatialReference = SpatialReference ( wkid = value ) elif isinstance ( value , str ) and str ( value ) . isdigit ( ) : self . _spatialReference = SpatialReferen...
sets the featureset s spatial reference
245,895
def regions ( self ) : url = "%s/regions" % self . root params = { "f" : "json" } return self . _get ( url = url , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port )
gets the regions value
245,896
def portalSelf ( self ) : url = "%s/self" % self . root return Portal ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , )
The portal to which the current user belongs . This is an organizational portal if the user belongs to an organization or the default portal if the user does not belong to one
245,897
def portal ( self , portalID = None ) : if portalID is None : portalID = self . portalSelf . id url = "%s/%s" % ( self . root , portalID ) return Portal ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = True )
returns a specific reference to a portal
245,898
def _findPortalId ( self ) : if not self . root . lower ( ) . endswith ( "/self" ) : url = self . root + "/self" else : url = self . root params = { "f" : "json" } res = self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _prox...
gets the portal id for a site if not known .
245,899
def portalId ( self ) : if self . _portalId is None : self . _portalId = self . _findPortalId ( ) return self . _portalId
gets the portal Id