Skip to main content

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).

Filter by
Sorted by
Tagged with
3 votes
1 answer
79 views

I'm trying to delete all features in a layer hosted in ArcGIS Online. from arcgis.gis import GIS from arcgis.features import FeatureLayer #Login AGOL gis = GIS("https://www.arcgis.com", &...
Bera's user avatar
  • 82.2k
1 vote
0 answers
32 views

It seems I cannot clip my raster using the ArcGIS Python API. I am trying to read the Elevation Imagery Layer from the ArcGIS Living Atlas and clip it by a Watershed area. I first imported the USGS ...
sBoroushaki's user avatar
0 votes
0 answers
31 views

My ultimate goal is pretty simple: I need to create a Story Map, add a web map to it, then save and publish it all from a python notebook. The documentation is unclear to me about how to accomplish ...
MJay's user avatar
  • 1
0 votes
1 answer
64 views

I have been asked to create field map smartforms from the hosted feature layer & webmap. Any example would be helpful! My code seems to be not working, it does not create Form element. from arcgis....
Rpandia31's user avatar
  • 141
0 votes
1 answer
65 views

ArcGIS Pro 3.1, Python 3.9 I'm using the ArcGIS Python API to connect to Portal (11.1) and AGOL to filter for deprecated items. According this reference doc, Item Fields can be passed to the query ...
sushi's user avatar
  • 395
1 vote
0 answers
41 views

This tutorial shows how to easily download an item from an ESRI portal using the Python API. Can you open the item just downloaded in a different, offline, Python environment that doesn't have access ...
jgm_GIS's user avatar
  • 670
0 votes
0 answers
45 views

I'm trying to get labels working in my Jupyter notebook map, and I've tried everything I can think of. Here's my code: from arcgis.geometry import Point from arcgis.features import Feature, FeatureSet,...
Brian's user avatar
  • 1
0 votes
2 answers
112 views

ArcGIS Pro 3.1.4 Python 3.9 API version is 2.1.0.2 When I log into ArcGIS Online with an account that has a custom role with a few administrative privileges, I can share / unshare items owned by ...
sushi's user avatar
  • 395
1 vote
1 answer
58 views

I'm connecting to Portal via the GIS object. from arcgis.gis import GIS portal = GIS(<my portal>) print(portal.version) # gives [10,3] But my portal is at version 11.1. That's what the Portal ...
sushi's user avatar
  • 395
0 votes
1 answer
370 views

