This task uploads a shapefile from ENVI to an ArcGIS Portal or ArcGIS Online account.

Example


; Start the application
e = ENVI()
 
; Open an input vector file
File = Filepath('qb_boulder_msi_vectors.shp', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Vector = e.OpenVector(File)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('UploadVectorToArcGISPortal')
 
; Define inputs
; Edit the URL, user name, and password with your own credentials
Task.INPUT_VECTOR = Vector
Task.PORTAL_URL = 'https://arcgis.com'
Task.USERNAME = 'My Username'
Task.PASSWORD = ENVISecureString(PLAINTEXT='my_password', $
    PUBLIC_KEY=Task.PUBLIC_KEY)
Task.ITEM_NAME = 'qb_boulder_msi shapefile'
 
; Run the task
Task.Execute

Syntax


Result = ENVITask('UploadVectorToArcGISPortal')

Input parameters (Set, Get): INPUT_VECTOR, ITEM_NAME, PASSWORD, PORTAL_URL, PUBLISH, USERNAME

Output parameters (Get only): ITEM_URL

Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.

Input Parameters


INPUT_VECTOR (required)

Specify the input shapefile.

ITEM_NAME (optional)

Specify a string with the name for the published resource. This name will appear in the "Content" on the server. You can only edit the item name after it is created on the server. If you do not specify ITEM_NAME, the default name will be the input shapefile filename. If the item name already exists on the server, the task will fail.

PASSWORD (required)

Specify an ENVISecureString object representing the encrypted version of the ArcGIS password to use. This task has a hidden parameter named PUBLIC_KEY that must be used to correctly encrypt the plaintext password. See the Example for details.

PORTAL_URL (required)

Specify a string with the URL of the ArcGIS Portal (i.e., https://username.maps.arcgis.com or https://arcgis.com). If you set the URL to arcgis.com, the shapefile will upload to ArcGIS Online.

PUBLISH (required)

If this parameter is set to true, the shapefile will be uploaded and published to a feature layer that can be viewed using an Esri map layer. If false, the shapefile will be uploaded but you cannot view it in a map layer.

USERNAME (required)

Specify a string with the ArcGIS login user name with publishing permissions. The user name is case-sensitive in ArcGIS.

Output Parameters


ITEM_URL

The URL of the published resource.

Methods


Execute

Parameter

ParameterNames

Properties


DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History


ENVI 5.6

Introduced

See Also


ENVITask, ENVIVector