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
8 views

Basemap function on webmap returns AttributeError: 'Item' object has no attribute 'basemap'

I am working with an ArcGIS Notebook and have the following script (see attached image as well): from IPython.display import display import arcgis from arcgis.gis import GIS from arcgis.mapping ...
1
vote
0answers
17 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 ...
0
votes
0answers
13 views

Survey123 Python Module Feature Report Names

I am using Survey123 version 3.9 and the ArcGIS API for Python. I am successfully downloading reports, but I seem to have no control over the report file name. The test file name I am using is "...
1
vote
1answer
71 views

Convert ArcGIS Spatially Enabled Dataframe to Geopandas GeoDataFrame

I have some code that works on geopandas GeoDataFrames but due to a client requirement I suddenly have to access my input data via the ArcGIS Python library, which only allows me to access the data as ...
0
votes
0answers
24 views

Exporting MapImageLayer, however getting a blank png

I am pulling data from Wayback Imagery and attempting to export an image after making it into a arcgis.mapping.MapImageLayer. When I run my code the image it produces is blank and I'm unsure why. The ...
0
votes
1answer
42 views

Is ArcGIS API for Python or ArcREST faster than arcpy.da for editing hosted features?

I have a large hosted feature layer on ArcGIS Online of 52,000 points. I have been building the feature layer over time by simply using the Append tool in ArcGIS Pro. Now I need to update some text ...
0
votes
1answer
24 views

Using ArcGIS API for Python and Windows Authentication?

I've been trying to follow the ESRI recommended workflow to log on to Enterprise (using authentication), but it just doesn't want to work. I'm able to get the account credentials registered in ...
0
votes
1answer
30 views

Overwrite a PDF item type with ArcGIS API for Python

I'm trying to overwrite an existing PDF ArcGIS Online item using ArcGIS API for Python. props = { "type":"PDF", "title":file_name, "overwrite":True ...
3
votes
1answer
36 views

Area calculation in “Thomas Fire analysis”

I am studying this notebook: California wildfires 2017 - Thomas Fire analysis I can follow the first part of the notebook. But I have got confused in this cell to calculate the burnt area: ext = {&...
0
votes
1answer
34 views

Upload raster data using ArcGIS API for Python?

I have been using the code below to import shapefiles to ArcGIS Online. It was taken from an ArcGIS tutorial linked here: https://developers.arcgis.com/labs/python/import-data/ from arcgis.gis import ...
0
votes
0answers
32 views

Updating/overwriting multiple layers within a feature layer in ArcGIS Online from a fgdb containing all the new feature classes

I am looking for a method to upload and replace multiple layers in ArcGIS Online that are stored within a (hosted) feature layer. I have the feature classes to be used to update (and identical in ...
0
votes
0answers
34 views

Plotting polygon bounding box using ArcGIS API for Python

I have a layer of polygons and would like to be able to plot the extent boundary rectangle on a map. I have my polygons in a Spatially Enabled DataFrame (polygonSDF = poygonFeatureSet.sdf) that I can ...
0
votes
0answers
21 views

ArcMap export training data for deep learning using RCNN_Masks returns a generic error

As the title says, ArcMap returns a generic error when I try to export training data for deep learning. The error just says failed to crate raster dateset. I follow the settings from this page but ...
0
votes
0answers
49 views

ArcGIS Python API zoom_to_layer() attribute error

I am working with the ArcGIS API for Python mapping widget within the ArcGIS jupyter notebook environment. I've successfully connected to my organization's enterprise portal, grabbed content, mapped ...
0
votes
1answer
43 views

ArcGIS API for Python geometric filter of feature layer producing Runtime Error: 'geometry parameter invalid'

I am trying to select a handful of features from an Enterprise Portal feature layer using the ArcGIS API for Python. Specifically I am trying to do a spatial selection, where the selected features are ...
1
vote
1answer
93 views

Adding query layer to MapView in Jupyter Notebook returns “RuntimeError: Cannot infer layer: will not be added to map”

I am working within a Jupyter notebook, trying to display a query layer (querying a SQL database) into a map view within the notebook. I receive a Runtime Error (described below) when I try to add ...
0
votes
0answers
7 views

Installing ArcGIS Python API with deep learning dependencies [duplicate]

I am a GIS guy and do not know much about deep learning and AI. How can I start using ArcGIS Python API to do GeoAI ?
0
votes
1answer
16 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 ...
0
votes
0answers
33 views

“The submitted field shape_length does not exsists in the table” error while using ArcGIS API for Python, clone_items to clone dashboard

I am cloning a dashboard from an ArcGIS Online account to a Portal using the clone_item function found in ArcGIS API for Python. The most common error I get is: The submitted field "shape_length&...
4
votes
1answer
169 views

Enable Popups for each layer in webmap using ArcGIS API for Python

I am looking to use the ArcGIS API for Python to enable popups for each layer in a webmap. I found Configure Popup Attributes Programmatically with ArcGIS API for Python on GeoNet which addresses how ...
1
vote
1answer
100 views

How can I use UpdateCursor in AGOL layers?

I'm all new to Python, and 'Im stuck with a problem: Is it possible to use UpdateCursor on Feature Layers in AGOL? I am trying something like this: from arcgis.gis import GIS gis = GIS("https://...
1
vote
1answer
31 views

Why is the arcgis.geometry.buffer method failing on supposed empty geometries?

I am attempting to buffer some output after querying a feature service using the arcgis API for Python: from arcgis.gis import GIS from arcgis.features import FeatureLayerCollection from arcgis....
1
vote
1answer
33 views

Using 3rd party PASCAL_VOC in arcgis.learn prepare_data() method

Has anyone had luck using the prepare_data method with data not exported from the Export Training Data tool in ArcGIS Pro? The documentation suggests prepare_data will take PASCAL_VOC_rectangles from ...
1
vote
1answer
91 views

arcgis.learn show_batch() index error and lr_find() runtime error while using pointcnn for LiDAR segmentation

I am trying to segment vegetation from LiDAR point cloud using PointCNN on Jupyter notebook. But I am getting Index Error on running show_batch() and runtime error on running lr_find() while using ...
1
vote
0answers
47 views

Creating a for loop to publish multiple CSVs as feature services? [closed]

I have multiple CSVs that I want to publish them each as unique feature services. Instead of publishing them one at a time, I'm trying to find the correct syntax to create a for loop. This is the ...
3
votes
3answers
184 views

Installing ArcGIS Python API with ArcGIS Pro

I am new to the world of ArcGIS and I come from a data science background. I recently installed ArcGIS Pro with a Single User license from my organization. I would like to use it with the Python API ...
-1
votes
1answer
479 views

Publish file geodatabase to ArcGIS Online using ArcGIS API for Python

I am reading in the documentation it should be possible to publish a local file geodatabase as a hosted feature layer to ArcGIS Online. I have been trying different things, but that job keeps failing. ...
1
vote
0answers
64 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. ...
3
votes
0answers
117 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
170 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
108 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
6k 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
24 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
1answer
204 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
1answer
89 views

How to visualize route layer on ArcPy Jupyter Notebook (ArcGIS)

I tried to visualize the route between two points using ArcPy in a Jupyter notebook. The network module is activated in my Esri account. Even though it visualizes the map I can't see the route on that ...
0
votes
0answers
23 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 ...
2
votes
0answers
55 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
464 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'...
1
vote
3answers
656 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 ...
1
vote
1answer
91 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
242 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
340 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 ...
1
vote
1answer
52 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
39 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
558 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
55 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
50 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\\...
2
votes
1answer
918 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
2answers
294 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 ...
1
vote
1answer
349 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 ...