Questions tagged [arcgis-python-api]
ArcGIS API for Python is a Python library for working with maps and geospatial data, powered by web GIS (ArcGIS Online, ArcGIS Enterprise portal).
65
questions with no upvoted or accepted answers
3
votes
0
answers
980
views
Mapping .csv file using ArcGIS online with Python
I have .csv data in the format:
Longitude Latitude Threat
-24 45 0.5
-31 40 0.9
. . .
. . .
I want to visualize this data as a threat ...
3
votes
1
answer
452
views
IndexError: list index out of range - item report ArcGIS API for Python
I'm quite new to Python and ArcGIS API for Python.
I'm trying to create a report of all the items owned by one of my ArcGIS online organization user.
For each item owned by the user I want to record ...
3
votes
2
answers
667
views
What is the correct syntax for the item.publish command to update a hosted feature layer?
Trying to use the code provided at the bottom of this entry
overwrite feature class in arcgis online using python
to overwrite an existing hosted feature layer in my ArcGIS Online content.
I have ...
3
votes
0
answers
446
views
ArcGIS API for Python not plotting Spatially Enabled Dataframe
I'm using Python 3.6.8, Pandas 0.25.3, and ArcGIS API for Python 1.6.2. I'm pulling data from an API and viewing it in a pandas dataframe using a Jupyter Notebook. The data has several attributes ...
2
votes
0
answers
366
views
Download data from Portal using ArcPy
I am trying to download a hosted layer from our portal and save to a file geodatabase.
Following Using ArcPy to copy a portal feature service to a fgdb feature class:
I've tried:
from arcgis.gis ...
2
votes
0
answers
119
views
Get the list of Feature layer which contains a specific layer
I am trying to get the list of Feature layers which contains the specific layer named WETTBEWERBER in my portal, the code runs fine but there is no results printed out,
What am I doing wrong here?
...
2
votes
0
answers
331
views
ArcGIS API for Python: AttributeError: module 'brotli' has no attribute 'error'
from arcgis.gis import GIS
when run in ArcGIS Pro 2.6 notebook results in long error message (below).
What might be wrong?
Note that import arcpy works without difficulties.
--------------------------...
2
votes
0
answers
518
views
Connecting Python to get data from Survey123 and show it on Web AppBuilder
I am downloading a survey data from survey123.com by using GIS services however I am not able to create a widget on webapp to show it on ArcGIS webapp. I am not familiar with ArcGIS but here is the ...
2
votes
1
answer
559
views
Creating new Feature Layer from existing feature layer on ArcGIS Online using ArcGIS API for Python
I have a folder on ArcGIS Online for a city that has few layers in it.
I need to create separate folders for each city and then create new feature layers using these existing layers, preferably using ...
2
votes
1
answer
152
views
How to get the job status of gis.item.export or make it execute synchronously?
I'm using the ArcGIS API for Python to export a feature service to a FGDB and then download it.
My problem is that the export function appears to be asynchronous even though I set wait=True.
The ...
2
votes
0
answers
216
views
Change Dashboard's map with ArcGIS Python API
Is it possible to change the map used in a Dashboard with the ArcGIS Python API?
I know it can be done manually by changing the map's id in the ArcGIS Online Assistant, but I would like to do this ...
2
votes
1
answer
859
views
Batch uploading PDF files to ArcGIS Online?
I am trying to upload multiple pdf files to ArcGIS Online content all at once.
Is there is a script that I can use to add content to ArcGIS Online?
2
votes
0
answers
62
views
Function execution hangs if connection to Internet is lost
I am trying to update feature layer. I am updating the records in a loop.
The problem is in the case Internet connection lost. It get stuck in the edit_features() function. I have to ctrl+c to stop ...
1
vote
0
answers
45
views
Extract list of content in a specific Portal webmap using ArcGIS API for Python
I would like to extract the lists of content (Feature & Map Image Service) including the type of base map. Also, wanted to know if all the layers are loading correctly using ArcGIS API for Python.
...
1
vote
1
answer
94
views
ArcPy - overwrite feature service with CSV
I am trying to download a CSV from our project database, and then append this to a feature service in AGOL.
import os
import requests
import csv
import arcpy
from requests.auth import HTTPBasicAuth
...
1
vote
0
answers
176
views
How to publish or replace the data to the feature layer hosted?
A little background: My teammate has created a hosted feature layer. I access the data of hosted feature layer using ArcGIS API for Python and pull the data.
The hosted feature layer he created doesn'...
1
vote
0
answers
200
views
ArcGIS Python API append new record
I am trying to insert a python dict record to the hosted online service.
I am getting the following error:
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\...
1
vote
0
answers
438
views
How to make a deep copy of a Hosted Feature Service
How can I make a deep copy of a Hosted Feature Service using ArcGIS Python for API?
My hosted feature service has one layer. I'd like to copy the hosted feature service and the layer. (I want to ...
1
vote
1
answer
698
views
Converting Pandas DataFrame to spatially enabled DataFrame geometry removes geometry In some cases
I want to convert my Pandas DataFrame with a WKT geometry column to a Spatially Enabled DataFrame (SEDF) and then into a featureclass in a geodatabase; however, sometimes the geometry column in the ...
1
vote
0
answers
407
views
Download of a file geodatabase failing when using script and query
I'm trying to download a file geodatabase using a script. The script is taken from the Esri documentation with minimal changes, basically I'm querying for the required feature layer appending date and ...
1
vote
0
answers
847
views
How to query a specific layer from a feature service?
I am trying to get the list of feature service which has a specific layer (for example: River (the layer id is 0)) from a feature service,
from arcgis.gis import GIS
gis = GIS(url='https://pythonapi....
1
vote
0
answers
726
views
Exporting FGDB From ArcGIS Enterprise using ArcGIS Python API
I am building a Python script for a client who wants a bunch of hosted feature services exported to file geodatabases. The script I've written works just fine. Each hosted feature service is exported ...
1
vote
0
answers
155
views
Accessing hosted feature layers in ArcGIS Portal
The feature layers can be accessed using the item type, is there any way to retrieve only the hosted feature layers from the Portal ??
from arcgis.gis import GIS
gis = GIS(url='https://pythonapi....
1
vote
0
answers
22
views
Non-editable Field names differ Between AGOL and File Geodatabase
While attempting to overwrite a hosted feature layer from a local featureclass, field.name "Shape__Length" cannot be updated using values from field.name "Shape_Length". When ...
1
vote
0
answers
248
views
Updating Portal Item Thumbnail ONLY if it is has not been changed yet using ArcGIS Python API
Using Python, is it possible to check if the thumbnail for a Portal Item is the default thumbnail? I want to update thumbnails if they have not been updated yet.
I know I can update thumbnails using ...
1
vote
0
answers
91
views
Removing rows limitation when making feature layer query using ArcGIS Python API
I have a fairly big spatiotemporal dataset located at a server, which gets additional 1000 rows every 10 seconds for like two moths already. I am concerned to download and process this data day by day,...
1
vote
0
answers
452
views
Script using Python API and Windows task scheduler
I have a Python script that uses the Python API to logging into the server, stop geocode services, rebuild locators and start services. I'm using task scheduler on a server machine where other Python ...
1
vote
0
answers
68
views
ArcGIS Python API - feature renderer faild in AGOL
I am trying to save a feature service in AGOL using ArcGIS Python API with symbols. I use the same symbols in a map widget and the features appear correctly but when I save the feature as a feature ...
1
vote
0
answers
300
views
Add empty layers to Feature Service with ArcGIS Python API
I would like to create a number of Feature Services. Each Feature Service should contain 15-20 layers. There is no data yet, as I would like to create these for data collection with ArcGIS Collector. ...
1
vote
1
answer
586
views
Cannot log in with different ArcGIS Portal user account using ArcGIS Python API
I have an ArcGIS Portal log in account (viewer account) in an enterprise GIS infrastructure and want to use the ArcGIS Python API to connect with a separate admin account to be able to produce reports ...
1
vote
1
answer
461
views
Importing/downloading symbology from ArcGIS Online using ArcPy?
I am currently attempting to create a script to download shapefiles from ArcGIS Online to my local drive before adding it to an aprx project and thereafter uploading it to a ArcGIS portal/enterprise.
...
1
vote
0
answers
616
views
AGOL Python Api - Modify Symbology of a Feature Layer
I want to modify the JSON properties of a Feature Layer hosted online to display a certain field in symbology. I am able to access the JSON properties, even the property itself but when I call an ....
1
vote
0
answers
141
views
Preserving data types when publishing to ArcGIS Online using ArcGIS Python API?
I have a Python script which does some data manipulation using Pandas dataframes, then outputs to CSV. The CSVs are then published to AGOL using the ArcGIS Python API, overwriting the existing ...
1
vote
0
answers
300
views
Uploading mxd to ArcGIS Online with Python?
I need to create a Python script to upload an MXD to AGOL. I have created an script in arcpy to create a service definition file (*.sd) from the mxd. I have not been able to upload the sd to AGOL ...
1
vote
0
answers
213
views
Finding closest feature to given address in ArcGIS API for Python?
I'd like to find the closest open space (i.e. a park, square, playground) from a City of Boston MapServer using Python's ArcGIS package.
I'd like to use arcgis.features.use_proximity.find_nearest() ...
1
vote
0
answers
212
views
Can ArcGIS Python API automate functionality provided in Web AppBuilder?
I was feeling adventurous the other day and I decided to dive into ArcGIS Pro and the new ArcGIS Python API. I watched some training videos and since I've been working with ArcGIS Online a lot, I ...
1
vote
0
answers
332
views
how to plot lat lon data to a map using jupyter notebook?
import arcgis
from arcgis.gis import GIS
from arcgis.features import SpatialDataFrame
ago_gis = GIS()
search_subset = ago_gis.content.search("Hong Kong Topographic Map")
subset_item = search_subset[...
1
vote
0
answers
244
views
Cannot plot map on ArcGIS python API?
I do not have ArcGIS desktop. And I have installed the ArcGIS Python API.
And I tried the following:
import arcgis
from arcgis.gis import GIS
from arcgis.mapping import WebMap
gis = GIS()
map1 = gis....
0
votes
0
answers
16
views
How to access layer using feature service URL/path
I am trying to access a feature layer within my Portal using the layers path. I have been accessing the data within Visual Studio Code using the feature layers ID like this:
feature_service_layer = ...
0
votes
0
answers
14
views
"User does not have administer or publishing privileges to item" error while publishing a multipart item in ArcGIS
I am trying to publish a new item using multipart. Sometimes, our geojson files were too big, so we need to use multipart.
If I add only 1 part, it works fine.
If I add more than 1 part I get an error:...
0
votes
0
answers
16
views
While converting feature class to spatially enabled dataframe shape_length data is not populating
I am converting feature class to spatially enabled data frame using below code, after conversion shape_length field of a line layer is not getting populated. Only shape data is available. Why this is ...
0
votes
0
answers
10
views
Issue with attribute types when publishing GeoJSON to ArcGIS Online
I'm trying to publish a GeoJSON file containing lines and points to ArcGIS Online. The publication process is successful, resulting in a Feature Layer with two layers - point and line. Everything ...
0
votes
0
answers
73
views
403 Error when overwriting feature layer in ArcGIS Online
I'm attempting to overwrite a hosted layer that I own in ArcGIS Online using the arcgis.features.FeatureLayerCollection.manager.overwrite() method in Python. However, I keep receiving a 403 Error even ...
0
votes
0
answers
103
views
How to clone a copy using ArcGIS API for Python
What I am trying to do: Take a layer from ArcGIS Enterprise, clone it as a temporary file, overwrite a file in SQL DB, delete temporary file.
What I have tried so far:
def overwrite_existing_layer(...
0
votes
0
answers
34
views
arcpy.management.DeleteField working in Pro notebook but not online hosted notebook
I'm trying to take some models in ArcGIS Pro that I've built, and translate them into a AGOL Advanced notebook. Originally I was building the notebook in Pro for testing. However I just tried it in ...
0
votes
0
answers
54
views
Bypassing KeyError: 'type' when running a ArcGIS Online Python Notebook meant to overwrite organizational CSV
I have a scheduled organizational script that is only meant to be run during the summer and is left dormant for the winter as the data it scrapes is not maintained at that time. The reason I am ...
0
votes
0
answers
54
views
Dynamically Generated ArcGIS Storymap
I want to be able to have a user click on a polygon in an ESRI ArcGIS webmap and have a story map open that's specific to that particular polygon. There are hundreds and potentially thousands of ...
0
votes
0
answers
114
views
Export out list of users and user types in Portal
I'm trying to export a list of Portal users and their user types. This is the code I'm trying to use but getting an error regarding the user.LicenseTypeId entry:
import csv
from arcgis.gis import GIS
...
0
votes
1
answer
247
views
List all maps in my Portal and list their corresponding layers
I am trying to list all of the maps inside of my Portal with the corresponding features that are inside. So far this is my code:
# Import necessary modules
import arcgis
import openpyxl
# Create an ...
0
votes
0
answers
66
views
Using jupyter_client version with ArcGIS API for Python
I am using ArcGIS API for Python.
When I install Jupyter_client==7.1.0, I get error of arcgis 2.0.1 requires jupyter-client<=6.1.12, but you have jupyter-client 7.1.0 which is incomatible.
When I ...