idx int64 0 63k | question stringlengths 61 4.03k | target stringlengths 6 1.23k |
|---|---|---|
57,000 | def Y ( self , value ) : if isinstance ( value , ( int , float , long , types . NoneType ) ) : self . _y = value | sets the Y coordinate |
57,001 | def Z ( self , value ) : if isinstance ( value , ( int , float , long , types . NoneType ) ) : self . _z = value | sets the Z coordinate |
57,002 | def wkid ( self , value ) : if isinstance ( value , ( int , long ) ) : self . _wkid = value | sets the wkid |
57,003 | 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 |
57,004 | 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 |
57,005 | 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 |
57,006 | 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 |
57,007 | 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 |
57,008 | 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 |
57,009 | 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 |
57,010 | 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 |
57,011 | 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 . |
57,012 | 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 . |
57,013 | 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 . |
57,014 | 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 . |
57,015 | 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 . |
57,016 | 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 . |
57,017 | 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 . |
57,018 | 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 |
57,019 | 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 |
57,020 | 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 |
57,021 | 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 |
57,022 | 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 |
57,023 | 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 |
57,024 | 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 |
57,025 | 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 |
57,026 | 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 |
57,027 | 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 |
57,028 | 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 |
57,029 | 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 |
57,030 | 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 |
57,031 | 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 |
57,032 | 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 |
57,033 | 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 . |
57,034 | def portalId ( self ) : if self . _portalId is None : self . _portalId = self . _findPortalId ( ) return self . _portalId | gets the portal Id |
57,035 | def featureServers ( self ) : if self . urls == { } : return { } featuresUrls = self . urls [ 'urls' ] [ 'features' ] if 'https' in featuresUrls : res = featuresUrls [ 'https' ] elif 'http' in featuresUrls : res = featuresUrls [ 'http' ] else : return None services = [ ] for urlHost in res : if self . isPortal : servic... | gets the hosting feature AGS Server |
57,036 | def update ( self , updatePortalParameters , clearEmptyFields = False ) : url = self . root + "/update" params = { "f" : "json" , "clearEmptyFields" : clearEmptyFields } if isinstance ( updatePortalParameters , parameters . PortalParameters ) : params . update ( updatePortalParameters . value ) elif isinstance ( update... | The Update operation allows administrators only to update the organization information such as name description thumbnail and featured groups . |
57,037 | def updateUserRole ( self , user , role ) : url = self . _url + "/updateuserrole" params = { "f" : "json" , "user" : user , "role" : role } return self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | The Update User Role operation allows the administrator of an org anization to update the role of a user within a portal . |
57,038 | def isServiceNameAvailable ( self , name , serviceType ) : _allowedTypes = [ 'Feature Service' , "Map Service" ] url = self . _url + "/isServiceNameAvailable" params = { "f" : "json" , "name" : name , "type" : serviceType } return self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler... | Checks to see if a given service name and type are available for publishing a new service . true indicates that the name and type is not found in the organization s services and is available for publishing . false means the requested name and type are not available . |
57,039 | def servers ( self ) : url = "%s/servers" % self . root return Servers ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | gets the federated or registered servers for Portal |
57,040 | def users ( self , start = 1 , num = 10 , sortField = "fullName" , sortOrder = "asc" , role = None ) : users = [ ] url = self . _url + "/users" params = { "f" : "json" , "start" : start , "num" : num } if not role is None : params [ 'role' ] = role if not sortField is None : params [ 'sortField' ] = sortField if not so... | Lists all the members of the organization . The start and num paging parameters are supported . |
57,041 | def roles ( self ) : return Roles ( url = "%s/roles" % self . root , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | gets the roles class that allows admins to manage custom roles on portal |
57,042 | def resources ( self , start = 1 , num = 10 ) : url = self . _url + "/resources" params = { "f" : "json" , "start" : start , "num" : num } return self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | Resources lists all file resources for the organization . The start and num paging parameters are supported . |
57,043 | def addResource ( self , key , filePath , text ) : url = self . root + "/addresource" params = { "f" : "json" , "token" : self . _securityHandler . token , "key" : key , "text" : text } files = { } files [ 'file' ] = filePath res = self . _post ( url = url , param_dict = params , files = files , securityHandler = self ... | The add resource operation allows the administrator to add a file resource for example the organization s logo or custom banner . The resource can be used by any member of the organization . File resources use storage space from your quota and are scanned for viruses . |
57,044 | def updateSecurityPolicy ( self , minLength = 8 , minUpper = None , minLower = None , minLetter = None , minDigit = None , minOther = None , expirationInDays = None , historySize = None ) : params = { "f" : "json" , "minLength" : minLength , "minUpper" : minUpper , "minLower" : minLower , "minLetter" : minLetter , "min... | updates the Portals security policy |
57,045 | def portalAdmin ( self ) : from . . manageportal import PortalAdministration return PortalAdministration ( admin_url = "https://%s/portaladmin" % self . portalHostname , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = False ) | gets a reference to a portal administration class |
57,046 | def addUser ( self , invitationList , subject , html ) : url = self . _url + "/invite" params = { "f" : "json" } if isinstance ( invitationList , parameters . InvitationList ) : params [ 'invitationList' ] = invitationList . value ( ) params [ 'html' ] = html params [ 'subject' ] = subject return self . _post ( url = u... | adds a user without sending an invitation email |
57,047 | def inviteByEmail ( self , emails , subject , text , html , role = "org_user" , mustApprove = True , expiration = 1440 ) : url = self . root + "/inviteByEmail" params = { "f" : "json" , "emails" : emails , "subject" : subject , "text" : text , "html" : html , "role" : role , "mustApprove" : mustApprove , "expiration" :... | Invites a user or users to a site . |
57,048 | def usage ( self , startTime , endTime , vars = None , period = None , groupby = None , name = None , stype = None , etype = None , appId = None , deviceId = None , username = None , appOrgId = None , userOrgId = None , hostOrgId = None ) : url = self . root + "/usage" startTime = str ( int ( local_time_to_online ( dt ... | returns the usage statistics value |
57,049 | def servers ( self ) : self . __init ( ) items = [ ] for k , v in self . _json_dict . items ( ) : if k == "servers" : for s in v : if 'id' in s : url = "%s/%s" % ( self . root , s [ 'id' ] ) items . append ( self . Server ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_po... | gets all the server resources |
57,050 | def deleteRole ( self , roleID ) : url = self . _url + "/%s/delete" % roleID params = { "f" : "json" } return self . _post ( url = url , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | deletes a role by ID |
57,051 | def updateRole ( self , roleID , name , description ) : params = { "name" : name , "description" : description , "f" : "json" } url = self . _url + "/%s/update" return self . _post ( url = url , param_dict = params , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | allows for the role name or description to be modified |
57,052 | def findRoleID ( self , name ) : for r in self : if r [ 'name' ] . lower ( ) == name . lower ( ) : return r [ 'id' ] del r return None | searches the roles by name and returns the role s ID |
57,053 | def get_config_value ( config_file , section , variable ) : try : parser = ConfigParser . SafeConfigParser ( ) parser . read ( config_file ) return parser . get ( section , variable ) except : return None | extracts a config file value |
57,054 | def users ( self ) : return Users ( url = "%s/users" % self . root , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | Provides access to all user resources |
57,055 | def getItem ( self , itemId ) : url = "%s/items/%s" % ( self . root , itemId ) return Item ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | gets the refernce to the Items class which manages content on a given AGOL or Portal site . |
57,056 | def FeatureContent ( self ) : return FeatureContent ( url = "%s/%s" % ( self . root , "features" ) , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | Feature Content class id the parent resource for feature operations such as Analyze and Generate . |
57,057 | def user ( self , username = None ) : if username is None : username = self . __getUsername ( ) url = "%s/%s" % ( self . root , username ) return User ( url = url , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = True ) | gets the user s content . If None is passed the current user is used . |
57,058 | def saveThumbnail ( self , fileName , filePath ) : if self . _thumbnail is None : self . __init ( ) param_dict = { } if self . _thumbnail is not None : imgUrl = self . root + "/info/" + self . _thumbnail onlineFileName , file_ext = splitext ( self . _thumbnail ) fileNameSafe = "" . join ( x for x in fileName if x . isa... | URL to the thumbnail used for the item |
57,059 | def userItem ( self ) : if self . ownerFolder is not None : url = "%s/users/%s/%s/items/%s" % ( self . root . split ( '/items/' ) [ 0 ] , self . owner , self . ownerFolder , self . id ) else : url = "%s/users/%s/items/%s" % ( self . root . split ( '/items/' ) [ 0 ] , self . owner , self . id ) return UserItem ( url = u... | returns a reference to the UserItem class |
57,060 | def addRating ( self , rating = 5.0 ) : if rating > 5.0 : rating = 5.0 elif rating < 1.0 : rating = 1.0 url = "%s/addRating" % self . root params = { "f" : "json" , "rating" : "%s" % rating } return self . _post ( url , params , proxy_port = self . _proxy_port , securityHandler = self . _securityHandler , proxy_url = s... | Adds a rating to an item between 1 . 0 and 5 . 0 |
57,061 | def addComment ( self , comment ) : url = "%s/addComment" % self . root params = { "f" : "json" , "comment" : comment } return self . _post ( url , params , proxy_port = self . _proxy_port , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url ) | adds a comment to a given item . Must be authenticated |
57,062 | def itemComment ( self , commentId ) : url = "%s/comments/%s" % ( self . root , commentId ) params = { "f" : "json" } return self . _get ( url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) | returns details of a single comment |
57,063 | def itemComments ( self ) : url = "%s/comments/" % self . root params = { "f" : "json" } return self . _get ( url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) | returns all comments for a given item |
57,064 | def deleteComment ( self , commentId ) : url = "%s/comments/%s/delete" % ( self . root , commentId ) params = { "f" : "json" , } return self . _post ( url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) | removes a comment from an Item |
57,065 | def packageInfo ( self ) : url = "%s/item.pkinfo" % self . root params = { 'f' : 'json' } result = self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , out_folder = tempfile . gettempdir ( ) ) return result | gets the item s package information file |
57,066 | def item ( self ) : url = self . _contentURL return Item ( url = self . _contentURL , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = True ) | returns the Item class of an Item |
57,067 | def reassignItem ( self , targetUsername , targetFoldername ) : params = { "f" : "json" , "targetUsername" : targetUsername , "targetFoldername" : targetFoldername } url = "%s/reassign" % self . root return self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _... | The Reassign Item operation allows the administrator of an organization to reassign a member s item to another member of the organization . |
57,068 | def updateItem ( self , itemParameters , clearEmptyFields = False , data = None , metadata = None , text = None , serviceUrl = None , multipart = False ) : thumbnail = None largeThumbnail = None files = { } params = { "f" : "json" , } if clearEmptyFields : params [ "clearEmptyFields" ] = clearEmptyFields if serviceUrl ... | updates an item s properties using the ItemParameter class . |
57,069 | def status ( self , jobId = None , jobType = None ) : params = { "f" : "json" } if jobType is not None : params [ 'jobType' ] = jobType if jobId is not None : params [ "jobId" ] = jobId url = "%s/status" % self . root return self . _get ( url = url , param_dict = params , securityHandler = self . _securityHandler , pro... | Inquire about status when publishing an item adding an item in async mode or adding with a multipart upload . Partial is available for Add Item Multipart when only a part is uploaded and the item is not committed . |
57,070 | def commit ( self , wait = False , additionalParams = { } ) : url = "%s/commit" % self . root params = { "f" : "json" , } for key , value in additionalParams . items ( ) : params [ key ] = value if wait == True : res = self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_po... | Commit is called once all parts are uploaded during a multipart Add Item or Update Item operation . The parts are combined into a file and the original file is overwritten during an Update Item operation . This is an asynchronous call and returns immediately . Status can be used to check the status of the operation unt... |
57,071 | def folders ( self ) : if self . _folders is None : self . __init ( ) if self . _folders is not None and isinstance ( self . _folders , list ) : if len ( self . _folders ) == 0 : self . _loadFolders ( ) return self . _folders | gets the property value for folders |
57,072 | def items ( self ) : self . __init ( ) items = [ ] for item in self . _items : items . append ( UserItem ( url = "%s/items/%s" % ( self . location , item [ 'id' ] ) , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port , initalize = True ) ) return items | gets the property value for items |
57,073 | def addRelationship ( self , originItemId , destinationItemId , relationshipType ) : url = "%s/addRelationship" % self . root params = { "originItemId" : originItemId , "destinationItemId" : destinationItemId , "relationshipType" : relationshipType , "f" : "json" } return self . _post ( url = url , param_dict = params ... | Adds a relationship of a certain type between two items . |
57,074 | def createService ( self , createServiceParameter , description = None , tags = "Feature Service" , snippet = None ) : url = "%s/createService" % self . location val = createServiceParameter . value params = { "f" : "json" , "outputType" : "featureService" , "createParameters" : json . dumps ( val ) , "tags" : tags } i... | The Create Service operation allows users to create a hosted feature service . You can use the API to create an empty hosted feaure service from feature service metadata JSON . |
57,075 | def shareItems ( self , items , groups = "" , everyone = False , org = False ) : url = "%s/shareItems" % self . root params = { "f" : "json" , "items" : items , "everyone" : everyone , "org" : org , "groups" : groups } return self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , p... | Shares a batch of items with the specified list of groups . Users can only share items with groups to which they belong . This operation also allows a user to share items with everyone in which case the items are publicly accessible or with everyone in their organization . |
57,076 | def createFolder ( self , name ) : url = "%s/createFolder" % self . root params = { "f" : "json" , "title" : name } self . _folders = None return self . _post ( url = url , param_dict = params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) | Creates a folder in which items can be placed . Folders are only visible to a user and solely used for organizing content within that user s content space . |
57,077 | def analyze ( self , itemId = None , filePath = None , text = None , fileType = "csv" , analyzeParameters = None ) : files = [ ] url = self . _url + "/analyze" params = { "f" : "json" } fileType = "csv" params [ "fileType" ] = fileType if analyzeParameters is not None and isinstance ( analyzeParameters , AnalyzeParamet... | The Analyze call helps a client analyze a CSV file prior to publishing or generating features using the Publish or Generate operation respectively . Analyze returns information about the file including the fields present as well as sample records . Analyze attempts to detect the presence of location fields that may be ... |
57,078 | def __assembleURL ( self , url , groupId ) : from . . packages . six . moves . urllib_parse import urlparse parsed = urlparse ( url ) communityURL = "%s://%s%s/sharing/rest/community/groups/%s" % ( parsed . scheme , parsed . netloc , parsed . path . lower ( ) . split ( '/sharing/rest/' ) [ 0 ] , groupId ) return commun... | private function that assembles the URL for the community . Group class |
57,079 | def group ( self ) : split_count = self . _url . lower ( ) . find ( "/content/" ) len_count = len ( '/content/' ) gURL = self . _url [ : self . _url . lower ( ) . find ( "/content/" ) ] + "/community/" + self . _url [ split_count + len_count : ] return CommunityGroup ( url = gURL , securityHandler = self . _securityHan... | returns the community . Group class for the current group |
57,080 | def addUniqueValue ( self , value , label , description , symbol ) : if self . _uniqueValueInfos is None : self . _uniqueValueInfos = [ ] self . _uniqueValueInfos . append ( { "value" : value , "label" : label , "description" : description , "symbol" : symbol } ) | adds a unique value to the renderer |
57,081 | def removeUniqueValue ( self , value ) : for v in self . _uniqueValueInfos : if v [ 'value' ] == value : self . _uniqueValueInfos . remove ( v ) return True del v return False | removes a unique value in unique Value Info |
57,082 | def addClassBreak ( self , classMinValue , classMaxValue , label , description , symbol ) : if self . _classBreakInfos is None : self . _classBreakInfos = [ ] self . _classBreakInfos . append ( { "classMinValue" : classMinValue , "classMaxValue" : classMaxValue , "label" : label , "description" : description , "symbol"... | adds a classification break value to the renderer |
57,083 | def removeClassBreak ( self , label ) : for v in self . _classBreakInfos : if v [ 'label' ] == label : self . _classBreakInfos . remove ( v ) return True del v return False | removes a classification break value to the renderer |
57,084 | def downloadThumbnail ( self , outPath ) : url = self . _url + "/info/thumbnail" params = { } return self . _get ( url = url , out_folder = outPath , file_name = None , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) | downloads the items s thumbnail |
57,085 | def __init ( self ) : params = { "f" : "json" } json_dict = self . _get ( self . _url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) self . _json = json . dumps ( json_dict ) self . _json_dict = json_dict attributes = [ attr for attr in dir ( sel... | populates all the properties for the map service |
57,086 | def getExtensions ( self ) : extensions = [ ] if isinstance ( self . supportedExtensions , list ) : for ext in self . supportedExtensions : extensionURL = self . _url + "/exts/%s" % ext if ext == "SchematicsServer" : extensions . append ( SchematicsService ( url = extensionURL , securityHandler = self . _securityHandle... | returns objects for all map service extensions |
57,087 | def allLayers ( self ) : url = self . _url + "/layers" params = { "f" : "json" } res = self . _get ( url , param_dict = params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) return_dict = { "layers" : [ ] , "tables" : [ ] } for k , v in res . items ( ) : ... | returns all layers for the service |
57,088 | def find ( self , searchText , layers , contains = True , searchFields = "" , sr = "" , layerDefs = "" , returnGeometry = True , maxAllowableOffset = "" , geometryPrecision = "" , dynamicLayers = "" , returnZ = False , returnM = False , gdbVersion = "" ) : url = self . _url + "/find" params = { "f" : "json" , "searchTe... | performs the map service find operation |
57,089 | def getFeatureDynamicLayer ( self , oid , dynamicLayer , returnZ = False , returnM = False ) : url = self . _url + "/dynamicLayer/%s" % oid params = { "f" : "json" , "returnZ" : returnZ , "returnM" : returnM , "layer" : { "id" : 101 , "source" : dynamicLayer . asDictionary } } return Feature ( json_string = self . _get... | The feature resource represents a single feature in a dynamic layer in a map service |
57,090 | def identify ( self , geometry , mapExtent , imageDisplay , tolerance , geometryType = "esriGeometryPoint" , sr = None , layerDefs = None , time = None , layerTimeOptions = None , layers = "top" , returnGeometry = True , maxAllowableOffset = None , geometryPrecision = None , dynamicLayers = None , returnZ = False , ret... | The identify operation is performed on a map service resource to discover features at a geographic location . The result of this operation is an identify results resource . Each identified result includes its name layer ID layer name geometry and geometry type and other attributes of that result as name - value pairs . |
57,091 | def fromJSON ( value ) : if isinstance ( value , str ) : value = json . loads ( value ) elif isinstance ( value , dict ) : pass else : raise AttributeError ( "Invalid input" ) return Extension ( typeName = value [ 'typeName' ] , capabilities = value [ 'capabilities' ] , enabled = value [ 'enabled' ] == "true" , maxUplo... | returns the object from json string or dictionary |
57,092 | def asList ( self ) : return [ self . _red , self . _green , self . _blue , self . _alpha ] | returns the value as the list object |
57,093 | def color ( self , value ) : if isinstance ( value , ( list , Color ) ) : if value is list : self . _color = value else : self . _color = value . asList | sets the color |
57,094 | def outlineColor ( self , value ) : if isinstance ( value , ( list , Color ) ) : if value is list : self . _outlineColor = value else : self . _outlineColor = value . asList | sets the outline color |
57,095 | def outline ( self , value ) : if isinstance ( value , SimpleLineSymbol ) : self . _outline = value . asDictionary | sets the outline |
57,096 | def base64ToImage ( imgData , out_path , out_file ) : fh = open ( os . path . join ( out_path , out_file ) , "wb" ) fh . write ( imgData . decode ( 'base64' ) ) fh . close ( ) del fh return os . path . join ( out_path , out_file ) | converts a base64 string to a file |
57,097 | def find ( self , text , magicKey = None , sourceCountry = None , bbox = None , location = None , distance = 3218.69 , outSR = 102100 , category = None , outFields = "*" , maxLocations = 20 , forStorage = False ) : if isinstance ( self . _securityHandler , ( AGOLTokenSecurityHandler , OAuthSecurityHandler ) ) : url = s... | The find operation geocodes one location per request ; the input address is specified in a single parameter . |
57,098 | def geocodeAddresses ( self , addresses , outSR = 4326 , sourceCountry = None , category = None ) : params = { "f" : "json" } url = self . _url + "/geocodeAddresses" params [ 'outSR' ] = outSR params [ 'sourceCountry' ] = sourceCountry params [ 'category' ] = category params [ 'addresses' ] = addresses return self . _p... | The geocodeAddresses operation is performed on a Geocode Service resource . The result of this operation is a resource representing the list of geocoded addresses . This resource provides information about the addresses including the address location score and other geocode service - specific attributes . You can provi... |
57,099 | def __init ( self ) : params = { "f" : "json" , } json_dict = self . _get ( self . _url , params , securityHandler = self . _securityHandler , proxy_url = self . _proxy_url , proxy_port = self . _proxy_port ) self . _json_dict = json_dict self . _json = json . dumps ( self . _json_dict ) attributes = [ attr for attr in... | initializes the properties |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.