Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def addUser(self, username, password,
firstname, lastname,
email, role):
self._invites.append({
"username":username,
"password":password,
"firstname":firstname,
"lastname":lastna... | [
"adds a user to the invitation list"
] |
Please provide a description of the function:def removeByIndex(self, index):
if index < len(self._invites) -1 and \
index >=0:
self._invites.remove(index) | [
"removes a user from the invitation list by position"
] |
Please provide a description of the function:def value(self):
val = {}
if self.sourcelocale is not None:
val['sourcelocale'] = self.sourcelocale
if self.geocodeServiceUrl is not None:
val['geocodeServiceUrl'] = self.geocodeServiceUrl
if self.sourcecountry... | [
"returns object as a dictionary"
] |
Please provide a description of the function:def fromDictionary(value):
if isinstance(value, dict):
pp = PortalParameters()
for k,v in value.items():
setattr(pp, "_%s" % k, v)
return pp
else:
raise AttributeError("Invalid input.") | [
"creates the portal properties object from a dictionary"
] |
Please provide a description of the function:def value(self):
val = {}
for k in self.__allowed_keys:
v = getattr(self, "_" + k)
if v is not None:
val[k] = v
return val | [
" returns the class as a dictionary "
] |
Please provide a description of the function:def value(self):
r = {}
attributes = [attr for attr in dir(self)
if not attr.startswith('__') and \
not attr.startswith('_')]
for a in attributes:
if a != "value":
val = ... | [
" returns the class as a dictionary "
] |
Please provide a description of the function:def thumbnail(self, value):
if os.path.isfile(value) and \
self._thumbnail != value:
self._thumbnail = value
elif value is None:
self._thumbnail = None | [
"\n gets/sets the thumbnail\n Enter the pathname to the thumbnail image to be used for the item.\n The recommended image size is 200 pixels wide by 133 pixels high.\n Acceptable image formats are PNG, GIF, and JPEG. The maximum file\n size for an image is 1 MB. This is not a refer... |
Please provide a description of the function:def value(self):
val = {}
for k in self.__allowed_keys:
value = getattr(self, "_" + k)
if value is not None:
val[k] = value
return val | [
"returns the values as a dictionary"
] |
Please provide a description of the function:def locationType(self, value):
if value.lower() in self._allowed_locationType and \
self._locationType.lower() != value.lower():
self._locationType = value.lower() | [
"\n gets/sets the location type\n "
] |
Please provide a description of the function:def hasStaticData(self, value):
if self._hasStaticData != value and \
isinstance(value, bool):
self._hasStaticData = value | [
"gets/sets the hasStaticData"
] |
Please provide a description of the function:def value(self):
return {
"hasStaticData":self._hasStaticData,
"name":self._name,
"maxRecordCount":self._maxRecordCount,
"layerInfo":self._layerInfo
} | [
"returns the object as a dictionary"
] |
Please provide a description of the function:def vector_tile(self, level, row, column, out_folder=None):
url = "{url}/tile/{level}/{row}/{column}.pdf".format(url=self._url,
level=level,
... | [
"This resource represents a single vector tile for the map. The\n bytes for the tile at the specified level, row and column are\n returned in PBF format. If a tile is not found, an HTTP status code\n of 404 (Not found) is returned."
] |
Please provide a description of the function:def tile_sprite(self, out_format="sprite.json", out_folder=None):
url = "{url}/resources/sprites/{f}".format(url=self._url,
f=out_format)
if out_folder is None:
out_folder = tempfile.gett... | [
"\n This resource returns sprite image and metadata\n "
] |
Please provide a description of the function:def main(*argv):
try:
adminUsername = argv[0]
adminPassword = argv[1]
siteURL = argv[2]
username = argv[3]
groupName = argv[4]
# Logic
#
# Connect to AGOL
#
sh = arcrest.AGOLTokenSec... | [
" main driver of program "
] |
Please provide a description of the function:def shareItemsToGroup(self, shareToGroupName, items=None, groups=None):
admin = None
userCommunity = None
group_ids = None
results = None
item = None
res = None
group = None
groupContent = None
... | [
"Share already published items with a group(s).\n \n Args:\n shareToGroupName (list): The name of the group(s) with which the item(s) will be shared.\n items (list): The item(s) that will be shared, referenced by their ID. Defaults to ``None``.\n groups (list): The gro... |
Please provide a description of the function:def getGroupContentItems(self, groupName):
admin = None
userCommunity = None
groupIds = None
groupId = None
groupContent = None
result = None
item = None
items = []
try:
admin = arc... | [
"Gets all the items owned by a group(s).\n \n Args:\n groupName (list): The name of the group(s) from which to get items.\n Returns:\n list: A list of items belonging to the group(s).\n Notes:\n If you want to get items from a single group, ``groupName`` ... |
Please provide a description of the function:def getGroupContent(self, groupName, onlyInOrg=False, onlyInUser=False):
admin = None
groups = None
q = None
results = None
res = None
try:
admin = arcrest.manageorg.Administration(securityHandler=self._sec... | [
"Gets all the content from a group.\n \n Args:\n groupName (str): The name of the group from which to get items.\n onlyInOrg (bool): A boolean value to only return content belonging to the current org.\n Defaults to ``False``.\n onlyInUser (bool): A bool... |
Please provide a description of the function:def getThumbnailForItem(self, itemId, fileName, filePath):
admin = None
item = None
try:
admin = arcrest.manageorg.Administration(securityHandler=self._securityHandler)
item = admin.content.getItem(itemId = itemId)
... | [
"Gets an item's thumbnail and saves it to disk.\n \n Args:\n itemId (str): The item's ID.\n fileName (str): The name of the output image.\n fileName (str): The directory on disk where to save the thumbnail.\n Returns:\n dict: The result from :py:func:... |
Please provide a description of the function:def createGroup(self,
title,
tags,
description="",
snippet="",
phone="",
access="org", sortField="title",
sortOrder="asc", isViewOnly=F... | [
"Creates a new group.\n \n Args:\n title (str): The name of the new group, limited to 250 characters.\n tags (str): A comma delimited list of tag names.\n description (str): A description of the group that can be any length.\n snippet (str): Snippet or summa... |
Please provide a description of the function:def createRole(self, name, description="", privileges=None):
admin = None
portal = None
setPrivResults = None
roleID = None
createResults = None
try:
admin = arcrest.manageorg.Administration(securityHandler... | [
"Creates a new role.\n \n Args:\n name (str): The name of the new role.\n description (str): The description of the new role. Defaults to ``\"\"``.\n privileges (str): A comma delimited list of privileges to apply to the new role.\n Defaults to ``None``.... |
Please provide a description of the function:def administration(self):
from ..manageags._services import AGSService
url = self._url
res = search("/rest/", url).span()
addText = "/admin/"
part1 = url[:res[1]].lower().replace('/rest/', '')
part2 = url[res[1]:].lowe... | [
"returns the service admin object (if accessible)"
] |
Please provide a description of the function:def layers(self):
if self._layers is None:
self.__init()
self._getLayers()
return self._layers | [
" gets the layers for the feature service "
] |
Please provide a description of the function:def _getLayers(self):
params = {"f": "json"}
json_dict = self._get(self._url, params,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
... | [
" gets layers for the featuer service "
] |
Please provide a description of the function:def create_feature_layer(ds, sql, name="layer"):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
result = arcpy.MakeFeatureLayer_management(in_features=ds,
out_layer=name,
... | [
" creates a feature layer object "
] |
Please provide a description of the function:def featureclass_to_json(fc):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fc)
if desc.dataType == "Table" or desc.dataType == "TableView":
return recordset_to_json(table=fc)
else... | [
"converts a feature class to JSON"
] |
Please provide a description of the function:def json_to_featureclass(json_file, out_fc):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
return arcpy.JSONToFeatures_conversion(in_json_file=json_file,
out_features=out_fc)[0] | [
" converts a json file (.json) to a feature class "
] |
Please provide a description of the function:def get_attachment_data(attachmentTable, sql,
nameField="ATT_NAME", blobField="DATA",
contentTypeField="CONTENT_TYPE",
rel_object_field="REL_OBJECTID"):
if arcpyFound == False:
raise Exc... | [
" gets all the data to pass to a feature service "
] |
Please provide a description of the function:def get_records_with_attachments(attachment_table, rel_object_field="REL_OBJECTID"):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
OIDs = []
with arcpy.da.SearchCursor(attachment_table,
... | [
"returns a list of ObjectIDs for rows in the attachment table"
] |
Please provide a description of the function:def get_OID_field(fs):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
desc = arcpy.Describe(fs)
if desc.hasOID:
return desc.OIDFieldName
return None | [
"returns a featureset's object id field"
] |
Please provide a description of the function:def merge_feature_class(merges, out_fc, cleanUp=True):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
if cleanUp == False:
if len(merges) == 0:
return None
elif len(merges) == 1:
... | [
" merges featureclass into a single feature class "
] |
Please provide a description of the function:def getDateFields(fc):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
return [field.name for field in arcpy.ListFields(fc, field_type="Date")] | [
"\n Returns a list of fields that are of type DATE\n Input:\n fc - feature class or table path\n Output:\n List of date field names as strings\n "
] |
Please provide a description of the function:def insert_rows(fc,
features,
fields,
includeOIDField=False,
oidField=None):
if arcpyFound == False:
raise Exception("ArcPy is required to use this function")
icur = None
if includeOIDFi... | [
" inserts rows based on a list features object "
] |
Please provide a description of the function:def create_feature_class(out_path,
out_name,
geom_type,
wkid,
fields,
objectIdField):
if arcpyFound == False:
raise Exception("ArcPy ... | [
" creates a feature class in a given gdb or folder "
] |
Please provide a description of the function:def lookUpFieldType(field_type):
if field_type == "esriFieldTypeDate":
return "DATE"
elif field_type == "esriFieldTypeInteger":
return "LONG"
elif field_type == "esriFieldTypeSmallInteger":
return "SHORT"
elif field_type == "esriF... | [
" Converts the ArcGIS REST field types to Python Types\n Input:\n field_type - string - type of field as string\n Output:\n Python field type as string\n "
] |
Please provide a description of the function:def download_arcrest():
arcrest_name = "arcrest.zip"
arcresthelper_name = "arcresthelper.zip"
url = "https://github.com/Esri/ArcREST/archive/master.zip"
file_name = os.path.join(arcpy.env.scratchFolder, os.path.basename(url))
scratch_folder = os.pat... | [
"downloads arcrest to disk"
] |
Please provide a description of the function:def _generateForTokenSecurity(self):
agolToken = self._agolSecurityHandler.token
url = self._url + "/getProxyUserToken"
params = {"token" : self._agolSecurityHandler.token,
"contributorUid" : self._contributionUID}
r... | [
" generates a token for a feature service "
] |
Please provide a description of the function:def _initURL(self,
org_url,
referer_url):
if org_url is not None and org_url != '':
if not org_url.startswith('http://') and not org_url.startswith('https://'):
org_url = 'https://' + org_url
... | [
" sets proper URLs for AGOL "
] |
Please provide a description of the function:def username(self, value):
if isinstance(value, str):
self._username = value
self._handler = None | [
"gets/sets the username"
] |
Please provide a description of the function:def password(self, value):
if isinstance(value, str):
self._password = value
self._handler = None | [
"gets/sets the current password"
] |
Please provide a description of the function:def handler(self):
if self._handler is None:
passman = request.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None,
self._parsed_org_url,
self._login_username,
... | [
"returns the handler"
] |
Please provide a description of the function:def portalServerHandler(self, serverUrl, username=None):
from ..manageorg import Administration
admin = Administration(url=self._org_url,
securityHandler=self,
proxy_url=self._proxy_url,... | [
"\n returns a handler to access a federated server\n\n serverUrl - url to the server. Example:\n https://server.site.com/arcgis\n username - the portal site username. if None is passed, it obtains\n it from the portal properties\n Outout:\n returns a P... |
Please provide a description of the function:def handler(self):
if hasNTLM:
if self._handler is None:
passman = request.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, self._parsed_org_url, self._login_username, self._password)
se... | [
"gets the security handler for the class"
] |
Please provide a description of the function:def _initURL(self,
org_url,
referer_url):
if org_url is not None and org_url != '':
if not org_url.startswith('http://') and not org_url.startswith('https://'):
org_url = 'https://' + org_url
... | [
" sets proper URLs for AGOL "
] |
Please provide a description of the function:def handler(self):
if self._handler is None:
self._handler = self.HTTPSClientAuthHandler(key=self._keyfile,
cert=self._certificatefile)
return self._handler | [
"returns the handler"
] |
Please provide a description of the function:def certificate(self, value):
import os
if os.path.isfile(value):
self._certificatefile = value | [
"gets/sets the certificate file"
] |
Please provide a description of the function:def key_file(self, value):
import os
if os.path.isfile(value):
self._keyfile = value | [
"gets/sets the certificate file"
] |
Please provide a description of the function:def _initURL(self, serverUrl=None):
self._serverUrl = serverUrl
parsed_url = urlparse(self._serverUrl)
self._parsed_org_url = urlunparse((parsed_url[0],parsed_url[1],"","","",""))
self._referer = parsed_url.netloc | [
" sets proper URLs for AGOL "
] |
Please provide a description of the function:def token(self):
return self._portalTokenHandler.servertoken(serverURL=self._serverUrl,
referer=self._referer) | [
"gets the AGS server token"
] |
Please provide a description of the function:def serverUrl(self, value):
if value.lower() != self._serverUrl.lower():
self._serverUrl = value | [
"gets/sets the server url"
] |
Please provide a description of the function:def referer(self, value):
if value is not None and \
self._referer is not None and \
self._referer.lower() != value.lower():
self._referer = value | [
"gets/sets the referer object"
] |
Please provide a description of the function:def token(self):
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
self._generateForOAuthSecurity(self._client_id,
self._secret_id,
... | [
" obtains a token from the site "
] |
Please provide a description of the function:def _generateForOAuthSecurity(self, client_id,
secret_id, token_url=None):
grant_type="client_credentials"
if token_url is None:
token_url = "https://www.arcgis.com/sharing/rest/oauth2/token"
para... | [
" generates a token based on the OAuth security model "
] |
Please provide a description of the function:def _initURL(self):
token = self._getTokenArcMap()
if 'error' in token:
self._valid = False
self._message = token['error']
else:
self._valid = True
self._message = "Token Generated"
sel... | [
" sets proper URLs for AGOL "
] |
Please provide a description of the function:def referer_url(self, value):
if self._referer_url != value:
self._token = None
self._referer_url = value | [
"sets the referer url"
] |
Please provide a description of the function:def token(self):
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
result = self._getTokenArcMap()
if 'error' in result:
self._valid = False
self._message = resul... | [
" returns the token for the site "
] |
Please provide a description of the function:def _initURL(self, org_url=None,
token_url=None,
referer_url=None):
if org_url is not None and org_url != '':
if not org_url.startswith('http://') and not org_url.startswith('https://'):
org_url =... | [
" sets proper URLs for AGOL "
] |
Please provide a description of the function:def __getRefererUrl(self, url=None):
if url is None:
url = "http://www.arcgis.com/sharing/rest/portals/self"
params = {
"f" : "json",
"token" : self.token
}
val = self._get(url=url, param_dict=param... | [
"\n gets the referer url for the token handler\n "
] |
Please provide a description of the function:def _generateForTokenSecurity(self,
username,
password,
referer=None,
tokenUrl=None,
expiration=None,
... | [
" generates a token for a feature service "
] |
Please provide a description of the function:def token(self):
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
if self._referer_url is None:
self._generateForTokenSecurity(username=self._username,
... | [
" returns the token for the site "
] |
Please provide a description of the function:def token(self):
if self._token is None or \
datetime.datetime.now() >= self._token_expires_on:
if self._referer_url is None:
result = self._generateForTokenSecurity(username=self._username,
... | [
" returns the token for the site "
] |
Please provide a description of the function:def servertoken(self,serverURL,referer):
if self._server_token is None or self._server_token_expires_on is None or \
datetime.datetime.now() >= self._server_token_expires_on or \
self._server_url != serverURL:
self._server_u... | [
" returns the server token for the server "
] |
Please provide a description of the function:def _generateForServerTokenSecurity(self,
serverURL,
token,
tokenUrl,
referer,
... | [
" generates a token for a feature service "
] |
Please provide a description of the function:def _generateForTokenSecurity(self,
username, password,
tokenUrl,
expiration=None,
client='requestip'):
query_dict = {'us... | [
" generates a token for a feature service "
] |
Please provide a description of the function:def portalServerHandler(self, serverUrl, username=None):
pssh = PortalServerSecurityHandler(tokenHandler=self,
serverUrl=serverUrl,
referer=self._referer_url)
re... | [
"\n returns a handler to access a federated server\n\n serverUrl - url to the server. Example:\n https://server.site.com/arcgis\n username - the portal site username. if None is passed, it obtains\n it from the portal properties\n Outout:\n returns a P... |
Please provide a description of the function:def getMachine(self, machineName):
url = self._url + "/%s" % machineName
return Machine(url=url,
securityHandler=self._securityHandler,
initialize=True,
proxy_url=self._proxy_url,
... | [
"returns a machine object for a given machine\n Input:\n machineName - name of the box ex: SERVER.DOMAIN.COM\n "
] |
Please provide a description of the function:def registerMachine(self, machineName, adminURL):
params = {
"f" : "json",
"machineName" : machineName,
"adminURL" : adminURL
}
uURL = "%s/register" % self._url
return self._post(url=uURL, param_dic... | [
"\n For a server machine to participate in a site, it needs to be\n registered with the site. The server machine must have ArcGIS\n Server software installed and authorized.\n Registering machines this way is a \"pull\" approach to growing\n the site and is a conven... |
Please provide a description of the function:def renameMachine(self, machineName, newMachineName):
params = {
"f" : "json",
"machineName" : machineName,
"newMachineName" : newMachineName
}
uURL = self._url + "/rename"
return self._post(url=uUR... | [
"\n You must use this operation if one of the registered machines\n has undergone a name change. This operation updates any\n references to the former machine configuration.\n By default, when the server is restarted, it is capable of\n identifying a name change and... |
Please provide a description of the function:def exportCertificate(self, certificate, folder):
url = self._url + "/sslcertificates/%s/export" % certificate
params = {
"f" : "json",
}
return self._get(url=url,
param_dict=params,
... | [
"gets the SSL Certificates for a given machine"
] |
Please provide a description of the function:def importRootCertificate(self, alias, rootCACertificate):
url = self._url + "/sslcertificates/importRootOrIntermediate"
files = {}
files['rootCACertificate'] = rootCACertificate
params = {
"f" : "json",
"alias... | [
"This operation imports a certificate authority (CA)'s root and intermediate certificates into the keystore."
] |
Please provide a description of the function:def asDictionary(self):
if self._json_dict is None:
self.__init(url=self._url)
return self._json_dict | [
"returns object as a dictionary"
] |
Please provide a description of the function:def currentVersion(self):
if self._currentVersion is None:
self.__init(self._url)
return self._currentVersion | [
" returns the current version of the site "
] |
Please provide a description of the function:def portals(self):
url = "%s/portals" % self.root
return _portals.Portals(url=url,
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy... | [
"returns the Portals class that provides administration access\n into a given organization"
] |
Please provide a description of the function:def oauth2(self):
if self._url.endswith("/oauth2"):
url = self._url
else:
url = self._url + "/oauth2"
return _oauth2.oauth2(oauth_url=url,
securityHandler=self._securityHandler,
... | [
"\n returns the oauth2 class\n "
] |
Please provide a description of the function:def community(self):
return _community.Community(url=self._url + "/community",
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy... | [
"The portal community root covers user and group resources and\n operations.\n "
] |
Please provide a description of the function:def content(self):
return _content.Content(url=self._url + "/content",
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_port=self._proxy_po... | [
"returns access into the site's content"
] |
Please provide a description of the function:def search(self,
q,
t=None,
focus=None,
bbox=None,
start=1,
num=10,
sortField=None,
sortOrder="asc",
useSecurity=True):
if self._url... | [
"\n This operation searches for content items in the portal. The\n searches are performed against a high performance index that\n indexes the most popular fields of an item. See the Search\n reference page for information on the fields and the syntax of the\n query.\n The s... |
Please provide a description of the function:def hostingServers(self):
portals = self.portals
portal = portals.portalSelf
urls = portal.urls
if 'error' in urls:
print( urls)
return
services = []
if urls != {}:
if 'urls' in url... | [
"\n Returns the objects to manage site's hosted services. It returns\n AGSAdministration object if the site is Portal and it returns a\n hostedservice.Services object if it is AGOL.\n\n "
] |
Please provide a description of the function:def editLogSettings(self,
logLevel="WARNING",
logDir=None,
maxLogFileAge=90,
maxErrorReportsCount=10):
lURL = self._url + "/settings/edit"
allowed_levels ... | [
"\n The log settings are for the entire site.\n Inputs:\n logLevel - Can be one of [OFF, SEVERE, WARNING, INFO, FINE,\n VERBOSE, DEBUG].\n logDir - File path to the root of the log directory\n maxLogFileAge - number of days that a serv... |
Please provide a description of the function:def add_codedValue(self, name, code):
if self._codedValues is None:
self._codedValues = []
self._codedValues.append(
{"name": name, "code": code}
) | [
" adds a value to the coded value list "
] |
Please provide a description of the function:def __init(self):
res = self._get(url=self._url,
param_dict={"f": "json"},
securityHandler=self._securityHandler,
proxy_url=self._proxy_url,
proxy_por... | [
"loads the json values"
] |
Please provide a description of the function:def areasAndLengths(self,
polygons,
lengthUnit,
areaUnit,
calculationType,
):
url = self._url + "/areasAndLengths"
params = {
... | [
"\n The areasAndLengths operation is performed on a geometry service\n resource. This operation calculates areas and perimeter lengths\n for each polygon specified in the input array.\n\n Inputs:\n polygons - The array of polygons whose areas and lengths are\n ... |
Please provide a description of the function:def __geometryListToGeomTemplate(self, geometries):
template = {"geometryType": None,
"geometries" : []}
if isinstance(geometries, list) and len(geometries) > 0:
for g in geometries:
if isinstance(g, Po... | [
"\n converts a list of common.Geometry objects to the geometry\n template value\n Input:\n geometries - list of common.Geometry objects\n Output:\n Dictionary in geometry service template\n "
] |
Please provide a description of the function:def __geometryToGeomTemplate(self, geometry):
template = {"geometryType": None,
"geometry" : None}
if isinstance(geometry, Polyline):
template['geometryType'] = "esriGeometryPolyline"
elif isinstance(geometry, ... | [
"\n Converts a single geometry object to a geometry service geometry\n template value.\n\n Input:\n geometry - ArcREST geometry object\n Output:\n python dictionary of geometry template\n "
] |
Please provide a description of the function:def __geomToStringArray(self, geometries, returnType="str"):
listGeoms = []
for g in geometries:
if isinstance(g, Point):
listGeoms.append(g.asDictionary)
elif isinstance(g, Polygon):
listGeoms.... | [
" function to convert the geomtries to strings "
] |
Please provide a description of the function:def buffer(self,
geometries,
inSR,
distances,
units,
outSR=None,
bufferSR=None,
unionResults=True,
geodesic=True
):
url = s... | [
"\n The buffer operation is performed on a geometry service resource\n The result of this operation is buffered polygons at the\n specified distances for the input geometry array. Options are\n available to union buffers and to use geodesic distance.\n\n Inputs:\n ... |
Please provide a description of the function:def convexHull(self,
geometries,
sr=None):
url = self._url + "/convexHull"
params = {
"f" : "json"
}
if isinstance(geometries, list) and len(geometries) > 0:
g = geometrie... | [
"\n The convexHull operation is performed on a geometry service resource. \n It returns the convex hull of the input geometry. The input geometry can \n be a point, multipoint, polyline, or polygon. The convex hull is typically \n a polygon but can also be a polyline or point in degenera... |
Please provide a description of the function:def densify(self,
geometries,
sr,
maxSegmentLength,
lengthUnit,
geodesic=False,
):
url = self._url + "/densify"
params = {
"f" : "json",
... | [
"\n The densify operation is performed on a geometry service resource. This \n operation densifies geometries by plotting points between existing vertices.\n \n Inputs:\n geometries - array of geometries to be densified (structured as JSON geometry \n o... |
Please provide a description of the function:def difference(self,
geometries,
sr,
geometry
):
url = self._url + "/difference"
params = {
"f" : "json",
"sr" : sr
}
if isinstance(g... | [
"\n The difference operation is performed on a geometry service resource. This \n operation constructs the set-theoretic difference between each element of an \n array of geometries and another geometry, the so-called difference geometry. \n In other words, let B be the difference geomet... |
Please provide a description of the function:def distance(self,
sr,
geometry1,
geometry2,
distanceUnit="",
geodesic=False
):
url = self._url + "/distance"
params = {
"f" : "json",
... | [
"The distance operation is performed on a geometry service resource. \n It reports the 2D Euclidean or geodesic distance between the two geometries.\n \n Inputs:\n geometry1 - geometry from which the distance is to be measured \n (structured as JSON geometry ob... |
Please provide a description of the function:def findTransformation(self, inSR, outSR, extentOfInterest=None, numOfResults=1):
params = {
"f" : "json",
"inSR" : inSR,
"outSR" : outSR
}
url = self._url + "/findTransformations"
if isinstance(num... | [
"\n The findTransformations operation is performed on a geometry\n service resource. This operation returns a list of applicable\n geographic transformations you should use when projecting\n geometries from the input spatial reference to the output spatial\n reference. The transfo... |
Please provide a description of the function:def fromGeoCoordinateString(self, sr, strings,
conversionType, conversionMode=None):
url = self._url + "/fromGeoCoordinateString"
params = {
"f" : "json",
"sr" : sr,
"strings" : stri... | [
"\n The fromGeoCoordinateString operation is performed on a geometry\n service resource. The operation converts an array of well-known\n strings into xy-coordinates based on the conversion type and\n spatial reference supplied by the user. An optional conversion mode\n parameter i... |
Please provide a description of the function:def relation(self,
geometries1,
geometries2,
sr,
relation="esriGeometryRelationIntersection",
relationParam=""):
relationType = [
"esriGeometryRelationCross",
... | [
"\n The relation operation is performed on a geometry service resource. This \n operation determines the pairs of geometries from the input geometry arrays \n that participate in the specified spatial relation.\n \n Inputs:\n geometries1 - the first array of geometries ... |
Please provide a description of the function:def reshape(self,
sr,
target,
reshaper
):
url = self._url + "/reshape"
params = {
"f" : "json",
"sr" : sr,
"target" : self.__geometryToGeomTemplate(ge... | [
"\n The reshape operation is performed on a geometry service resource. It reshapes \n a polyline or polygon feature by constructing a polyline over the feature. The \n feature takes the shape of the reshaper polyline from the first place the reshaper \n intersects the feature to the last... |
Please provide a description of the function:def toGeoCoordinateString(self,
sr,
coordinates,
conversionType,
conversionMode="mgrsDefault",
numOfDigits=None,
... | [
"\n The toGeoCoordinateString operation is performed on a geometry\n service resource. The operation converts an array of\n xy-coordinates into well-known strings based on the conversion type\n and spatial reference supplied by the user. Optional parameters are\n available for som... |
Please provide a description of the function:def union(self,
sr,
geometries):
url = self._url + "/union"
params = {
"f" : "json",
"sr" : sr,
"geometries" : self.__geometryListToGeomTemplate(geometries=geometries)
}
... | [
"\n The union operation is performed on a geometry service resource. This \n operation constructs the set-theoretic union of the geometries in the \n input array. All inputs must be of the same type.\n \n Inputs:\n geometries - array of geometries to be unioned (structu... |
Please provide a description of the function:def __init_url(self):
portals_self_url = "{}/portals/self".format(self._url)
params = {
"f" :"json"
}
if not self._securityHandler is None:
params['token'] = self._securityHandler.token
res = self._get(... | [
"loads the information into the class"
] |
Please provide a description of the function:def init_argument_parser(name=None, **kwargs):
if name is None:
name = "default"
if name in _parsers:
raise ValueError(("kwargs besides 'name' can only be passed in the"
" first time. '%s' ArgumentParser already exists: %s") % (
... | [
"Creates a global ArgumentParser instance with the given name,\n passing any args other than \"name\" to the ArgumentParser constructor.\n This instance can then be retrieved using get_argument_parser(..)\n "
] |
Please provide a description of the function:def get_argument_parser(name=None, **kwargs):
if name is None:
name = "default"
if len(kwargs) > 0 or name not in _parsers:
init_argument_parser(name, **kwargs)
return _parsers[name] | [
"Returns the global ArgumentParser instance with the given name. The 1st\n time this function is called, a new ArgumentParser instance will be created\n for the given name, and any args other than \"name\" will be passed on to the\n ArgumentParser constructor.\n "
] |
Please provide a description of the function:def add_argument(self, *args, **kwargs):
env_var = kwargs.pop("env_var", None)
is_config_file_arg = kwargs.pop(
"is_config_file_arg", None) or kwargs.pop(
"is_config_file", None) # for backward compat.
is_write_out_config_file_arg = kwarg... | [
"\n This method supports the same args as ArgumentParser.add_argument(..)\n as well as the additional args below.\n\n Additional Args:\n env_var: If set, the value of this environment variable will override\n any config file or default values for this arg (but can itself\n be o... |
Please provide a description of the function:def parse(self, stream):
items = OrderedDict()
for i, line in enumerate(stream):
line = line.strip()
if not line or line[0] in ["#", ";", "["] or line.startswith("---"):
continue
white_space = "\\s... | [
"Parses the keys + values from a config file."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.