Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function: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, ...
[ " returns information about the parent " ]
Please provide a description of the function: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.\n " ]
Please provide a description of the function:def addAttachments(self, featureId, attachment, gdbVersion=None, uploadId=None): if self.hasAttachments == True: url = self._url + "/%s/addAttachment" % f...
[ "\n This operation adds an attachment to the associated feature (POST\n only). The addAttachment operation is performed on a feature\n service feature resource.\n Since this request uploads a file, it must be a multipart request\n pursuant to IETF RFC1867.\n This operation ...
Please provide a description of the function:def applyEdits(self, addFeatures=[], updateFeatures=[], deleteFeatures=None, gdbVersion=None, rollbackOnFailure=True): editURL = self._url + "/applyEdits" ...
[ "\n This operation adds, updates, and deletes features to the\n associated feature layer or table in a single call.\n Inputs:\n addFeatures - The array of features to be added. These\n features should be common.general.Feature\n ...
Please provide a description of the function:def query(self, where="1=1", out_fields="*", timeFilter=None, geometryFilter=None, returnGeometry=True, returnIDsOnly=False, returnCountOnly=False, returnFeatureCl...
[ " queries a feature service based on a sql statement\n Inputs:\n where - the selection sql statement\n out_fields - the attribute fields to return\n timeFilter - a TimeFilter object where either the start time\n or start and end time ar...
Please provide a description of the function:def calculate(self, where, calcExpression, sqlFormat="standard"): url = self._url + "/calculate" params = { "f" : "json", "where" : where, } if isinstance(calcExpression, dict): params["calcExpress...
[ "\n The calculate operation is performed on a feature service layer\n resource. It updates the values of one or more fields in an\n existing feature service layer based on SQL expressions or scalar\n values. The calculate operation can only be used if the\n supportsCalculate prope...
Please provide a description of the function:def asDictionary(self): template = {"type" : self._type, "mapLayerId" : self._mapLayerId} if not self._gdbVersion is None and\ self._gdbVersion != "": template['gdbVersion'] = self._gdbVersion return...
[ " converts the object to a dictionary " ]
Please provide a description of the function: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 " ]
Please provide a description of the function:def dataSource(self, value): if isinstance(value, DataSource): self._dataSource = value else: raise TypeError("value must be a DataSource object")
[ " sets the datasource object " ]
Please provide a description of the function:def fields(self, value): if type(value) is list: self._fields = value else: raise TypeError("Input must be a list")
[ "sets the fields variable" ]
Please provide a description of the function:def asJSON(self): self._json = json.dumps(self.asDictionary) return self._json
[ " returns the data source as JSON " ]
Please provide a description of the function:def asDictionary(self): self._dict = { "type" : self._type, "workspaceId" : self._workspaceId, "dataSourceName": self._dataSourceName, "gdbVersion" : self._gdbVersion } return self._dict
[ " returns the data source as JSON " ]
Please provide a description of the function:def asDictionary(self): self._dict = { "type": "queryTable", "workspaceId": self._workspaceId, "query": self._query, "oidFields": self._oidFields, "spatialReference": {"wkid" : self._wkid} }...
[ " returns the data source as a dictionary " ]
Please provide a description of the function:def asDictionary(self): return { "type": "joinTable", "leftTableSource": self._leftTableSource, "rightTableSource": self._rightTableSource, "leftTableKey": self._leftTableKey, "rightTableKey": self....
[ " returns the data source as a dictionary " ]
Please provide a description of the function:def addCodedValue(self, name, code): i = {"name" : name, "code" : code} if i not in self._codedValues: self._codedValues.append(i)
[ "\n adds a coded value to the domain\n\n Inputs:\n name - name of the domain\n code - value\n " ]
Please provide a description of the function: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" ]
Please provide a description of the function:def value(self): return { "type" : self._type, "name" : self._name, "range" : [self._rangeMin, self._rangeMax] }
[ "gets the value as a dictionary" ]
Please provide a description of the function:def minValue(self, value): if isinstance(value, [int, float, long]): self._rangeMin = value
[ "gets/sets the min value" ]
Please provide a description of the function:def maxValue(self, value): if isinstance(value, [int, float, long]): self._rangeMax = value
[ "gets/sets the min value" ]
Please provide a description of the function:def securityHandler(self, value): if isinstance(value, BaseSecurityHandler): if isinstance(value, (AGSTokenSecurityHandler, PortalServerSecurityHandler)): self._securityHandler = value ...
[ " sets the security handler " ]
Please provide a description of the function:def exportImage(self, bbox, imageSR, bboxSR, size=[400,400], time=None, format="jpgpng", pixelType="UNKNOWN", noDat...
[ "\n The exportImage operation is performed on an image service resource\n The result of this operation is an image resource. This resource\n provides information about the exported image, such as its URL,\n extent, width, and height.\n In addition to the usual response formats of ...
Please provide a description of the function:def query(self, where="1=1", out_fields="*", timeFilter=None, geometryFilter=None, returnGeometry=True, returnIDsOnly=False, returnCountOnly=False, pixelSize=None,...
[ " queries a feature service based on a sql statement\n Inputs:\n where - the selection sql statement\n out_fields - the attribute fields to return\n timeFilter - a TimeFilter object where either the start time\n or start and end time ar...
Please provide a description of the function:def addRasters(self, rasterType, itemIds=None, serviceUrl=None, computeStatistics=False, buildPyramids=False, buildThumbnail=False, minimumCellSizeFactor=None, maximumCellSizeFact...
[ "\n This operation is supported at 10.1 and later.\n The Add Rasters operation is performed on an image service resource.\n The Add Rasters operation adds new rasters to an image service\n (POST only).\n The added rasters can either be uploaded items, using the itemIds\n pa...
Please provide a description of the function:def identify(self,geometry,geometryType="esriGeometryPoint",mosaicRule=None, renderingRule=None,renderingRules=None,pixelSize=None,time=None, returnGeometry="false",returnCatalogItems="false"): url = self._url + "/identify"...
[ "\n The identify operation is performed on an image service resource.\n It identifies the content of an image service for a given location\n and a given mosaic rule. The location can be a point or a polygon.\n The identify operation is supported by both mosaic dataset and raster\n ...
Please provide a description of the function:def measure(self,fromGeometry,toGeometry,measureOperation, geometryType="esriGeometryPoint",pixelSize=None,mosaicRule=None, linearUnit=None,angularUnit=None,areaUnit=None): url = self._url + "/measure" params = { ...
[ "\n The measure operation is performed on an image service resource. It\n lets a user measure distance, direction, area, perimeter, and height\n from an image service. The result of this operation includes the name\n of the raster dataset being used, sensor name, and measured values.\n\n...
Please provide a description of the function:def computeStatisticsHistograms(self,geometry,geometryType,mosaicRule=None, renderingRule=None,pixelSize=None): url = self._url + "/computeStatisticsHistograms" params = { "f" : "json", "ge...
[ "\n The computeStatisticsHistograms operation is performed on an image service\n resource. This operation is supported by any image service published with\n mosaic datasets or a raster dataset. The result of this operation contains\n both statistics and histograms computed from the given...
Please provide a description of the function:def getSamples(self,geometry,geometryType="esriGeometryPoint", sampleDistance=None,sampleCount=None,mosaicRule=None, pixelSize=None,returnFirstValueOnly=None,interpolation=None, outFields=None): url =...
[ "\n The getSamples operation is performed on an image service resource.\n The getSamples operation is supported by both mosaic dataset and raster\n dataset image services.\n The result of this operation includes sample point locations, pixel\n values, and corresponding spatial res...
Please provide a description of the function:def registerItem(self, itemName, description=None): url = self._url + "/register" params = { "f" : "json", "itemName" : itemName, "description" : "" } if description is not None: params[...
[ "\n creates an entry for a given item. Once the entry is created, then\n the item can be uploaded by parts. Once finished, a commit call is\n made to merge the parts together.\n Inputs:\n itemName - name of the item to upload\n description - optional description describi...
Please provide a description of the function: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.AC...
[ "\n loads the data by small parts. If commit is set to true,\n then parts will be merged together. If commit is false, the\n function will return the registerID so a manual commit can occur.\n\n If the user's file is over 10mbs, the uploadByParts should be used.\n\n Inputs:\n ...
Please provide a description of the function:def commit(self, registerID, checksum=None): parts = ",".join(self.parts(registerID=registerID)) url = self._url + "/%s/commit" params = { "f" : "json", "parts" : parts } if checksum is not None: ...
[ "\n Once a multipart upload is completed, the files need to be merged\n together. The commit() does just that.\n Inputs:\n registerID - unique identifier of the registered item.\n checksum - upload id.\n output:\n dictionary\n " ]
Please provide a description of the function:def uploads(self): if self.syncEnabled == True: return Uploads(url=self._url + "/uploads", securityHandler=self._securityHandler, proxy_url=self._proxy_url, proxy_po...
[ "returns the class to perform the upload function. it will\n only return the uploads class if syncEnabled is True.\n " ]
Please provide a description of the function: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...
[ "returns the hostservice object to manage the back-end functions" ]
Please provide a description of the function:def replicas(self): params = { "f" : "json", } url = self._url + "/replicas" return self._get(url, params, securityHandler=self._securityHandler, proxy_url=self._proxy_url...
[ " returns all the replicas for a feature service " ]
Please provide a description of the function:def createReplica(self, replicaName, layers, layerQueries=None, geometryFilter=None, replicaSR=None, transportType="esriTransportTypeUrl", ...
[ "\n The createReplica operation is performed on a feature service\n resource. This operation creates the replica between the feature\n service and a client based on a client-supplied replica definition.\n It requires the Sync capability. See Sync overview for more\n information on...
Please provide a description of the function:def synchronizeReplica(self, replicaID, transportType="esriTransportTypeUrl", replicaServerGen=None, returnIdsForAdds=False, edits=None, ...
[ "\n TODO: implement synchronize replica\n http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000vv000000\n " ]
Please provide a description of the function:def replicaStatus(self, url): params = {"f" : "json"} url = url + "/status" return self._get(url=url, param_dict=params, securityHandler=self._securityHandler, ...
[ "gets the replica status when exported async set to True" ]
Please provide a description of the function:def __init(self): params = { "f" : "json", } json_dict = self._get(self._url, params, securityHandler=self._securityHandler, proxy_port=self._proxy_port, ...
[ " initializes the service " ]
Please provide a description of the function:def securityHandler(self, value): if isinstance(value, abstract.BaseSecurityHandler): if isinstance(value, security.AGOLTokenSecurityHandler): self._securityHandler = value self._token = value.token ...
[ " sets the security handler " ]
Please provide a description of the function:def addAttachment(self, oid, file_path): if self.hasAttachments == True: attachURL = self._url + "/%s/addAttachment" % oid params = {'f':'json'} parsed = urlparse.urlparse(attachURL) files = {'attachment': fil...
[ " Adds an attachment to a feature service\n Input:\n oid - string - OBJECTID value to add attachment to\n file_path - string - path to file\n Output:\n JSON Repsonse\n " ]
Please provide a description of the function:def updateAttachment(self, oid, attachment_id, file_path): url = self._url + "/%s/updateAttachment" % oid params = { "f":"json", "attachmentId" : "%s" % attachment_id } files = {'attachment': file_path } ...
[ " updates an existing attachment with a new file\n Inputs:\n oid - string/integer - Unique record ID\n attachment_id - integer - Unique attachment identifier\n file_path - string - path to new attachment\n Output:\n JSON response\n ...
Please provide a description of the function:def listAttachments(self, oid): url = self._url + "/%s/attachments" % oid params = { "f":"json" } return self._get(url, params, securityHandler=self._securityHandler, ...
[ " list attachements for a given OBJECT ID " ]
Please provide a description of the function: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 \ ...
[ "\n downloads a feature's attachment.\n\n Inputs:\n oid - object id of the feature\n attachment_id - ID of the attachment. Should be an integer.\n out_folder - save path of the file\n Output:\n string - full path of the file\n " ]
Please provide a description of the function: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, ...
[ "creates a featureclass template on local disk" ]
Please provide a description of the function: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: ...
[ "creates a feature template" ]
Please provide a description of the function:def query(self, where="1=1", out_fields="*", timeFilter=None, geometryFilter=None, returnGeometry=True, returnCountOnly=False, returnIDsOnly=False, returnFeatureCl...
[ " queries a feature service based on a sql statement\n Inputs:\n where - the selection sql statement\n out_fields - the attribute fields to return\n objectIds - The object IDs of this layer or table to be\n queried.\n ...
Please provide a description of the function:def query_related_records(self, objectIds, relationshipId, outFields="*", definitionExpression=None, returnGeometry=True, ...
[ "\n The Query operation is performed on a feature service layer\n resource. The result of this operation are feature sets grouped\n by source layer/table object IDs. Each feature set contains\n Feature objects including the values for the fields requested by\n the u...
Please provide a description of the function:def getHTMLPopup(self, oid): if self.htmlPopupType != "esriServerHTMLPopupTypeNone": popURL = self._url + "/%s/htmlPopup" % oid params = { 'f' : "json" } return self._get(url=popURL, param_dict...
[ "\n The htmlPopup resource provides details about the HTML pop-up\n authored by the user using ArcGIS for Desktop.\n Input:\n oid - object id of the feature where the HTML pop-up\n Output:\n\n " ]
Please provide a description of the function:def get_local_copy(self, out_path, includeAttachments=False): if self.hasAttachments and \ self.parentLayer != None and self.parentLayer.syncEnabled: return self.parentLayer.createReplica(replicaName="fgdb_dump", ...
[ " exports the whole feature service to a feature class\n Input:\n out_path - path to where the data will be placed\n includeAttachments - default False. If sync is not supported\n then the paramter is ignored.\n Output:\n ...
Please provide a description of the function:def applyEdits(self, addFeatures=None, updateFeatures=None, deleteFeatures=None, gdbVersion=None, useGlobalIds=False, rollbackOnFailure=True, ...
[ "\n This operation adds, updates, and deletes features to the\n associated feature layer or table in a single call.\n Inputs:\n addFeatures - The array of features to be added. These\n features should be common.Feature objects, or\n ...
Please provide a description of the function:def addFeature(self, features, gdbVersion=None, rollbackOnFailure=True): url = self._url + "/addFeatures" params = { "f" : "json" } if gdbVersion is not None: params['gdbVe...
[ " Adds a single feature to the service\n Inputs:\n feature - list of common.Feature object or a single\n common.Feature Object, a FeatureSet object, or a\n list of dictionary objects\n gdbVersion - Geodatabase version to apply the edi...
Please provide a description of the function:def securityHandler(self, value): if isinstance(value, BaseSecurityHandler): if isinstance(value, security.AGOLTokenSecurityHandler): self._securityHandler = value elif isinstance(value, security.OAuthSecurityHandler):...
[ " sets the security handler " ]
Please provide a description of the function:def asDictionary(self): if self._wkid == None and self._wkt is not None: return {"wkt": self._wkt} else: return {"wkid": self._wkid}
[ "returns the wkid id for use in json calls" ]
Please provide a description of the function:def value(self): if self._wkid == None and self._wkt is not None: return {"wkt": self._wkt} else: return {"wkid": self._wkid}
[ "returns the wkid id for use in json calls" ]
Please provide a description of the function: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" ]
Please provide a description of the function: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 " ]
Please provide a description of the function: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 " ]
Please provide a description of the function:def asDictionary(self): # template = {"x" : self._x, "y" : self._y, "spatialReference" : self.spatialReference } if not self._z is None: template['z'] = self._z i...
[ " returns the object as a python dictionary " ]
Please provide a description of the function:def asList(self): base = [self._x, self._y] if not self._z is None: base.append(self._z) elif not self._m is None: base.append(self._m) return base
[ " returns a Point value as a list of [x,y,<z>,<m>] " ]
Please provide a description of the function:def X(self, value): if isinstance(value, (int, float, long, types.NoneType)): self._x = value
[ "sets the X coordinate" ]
Please provide a description of the function:def Y(self, value): if isinstance(value, (int, float, long, types.NoneType)): self._y = value
[ " sets the Y coordinate " ]
Please provide a description of the function:def Z(self, value): if isinstance(value, (int, float, long, types.NoneType)): self._z = value
[ " sets the Z coordinate " ]
Please provide a description of the function:def wkid(self, value): if isinstance(value, (int, long)): self._wkid = value
[ " sets the wkid " ]
Please provide a description of the function:def __geomToPointList(self, geom): if arcpyFound and isinstance(geom, arcpy.Multipoint): feature_geom = [] fPart = [] for part in geom: fPart = [] for pnt in part: fPart....
[ " converts a geometry object to a common.Geometry object " ]
Please provide a description of the function:def asDictionary(self): # value = self._dict if value is None: template = { "hasM" : self._hasM, "hasZ" : self._hasZ, "points" : [], "spatialReference" : self.spatial...
[ " returns the object as a python dictionary " ]
Please provide a description of the function:def __geomToPointList(self, geom): if arcpyFound and isinstance(geom, arcpy.Polyline): feature_geom = [] fPart = [] wkt = None wkid = None for part in geom: fPart = [] ...
[ " converts a geometry object to a common.Geometry object " ]
Please provide a description of the function:def asDictionary(self): value = self._dict if value is None: template = { "hasM" : self._hasM, "hasZ" : self._hasZ, "paths" : [], "spatialReference" : self.spatialReference ...
[ " returns the object as a python dictionary " ]
Please provide a description of the function:def __geomToPointList(self, geom): sr = geom.spatialReference wkid = None wkt = None if sr is None: if self._wkid is None and self._wkt is not None: wkt = self._wkt else: wkid = ...
[ " converts a geometry object to a common.Geometry object " ]
Please provide a description of the function:def asDictionary(self): value = self._dict if value is None: template = { "hasM" : self._hasM, "hasZ" : self._hasZ, "rings" : [], "spatialReference" : self.spatialReference ...
[ " returns the object as a python dictionary " ]
Please provide a description of the function:def asDictionary(self): template = { "xmin" : self._xmin, "ymin" : self._ymin, "xmax" : self._xmax, "ymax" : self._ymax, "spatialReference" : self.spatialReference } if self._zmax is...
[ " returns the envelope as a dictionary " ]
Please provide a description of the function: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(en...
[ " returns the Envelope as an ESRI arcpy.Polygon object " ]
Please provide a description of the function:def _processHandler(self, securityHandler, param_dict): cj = None handler = None if securityHandler is None: cj = cookiejar.CookieJar() elif securityHandler.method.lower() == "token": param_dict['token'] = secu...
[ "proceses the handler and returns the cookiejar" ]
Please provide a description of the function: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 =...
[ " processes the response object" ]
Please provide a description of the function:def _make_boundary(self): if self.PY2: return '===============%s==' % uuid.uuid4().get_hex() elif self.PY3: return '===============%s==' % uuid.uuid4().hex else: from random import choice digits...
[ " creates a boundary for multipart post (form post)" ]
Please provide a description of the function:def _post(self, url, param_dict={}, files={}, securityHandler=None, additional_headers={}, custom_handlers=[], proxy_url=None, proxy_port=80, compress=True, ...
[ "\n Performs a POST operation on a URL.\n\n Inputs:\n param_dict - key/value pair of values\n ex: {\"foo\": \"bar\"}\n files - key/value pair of file objects where the key is\n the input name and the value is the file path\n ex: {\"file\": r\"...
Please provide a description of the function:def _get(self, url, param_dict={}, securityHandler=None, additional_headers=[], handlers=[], proxy_url=None, proxy_port=None, compress=True, custom_handlers=[], ...
[ "\n Performs a GET operation\n Inputs:\n\n Output:\n returns dictionary, string or None\n " ]
Please provide a description of the function:def addRole(self, name, description=""): params = { "f" : "json", "rolename" : name, "description" : description } aURL = self._url + "/roles/add" return self._post(url=aURL, param_dict=params, ...
[ " Adds a role to the role store. This operation is available only\n when the role store is a read-write store such as the default\n ArcGIS Server store.\n If the name of the role exists in the role store, an error will\n be returned.\n Input:\n ro...
Please provide a description of the function: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,...
[ " Assigns a role to multiple users " ]
Please provide a description of the function:def getPrivilegeForRole(self, rolename): params = { "f" : "json", "rolename" : rolename } pURL = self._url + "/roles/getPrivilege" return self._post(url=pURL, param_dict=params, ...
[ "\n Returns the privilege associated with a role.\n Input:\n rolename - name of the role\n Output:\n JSON Messages\n " ]
Please provide a description of the function:def getRoles(self, startIndex=0, pageSize=10): uURL = self._url + "/roles/getRoles" params = { "f" : "json", "startIndex" : startIndex, "pageSize" : pageSize } return self._post(url=uURL, param_dict...
[ " This operation gives you a pageable view of roles in the role\n store. It is intended for iterating through all available role\n accounts. To search for specific role accounts instead, use the\n Search Roles operation.\n Inputs:\n startIndex - The starting...
Please provide a description of the function:def getRolesForUser(self, username, filter=None, maxCount=None): uURL = self._url + "/roles/getRolesForUser" params = { "f" : "json", "username" : username } if filter is not None: params['filter'] ...
[ "\n This operation returns a list of role names that have been\n assigned to a particular user account.\n Inputs:\n username - name of the user for whom the returned roles\n filter - filter to be applied to the resultant role set.\n maxCount - max...
Please provide a description of the function:def getUsersWithinRole(self, rolename, filter=None, maxCount=20): uURL = self._url + "/roles/getUsersWithinRole" params = { "f" : "json", "rolename" : rolename, "maxCount" : maxCount } if filter is ...
[ "\n You can use this operation to conveniently see all the user\n accounts to whom this role has been assigned.\n Inputs:\n rolename - name of the role\n filter - filter to be applied to the resultant user set\n maxCount - maximum number of result...
Please provide a description of the function:def addGraphic(self, layerName, geometry, symbol): allowed_geomtypes = ['polygon', 'polyline', 'point', 'multipoint'] if not (geometry.type.lower() in allowed_geomtypes): return False, layerName geom = _unicode_convert(json.loads(...
[ " loads a geometry (ArcPy Geometry Object) into Graphic Layer" ]
Please provide a description of the function:def __look_up_geom(self, geomType): if geomType.lower() == "point": return "esriGeometryPoint" elif geomType.lower() == "polyline": return "esriGeometryPolyline" elif geomType.lower() == "polygon": return ...
[ " compares the geometry object's type verse the JSOn\n specs for geometry types\n Inputs:\n geomType - string - geometry object's type\n Returns:\n string JSON geometry type or None if not an allowed type\n " ]
Please provide a description of the function:def serverProperties(self): return ServerProperties(url=self._url + "/properties", securityHandler=self._securityHandler, proxy_url=self._proxy_url, proxy_port=sel...
[ "gets the server properties for the site as an object" ]
Please provide a description of the function:def serverDirectories(self): directs = [] url = self._url + "/directories" params = { "f" : "json" } res = self._get(url=url, param_dict=params, securityHandler...
[ "returns the server directory object in a list" ]
Please provide a description of the function:def registerDirectory(self,name,physicalPath,directoryType,cleanupMode, maxFileAge,description): url = self._url + "/directories/register" params = { "f" : "json", "name" : name, "physical...
[ "\n Registers a new server directory. While registering the server directory,\n you can also specify the directory's cleanup parameters. You can also\n register a directory by using its JSON representation as a value of the\n directory parameter.\n Inputs:\n name - The ...
Please provide a description of the function:def registerDirs(self,json_dirs): url = self._url + "/directories/registerDirs" params = { "f" : "json", "directories" : json_dirs } res = self._post(url=url, param_dict=params, ...
[ "\n Registers multiple new server directories.\n Inputs:\n json_dirs - Array of Server Directories in JSON format.\n " ]
Please provide a description of the function: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=T...
[ "get the Jobs object" ]
Please provide a description of the function:def registerWebAdaptor(self, webAdaptorURL, machineName, machineIP, isAdminEnabled, description, httpPort, httpsPort): url = self._url + "/webadaptors/register" params = { "f" : "json", "webAdaptorUR...
[ "\n You can use this operation to register the ArcGIS Web Adaptor\n from your ArcGIS Server. By registering the Web Adaptor with the server, \n you are telling the server to trust requests (including security \n credentials) that have been submitted through this Web Adaptor. \n\n ...
Please provide a description of the function:def configurationStore(self): url = self._url + "/configstore" return ConfigurationStore(url=url, securityHandler=self._securityHandler, proxy_url=self._proxy_url, ...
[ "returns the ConfigurationStore object for this site" ]
Please provide a description of the function:def recover(self,runAsync=False): url = self._url + "/recover" params = { "f" : "json", "runAsync" : runAsync } return self._post(url=url, param_dict=params, ...
[ "\n If the shared configuration store for a site is unavailable, a site\n in read-only mode will operate in a degraded capacity that allows\n access to the ArcGIS Server Administrator Directory. You can recover\n a site if the shared configuration store is permanently lost. The\n ...
Please provide a description of the function:def RemoveAndAddFeatures(self, url, pathToFeatureClass, id_field, chunksize=1000): fl = None try: if arcpyFound == False: raise common.ArcRestHelperError({ "function": "RemoveAndAddFeatures", ...
[ "Deletes all features in a feature service and uploads features from a feature class on disk.\n\n Args:\n url (str): The URL of the feature service.\n pathToFeatureClass (str): The path of the feature class on disk.\n id_field (str): The name of the field in the feature class...
Please provide a description of the function:def EnableEditingOnService(self, url, definition = None): adminFS = AdminFeatureService(url=url, securityHandler=self._securityHandler) if definition is None: definition = collections.OrderedDict() definition['hasStaticData']...
[ "Enables editing capabilities on a feature service.\n\n Args:\n url (str): The URL of the feature service.\n definition (dict): A dictionary containing valid definition values. Defaults to ``None``.\n Returns:\n dict: The existing feature service definition capabilitie...
Please provide a description of the function:def enableSync(self, url, definition = None): adminFS = AdminFeatureService(url=url, securityHandler=self._securityHandler) cap = str(adminFS.capabilities) existingDef = {} enableResults = 'skipped' if 'Sync' in cap: ...
[ "Enables Sync capability for an AGOL feature service.\n\n Args:\n url (str): The URL of the feature service.\n definition (dict): A dictionary containing valid definition values. Defaults to ``None``.\n Returns:\n dict: The result from :py:func:`arcrest.hostedservice.s...
Please provide a description of the function:def GetFeatureService(self, itemId, returnURLOnly=False): admin = None item = None try: admin = arcrest.manageorg.Administration(securityHandler=self._securityHandler) if self._securityHandler.valid == False: ...
[ "Obtains a feature service by item ID.\n\n Args:\n itemId (str): The feature service's item ID.\n returnURLOnly (bool): A boolean value to return the URL of the feature service. Defaults to ``False``.\n Returns:\n When ``returnURLOnly`` is ``True``, the URL of the feat...
Please provide a description of the function:def GetLayerFromFeatureServiceByURL(self, url, layerName="", returnURLOnly=False): fs = None try: fs = arcrest.agol.FeatureService( url=url, securityHandler=self._securityHandler) retur...
[ "Obtains a layer from a feature service by URL reference.\n\n Args:\n url (str): The URL of the feature service.\n layerName (str): The name of the layer. Defaults to ``\"\"``.\n returnURLOnly (bool): A boolean value to return the URL of the layer. Defaults to ``False``.\n ...
Please provide a description of the function: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 f...
[ "Obtains a layer from a feature service by feature service reference.\n\n Args:\n fs (FeatureService): The feature service from which to obtain the layer.\n layerName (str): The name of the layer. Defaults to ``\"\"``.\n returnURLOnly (bool): A boolean value to return the URL...
Please provide a description of the function:def AddFeaturesToFeatureLayer(self, url, pathToFeatureClass, chunksize=0, lowerCaseFieldNames=False): if arcpyFound == False: raise common.ArcRestHelperError({ "function": "AddFeaturesToFeatureLayer", "line": inspe...
[ "Appends local features to a hosted feature service layer.\n\n Args:\n url (str): The URL of the feature service layer.\n pathToFeatureClass (str): The path of the feature class on disk.\n chunksize (int): The maximum amount of features to upload at a time. Defaults to 0.\n ...
Please provide a description of the function:def DeleteFeaturesFromFeatureLayer(self, url, sql, chunksize=0): fl = None try: fl = FeatureLayer( url=url, securityHandler=self._securityHandler) totalDeleted = 0 if chunksize...
[ "Removes features from a hosted feature service layer by SQL query.\n\n Args:\n url (str): The URL of the feature service layer.\n sql (str): The SQL query to apply against the feature service.\n Those features that satisfy the query will be deleted.\n chunksiz...
Please provide a description of the function:def QueryAllFeatures(self, url=None, where="1=1", out_fields="*", timeFilter=None, geometryFilter=None, returnFeatureClass=False, ...
[ "Performs an SQL query against a hosted feature service layer\n and returns all features regardless of service limit.\n\n Args:\n url (str): The URL of the feature service layer.\n where - the selection sql statement\n out_fields - the attribute fields to return\n ...