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
0 votes
0 answers
10 views

Overwriting hosted table in ArcGIS Online with CSV file from Pandas dataframe in Python

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
0 votes
0 answers
15 views

Unknown error when trying to append to feature layer with ArcGIS API for Python

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
0 answers
43 views

Hosted layer in ArcGIS not getting updated

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

df.spatial.to_featureclass produces an empty shapefile [closed]

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,443
0 votes
1 answer
22 views

ArcGIS API for Python WebMap object move_to_basemap() method will not move the layer to the basemap

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,690
0 votes
1 answer
15 views

Accessing the UserInvitationManager class, ArcGIS Python API

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
0 answers
18 views

Setting/Un-Setting Service Lock Database Schema Property Using ArcGIS API for Python

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

Reducing processing time reading spatial data

I have a feature class I wanted to read as a Spatially enabled dataframe: from arcgis.features import GeoAcessor df_teig = GeoAccessor.from_featureclass(feature_class_path) The dataframe has 17 ...
user234214's user avatar
0 votes
1 answer
37 views

Create a new GPFeatureLayer from data frame

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

Handling/troubleshooting errors with helper scripts in arcgis module

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

Accessing ArcGIS Portal user account using ArcGIS API for Python

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

GeoAccessor (SEDF) spatial join is not working in ArcGIS Python API?

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
0 answers
20 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:...
Omer's user avatar
  • 1
0 votes
0 answers
48 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 ...
Nihar Sahoo's user avatar
0 votes
1 answer
114 views

ArcGIS Python API (gis.user.search)

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
30 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 ...
Jiří Komínek's user avatar
0 votes
0 answers
197 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 ...
JNN's user avatar
  • 125
0 votes
1 answer
304 views

How to get description instead of coded value for a field with domain in hosted feature layer

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,674
1 vote
0 answers
118 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. ...
Johnny's user avatar
  • 11
1 vote
1 answer
73 views

Cannot enable 'Any organization's members' setting when creating Group or updating properties using ArcGIS Python API [closed]

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,690
1 vote
1 answer
37 views

What do parameters provider_group_name and provider achieve in GroupManager create function when using ArcGIS Python API?

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,690
1 vote
0 answers
230 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(...
ZephyrZ's user avatar
  • 89
1 vote
1 answer
196 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 ...
Ben Blowers's user avatar
0 votes
0 answers
42 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 ...
TarIV's user avatar
  • 1
1 vote
1 answer
276 views

ArcGIS Python API wont run in Docker

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

Can you grab a JSON file off of an AGOL feature layer using Python API

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,535
0 votes
1 answer
179 views

Trying to use UpdateCursor on Branch versioned layer - RuntimeError: cannot open workspace

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,535
1 vote
0 answers
308 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'...
SC_Python's user avatar
0 votes
0 answers
210 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 ...
Jesse's user avatar
  • 3
1 vote
1 answer
424 views

Update Modified date or Summary field of AGOL hosted feature layer using ArcGIS API for Python

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,037
1 vote
0 answers
232 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\...
Rpandia31's user avatar
  • 141
0 votes
1 answer
396 views

How can I automate a consolidated back up of all AGOL feature layers with python? [closed]

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
505 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 ...
DoctorBo's user avatar
0 votes
0 answers
85 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 ...
Samira Goodarzi's user avatar
0 votes
1 answer
147 views

How do I get the data from HostedFeatureLayer for today's date using Python from ArcGIS Online

Currently, I am pulling all the data from the featurelayerid using the below script: feature_layer_id = ' ' Inspform = gis.content.get(feature_layer_id) insp=Inspform.layers[0].query().sdf insp....
SC_Python's user avatar
0 votes
1 answer
44 views

Manage and Publish ArcGIS Server v10.8 Services using API with no AGOL and no Portal

I have ArcGIS StageServer with Site1 and multiple Map\GeoCode\Routing Services. There is no WebAdapter, ArcGIS Online or ArcGIS Portal installed. We need to update multiple Production ArcGIS Servers ...
alby's user avatar
  • 50
0 votes
1 answer
26 views

arcgis.features line features failing to buffer

I'm trying to write a script that buffers a line dataset. I'm able to successfully buffer a single polygon but, when I try and buffer my three lines, the code fails. Does anyone know what I'm doing ...
jdavid05's user avatar
  • 538
1 vote
1 answer
253 views

Publishing Web tool that works with data on Portal for ArcGIS and using it in Web Appbuilder

I am trying to publish a web tool from ModelBuilder in ArcGIS Pro. Inside my model there is (besides other things) a script. This script works with data on the same Portal that I want to publish the ...
Martin's user avatar
  • 1,273
0 votes
0 answers
99 views

ArcGIS Server Py3 - <type 'exceptions.ImportError'>, ImportError('No module named arcgis',), <traceback object at 0x00000000025870C8>

I have cloned the default python env that installs with ArcGIS Server using conda create in the python command window using: conda create --clone arcgispro-py3 -p"C:\Program Files\ArcGIS\Server\...
geoJshaun's user avatar
  • 1,535
1 vote
0 answers
578 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 ...
Thomas's user avatar
  • 1,735
0 votes
1 answer
186 views

Access user calling a web tool

I am currently developing a GP Tool / WebTool for ArcGIS Enterprise. Main goal of the tool is to write what3word tags to point features. Workflow is as follows: User selects a layer in the webmap Run ...
Bernd Loigge's user avatar
  • 2,413
0 votes
2 answers
271 views

Use current password in arcgis.gis

I'm currently signed into my portal through ArcGIS Pro. When I want to use a python notebook to update my portal, I use: from arcgis.gis import GIS my_gis = GIS( url='https://<my Org's ...
SwiftestKoala's user avatar
0 votes
1 answer
75 views

ArcGIS Online User object 'report' method/function errors

According to the API docs for User object there is a 'report' function. https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User I have an Administrator user role. When I ...
Clubdebambos's user avatar
  • 1,690
1 vote
1 answer
36 views

What does 'mode' mean in and AGOL WebMap operational layer properties?

I am accessing an Operational Layer in a WebMap and updating some properties. There is a 'mode' property that is set to 1. What does mode mean? and what values will it accept? and what does each value ...
Clubdebambos's user avatar
  • 1,690
1 vote
1 answer
552 views

users.search resturns only Creator users in ArcGIS Python API

I am trying to search for all the users in Portal (10.9.1). I find that it only returns Creator users. I am looking for all the users. The query below uses wildcard. users = arcgis.gis.UserManager(gis)...
sunnwaygis's user avatar
1 vote
1 answer
73 views

out_field in ArcGIS Python API returning unwanted fields

I am trying to output ONLY the Name Field in sdf using ArcGIS Python API and Notebook like thia query = layer.query(where="POP2010 > 1000000", out_fields='NAME') query.sdf But I am ...
Suffii's user avatar
  • 588
0 votes
1 answer
101 views

Randomly select points in a feature layer

Context: I'm working on AGOL notebooks I have a feature layer (points). So, I'd like to randomly select several points based on the value in one of the columns ('level_' column). For instance, I'd ...
MVAC's user avatar
  • 3
1 vote
1 answer
950 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 ...
Austin's user avatar
  • 128