I am trying to use the REST API from ArcGIS Online to refresh or overwrite a feature service. I am using Python to upload an item using the addItem operation: upload_url = ( f"{portal}/...
pzman's user avatar
  • 154
0 votes
0 answers
38 views

I have a simple piece of code which I'm hoping I might be able to get a solution to. It specifically pulls usage for an item for the last 7 days or whatever desired date range. It appears to work fine ...
Ian's user avatar
  • 528
1 vote
1 answer
66 views

Python: 3.9 ArcGIS API for Python: 2.3.0.1 I am accessing a Feature Layer from the Living Atlas using the ArcGIS API for Python. I convert it to a sdf with the column 'SHAPE' as the geometry. How do I ...
ZephyrZ's user avatar
  • 113
0 votes
2 answers
151 views

We publish most of our ArcGIS Online (AGOL) content from ArcGIS Pro, with the original data stored in local file Geodatabases. However, we have some layers that exist only in AGOL (eg, Survey123 ...
Son of a Beach's user avatar
-1 votes
1 answer
188 views

I want to launch the Python tool, which is available here: https://github.com/Esri/field-maps-scripts but unfortunately there is no arcgis library I tried several ways of installing this script: ...
Geographos's user avatar
  • 3,061
1 vote
0 answers
70 views

Using the example in the Developers.ArcGIS.com documentation I am trying to update a Survey123 form's media file pythonically. My modified version of the example code is downloading an empty Zip file. ...
Keggering's user avatar
  • 1,137
1 vote
1 answer
176 views

I am trying to come up with a method that utilizes lyrx files to routinely overwrite a feature layer on ArcGIS Portal. I've tried a few methods that utilize Python scripts, ModelBuilder and Task ...
sophia's user avatar
  • 11
0 votes
0 answers
462 views

I am working with ArcGIS Python API and trying to connect to a local server with the code: gis = GIS(url="https://localhost:6443/arcgis", username="**", password="**", ...
kgs-tliu's user avatar
0 votes
1 answer
53 views

This is my code: import arcpy from datetime import datetime from arcgis.gis import GIS from arcgis.raster import ImageryLayer # Connect to GIS (with authentication) gis = GIS("https://www.arcgis....
user243645's user avatar
0 votes
1 answer
565 views

I am working on some Python that takes an attribute table and makes a pandas df from it. I am doing this by creating an empty list, and looping through each record of the attribute table and making a ...
Wes's user avatar
  • 11
0 votes
1 answer
115 views

I'm trying to run this notebook in ArcGIS Pro: https://developers.arcgis.com/python/samples/count-cars-in-aerial-imagery-using-deep-learning/#:~:text=imagery%20%3D%20gis.content.search(%22aerial*%22) ...
Freestyle Season's user avatar
0 votes
1 answer
393 views

I have a script that I'm using to sort through a very large feature layer with thousands of records and create a summary table of them by type. It also calculates the count of records of the last 5 ...
Fred Mitchell's user avatar
1 vote
1 answer
817 views

I am trying to perform an 'upsert' (UPDATE + INSER) operation on a feature layer via ArcGIS API for Python. My input data is a GeoJSON file that gets uploaded as per the available guides: data_item = ...
Martim Passos's user avatar
0 votes
1 answer
185 views

I'm encountering a peculiar issue while trying to add records to a Hosted Layer in ArcGIS using Python. I am using ArcGIS Pro 3.1.3 with ArcGIS Enterprise 11.1. I am running this code from the Jupyter ...
Mir Muhammad Murtaza's user avatar
0 votes
1 answer
195 views

I am using ArcGIS Pro 2.9.8 and Python 3.7 from the ArcGIS\PRO\bin\Python\envs\arcgis-pro-py3\python.exe. I have a pandas dataframe from CSV I am trying to get to a shapefile or featureclass for a set ...
MrKingsley's user avatar
  • 1,503
0 votes
1 answer
70 views

ArcGIS API for Python version 2.2.0.1 I have used the move_from_basemap() to move basemap to a layer. from arcgis.gis import GIS from arcgis.mapping import WebMap ## Access AGOL agol = GIS("home&...
Clubdebambos's user avatar
  • 1,745
0 votes
1 answer
40 views

How do I use the UserInvitationManager class with the ArcGIS Python API? The documentation is scant and there are no examples. I have a workflow that will involve inviting a separate account of mine ...
TravisB's user avatar
  • 173
0 votes
1 answer
60 views

Is there a way to set/unset a service Lock Database Schema using ArcGIS ArcGIS API for Python?
GISGUY's user avatar
  • 3
0 votes
1 answer
91 views

I am a complete newbie to ArcGIS/ArcPy. I am creating a new Python Toolbox, that reads in a GPFeatureLayer, and also should return one. I read in the values of a GPFeatureLayer row by row. Then I ...
WilliWespe's user avatar
0 votes
1 answer
71 views

I am fairly new to python and need recommendations on how to handle internal/helper function failures. I have a script that that imports a list of jurisdictions, then iterates through that list and ...
TravisB's user avatar
  • 173
2 votes
1 answer
357 views

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 = ...
ZephyrZ's user avatar
  • 113
1 vote
1 answer
471 views

Using ArcGIS API for Python on Portal, I need to see from arcgis.gis import GIS gis = GIS(url="https://xxx.xxx.com/portal", username="xxx", password="xxx") print(gis....
user1106951's user avatar
  • 1,498
-1 votes
1 answer
309 views

I want make a spatial join with my two spatially enabled dataframes. But while doing a join between the two dataframes. I got below errors. joined_sedf = sedf_cables.spatial.join(sedf_sub_assignment[['...
Nihar Sahoo's user avatar
0 votes
1 answer
251 views

Every time I run this code with a wild card (max_users = '*') or >140 I get this error JSONDecodeError: Expecting value: line 1 column 1 (char 0). But are <140 value it works fine not just all ...
Godofsix's user avatar
0 votes
1 answer
94 views

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 ...
Jiří Komínek's user avatar
0 votes
1 answer
810 views

I have a hosted feature layer with a field with a domain (coded values). How do I get the description instead of the coded value? The layer is in the TOC of an aprx, and I can retrieve the domain name ...
GISGe's user avatar
  • 9,684
1 vote
0 answers
274 views

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. ...
Johnny's user avatar
  • 11
1 vote
1 answer
127 views

I am creating a group using the ArcGIS for Python API, there is limited information in the API Reference here. And I found some more information in the Rest Reference relating to the membershipAccess ...
Clubdebambos's user avatar
  • 1,745
1 vote
1 answer
71 views

The create() function in the GroupManager module has two parameters; provide_group_name and provider. See API Reference What is the purpose of these parameters? I cannot find any documentation ...
Clubdebambos's user avatar
  • 1,745
1 vote
1 answer
413 views

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(...
ZephyrZ's user avatar
  • 113
2 votes
1 answer
370 views

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 ...
Ben Blowers's user avatar
1 vote
1 answer
399 views

I built a Docker container to run one of our ArcGIS Python API scripts. It ran for a couple of months successfully. Recently I added some minor enhancements and rebuilt the Docker image. Thereafter, ...
BKJ's user avatar
  • 11
1 vote
0 answers
174 views

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 ...
gecco15's user avatar
  • 11
0 votes
1 answer
1k views

I need to run a daily script that checks if data hosted on AGOL matches source data in an enterprise geodatabase. I'd like to convert the enterprise geodatabase table and a JSON file containing the ...
geoJshaun's user avatar
  • 1,545
0 votes
1 answer
491 views

I have a branch versioned service layer on ArcGIS Portal. I want editors to use ArcGIS Pro to open a map in a ArcGIS Pro project and use their respective versions of this layer to create new features ...
geoJshaun's user avatar
  • 1,545
1 vote
0 answers
454 views

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'...
SC_Python's user avatar
0 votes
1 answer
541 views

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 ...
Jesse's user avatar
  • 3
1 vote
1 answer
784 views

I am using a Python script (see below) in ArcGIS Pro to update two existing hosted feature layers on ArcGIS Online. The script deletes all records in the existing hosted feature layers and appends the ...
lambertj's user avatar
  • 3,112
1 vote
0 answers
287 views

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\...
Rpandia31's user avatar
  • 141
0 votes
1 answer
989 views

What I've Tried: I have used the script in this article before. However it does require more input than I would like, and the feature layers are downloaded as individual FGDB instead of into a single, ...
Austin Averill's user avatar
0 votes
1 answer
1k views

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 ...
DoctorBo's user avatar