Questions tagged [arcgis-python-api]

ArcGIS Python API for working with ArcGIS Online and Portal for ArcGIS

Filter by
Sorted by
Tagged with
0
votes
0answers
17 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
1answer
42 views

Adding data using Python from ArcGIS Online/ArcGIS REST Services directory to a ArcMap MXD

I want to update over 100 MXDs by adding 4/5 ArcGIS Online/ArcGIS REST Services directory layers. I am unsure whether this is possible using Python and can only find documentation on how to access ...
0
votes
1answer
19 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
1answer
111 views

TypeError: cannot unpack non-iterable NoneType object on Spatial Join

I'm working with two spatial dataframes and am trying to do a spatial join on the two. parcels_sdf -- a frame with around ~370,000 real estate parcels. subdivisions_sdf -- a frame with all ...
1
vote
1answer
20 views

Querying County Open data endpoint and filtering by radius

I'm using python's requests and arcgis libraries for to query an open data endpoint for my county GIS data. I'm trying to query the recent sales data within a 2 mile radius of an address. I've ...
1
vote
0answers
28 views

Publishing a web tile layer on ArcGIS Online with python

I have a tiff layer in an ArcGIS Pro project. I would like to publish it on my ArcGIS Online portal, with Arcpy. I try to publish it as a Web Tile Layer, but could be another layer type, if anyone has ...
0
votes
0answers
14 views

How to update Portal for ArcGIS system properties using ArcGIS API for Python

I'd like to update the Portal system properties using the Python API. The documentation seems to indicate that it can be done. However, making an assignment to System.properties doesn't appear to ...
1
vote
0answers
32 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 ...
0
votes
1answer
68 views

Getting KeyError: groups from ArcGIS API for Python

I am working on ArcGIS Notebooks from arcgis.gis import GIS from IPython.display import display agol_gis = GIS("https://*********.maps.arcgis.com/home/") agolSiteAdmin = agol_gis.users.get('siteadmin'...
0
votes
3answers
77 views

Getting all users in ArcGIS Online organization?

I want to return a list of all users in my ArcGIS Online (AGOL) organization. However, the result returned in gis.users.search() appears limited to 100 users. Is there any way to return all users or ...
0
votes
0answers
26 views

Updating enterprise feature class using ArcGIS API for Python

I have created a Python script that will turn some CSVs to features in a GDB and I am trying to get the feature class on my local machine to overwrite the feature on our enterprise portal. I have ...
1
vote
1answer
73 views

Does ArcGIS API for Python use ArcPy internally?

Today I read a GIS SE user opinion in Using Geometry.distance_to() in ArcGIS API for Python that: it appears that ArcGIS API for Python uses ArcPy internally This surprised me because I do not ...
1
vote
1answer
70 views

Using Geometry.distance_to() in ArcGIS API for Python

I'm calculating distances between points in arcpy or ArcGIS API for Python, and am probably doing something wrong. Hopefully, someone can show me what. Take this as an interactive session with ...
1
vote
1answer
58 views

Calculating distance in feet between points in a Pandas Dataframe [closed]

I am pulling my data from an AGOL feature service using the arcgis python api. I pull the data into a spatial dataframe then merge it in various ways in pandas, do various column calculations, move ...
0
votes
0answers
9 views

ArcGIS API for Python edit attributes deletes map view

Currently I have a working script that searches for points within a layer that meets two conditions. It then edits a attribute. The script works well, however as soon as I run it, any point which the ...
1
vote
1answer
38 views

Download zip file from ArcGIS Online

from arcgis.gis import GIS import sys import urllib.request as req from pathlib import Path from zipfile import ZipFile import os import trace import urllib.request as req Zip_Loc = r'C:\Folder' ...
0
votes
0answers
27 views

Return URL of a query on a feature layer using arcgis API

I am familiarizing myself with the arcgis API for Python, and I would like to view the query I perform on a feature layer as a URL: from arcgis.features import FeatureLayer from arcgis.geometry ...
1
vote
1answer
105 views

Converting Lat,Long to XY in ArcGIS API for Python?

I am working on a Alexa skill where I get the user's location (Lat, Long) from the device. Since my skill only applies to a specific city (Boston, USA), I am using the ArcGIS reverse_geocode to ...
0
votes
1answer
38 views

Getting list of applications where “xyz” ArcGIS service is used?

Suppose i have xyz service, and which applications(web map, web app builder, arcgis online) uses this service. xyz=http://aaa.bbbbb.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%...
0
votes
0answers
38 views

Downloading ArcGIS Online Feature Service to local Geodatabase using ArcPy? [duplicate]

I want to grab some feature services from ArcGIS Hub and put them on a GDB on my local PC. Here's the code that I've got so far: import arcpy # Set project directory proj_dir = 'C:\\Users\\rhard2\\...
1
vote
1answer
175 views

No module named 'arcgis' for import GIS

I have ArcGIS API for Python installed and when I use below line, am getting error as ModuleNotFoundError: No module named arcgis from arcgis.gis import GIS Please refer to Image
0
votes
0answers
24 views

ArcGIS Python API Plotting ValueError: setting an array element with a sequence

Got a pandas spatial df using ArcGIS python API. The data is read in via pd.DataFrame.spatial.from_featureclass()–i.e., a shapefile. Once loaded, df has a SHAPE column, as you see here. Next, ...
0
votes
2answers
97 views

Copying feature service to local geodatabase using ArcPy and ArcGIS API for Python?

I am trying to export/copy a feature service to a local geodatabase where I can work on it locally. I have provided the code below. I keep getting an "Object: Error in executing tool" for the last ...
0
votes
0answers
25 views

Capturing Layer Errors When Loading WebMap using ArcGIS API for Python?

Using ArcGIS Python API 1.6.2 (Python 3.7) with Jupyter Notebook, is it possible to capture the popup, "Error. The layer, <..some layer..>, cannot be added to the map."? Essentially: from ...
0
votes
0answers
81 views

Adding new layout to ArcGIS Pro project?

I'm trying to create a script to update extents of the ArcGIS portal items according to the actual extents of the participating data layers. My idea is to create a local copy of the web map, zoom to ...
1
vote
1answer
77 views

Extract domain from ArcGIS Online feature service using Python API

I have a feature service with several coded value domains that I'm accessing as a spatially enabled dataframe using the python API. As far as I can tell, the dataframe only holds the code for each ...
1
vote
0answers
79 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. ...
2
votes
0answers
84 views

ArcGIS API for Python: Parameter Invalid - Item with the same key has already been added

I'm trying to update an ArcGIS Online (AGOL) feature layer using an updated local CSV file (the steps for this process are detailed in this Sample Notebook). I am using Jupyter Notebook to handle all ...
0
votes
0answers
26 views

How to populate an item's tables list for a ArcGIS API for Python Map Service Item?

I am trying to obtain a specific table from a Map Service item, however the table list is empty. The layers list correctly reports back 5 layers. My code snippet below: search_result = gis....
2
votes
2answers
65 views

Programmatically determining version of ArcGIS API for Python?

I would like to obtain the version of ArcGIS API for Python for logging/diagnostic purposes. Is there a way to determine this before a connection is made? I know that once I have the GIS object, I ...
0
votes
1answer
115 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
0answers
19 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
1answer
40 views

Publishing error from ArcGIS API for Python?

I was trying to upload a CSV file on ArcGIS with Python. I wrote the code : import pandas as pd from arcgis import GIS import os import datetime import shutil URL = "https://www.arcgis.com/" gis = ...
0
votes
1answer
80 views

Adding features with attribution to Feature Service using Jupyter Notebooks and ArcGIS Python API?

I want to have a user add points by clicking on a map in a Jupyter Notebook and those points get pushed to a feature service. I'm able to accomplish that task, but I would like the user to be able ...
1
vote
0answers
108 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 ....
0
votes
1answer
111 views

Generating Queried CSV from shapefile using ArcGIS API for Python?

I'm trying to create a csv from a query of a feature layer hosted in ArcGIS Online. The csv only needs to contain one field, where the query is met, geometry is not needed. I'm having issues getting ...
4
votes
1answer
1k views

How to update a hosted feature service on ArcGIS Online using the Python API for ArcGIS Pro?

I'm trying to follow the steps in the Esri blog post Updating your hosted feature services with ArcGIS Pro and the ArcGIS API for Python but am running into an error. To test this I published a ...
1
vote
0answers
40 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 ...
2
votes
1answer
1k views

Updating hosted feature layers on AGOL using the ArcGIS Python API?

I previously asked Adding data to a feature layer on ArcGIS Online using arcrest and arcresthelper.featureservicetools? regarding the most current process for establishing and then automating feature ...
5
votes
1answer
950 views

Using the arcpy Python library with hosted feature service layers from ArcGIS Online?

Is it possible to use the arcpy library with hosted feature service layers from ArcGIS Online? I am aware of the ArcGIS API for Python, but the API lacks many of arcpy's features. In my case, I'd ...
1
vote
2answers
45 views

Getting Exent of Queried Results using ArcGIS Python API?

Im trying to use the ArcGIS Python API to query a few results and gather the extent, I can query the results fine but as soon as I try to extract the extent I retrieve empty results. Using one of the ...
1
vote
1answer
467 views

How to search the folder's items in ArcGIS On Line using the ArcGIS API for Python

I want to have a list of the items inside a folder created by my user in AGOL, I want to use the ArcGIS API for Python. so far I have found this: import sys from arcgis import gis import os ...
0
votes
0answers
81 views

How to get Borough names using ArcGIS API for Python through geocoding?

I'm new to ArcGIS API for Python. Is it possible to do do geocoding of an area, specifically New York City and get all the boroughs' names? i.e.: Geocode request for all boroughs in New York city. ...
1
vote
2answers
604 views

Setting basemap layers of WebMap using ArcGIS Python API?

Using the ArcGIS Python API, I've create a WebMap and two Layers (one containing features, the other containing labels): cbmt = WebMap() cbmt_geometry_layer = Layer(url = <url of geometry layer>...
1
vote
0answers
214 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
0answers
130 views

Authentication Error 499 using ArcGIS API for Python?

Using the ArcGIS API for Python, when I create my GIS object: gis = GIS(config["agol"]["agol_gis_url"], config["agol"]["agol_gis_user"], config["agol"]["agol_gis_pass"]) I can verify that it ...
3
votes
1answer
306 views

Update field properties of a layer definition with ArcGis Python API

We have a fields in a large amount of AGOL hosted feature layers that we want to make un-editable and others that we do not want visible. Rather than going into the service definition for each and ...
1
vote
0answers
521 views

How to include maps in Jupyter notebook HTML export?

I'm running the 1.4.2 version of the ArcGIS Python API. In a Jupyter Notebook, I create a map like: lowes = "Arkansas USA Lowe's" lowes_map = gis.map("AR, US", 6) lowes_map ...and get my output. I ...
3
votes
1answer
548 views

Using ArcPy and ArcGIS API for Python together?

I am having trouble with how I am supposed to use both ArcPy and ArcGIS API for Python. ArcPy is only in Python 2 and ArcGIS API for Python is in ArcGIS Pro and is Python 3. I don't know how to set my ...
1
vote
1answer
95 views

Displaying 3rd party FeatureSet geometries on jupyter notebook webmap using ArcGIS Python API

How can I add all geometries included in a FeatureSet to a web map? Trying to add geometries (i.e., shapes) to a Jupyter notebook web map (see code sample below). Adding features from the ArcGIS ...