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
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 = ...
ZephyrZ's user avatar
1 vote
1 answer
20 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,500
-1 votes
1 answer
19 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
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:...
Omer's user avatar
  • 1
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 ...
Nihar Sahoo's user avatar
0 votes
1 answer
30 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
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 ...
Jiří Komínek's user avatar
0 votes
0 answers
70 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
69 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,664
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. ...
Johnny's user avatar
  • 11
1 vote
1 answer
36 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,495
1 vote
1 answer
20 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,495
0 votes
0 answers
98 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
1 vote
1 answer
92 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
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 ...
TarIV's user avatar
  • 1
1 vote
1 answer
164 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
0 votes
0 answers
52 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
0 votes
1 answer
256 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,525
0 votes
1 answer
76 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,525
1 vote
0 answers
175 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
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 ...
tmcgrath's user avatar
0 votes
0 answers
113 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
301 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
  • 2,892
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\...
Rpandia31's user avatar
  • 141
0 votes
1 answer
217 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
244 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
65 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
131 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
40 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
0 answers
52 views

Print webmap extent in ArcGIS Python API

Below is my code, all variables are defined in the above cells in my Jupyter notebook, it throws no errors, and the Pandas dataframes work but no output is returned. I have all necessary libraries ...
Luke Steinbicker's user avatar
0 votes
1 answer
21 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
  • 488
1 vote
1 answer
164 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,263
0 votes
0 answers
81 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,525
1 vote
0 answers
436 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,655
0 votes
1 answer
133 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,191
0 votes
2 answers
144 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
63 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,495
1 vote
1 answer
32 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,495
1 vote
1 answer
450 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
60 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
76 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
696 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
  • 88
0 votes
1 answer
350 views

ArcGIS API for Python: SEDF from_layer Fails With 'Layer' object has no attribute 'filter'

I'm struggling to build a dataframe out of a featureclass (via a layer), where I'm getting this error message: Exception: Could not load the dataset: 'Layer' object has no attribute 'filter' from ...
Maxcot's user avatar
  • 255
0 votes
1 answer
118 views

I am trying to perform a machine learning analyis using the ArcGIS module in Jupyter notebooks but strange error

I was trying to import all modules for ArcGIS to perform a machine learning analysis. However, the code gives me an error at the line from arcgis.learn. Code: %matplotlib inline import pandas as pd ...
Saad Ullah's user avatar
0 votes
1 answer
642 views

Converting dataframe with WKT column to spatial dataframe in ArcGIS API for Python

I am querying a data set from an Oracle spatial server with the geometry field in a WKT format, and I am running into issues trying to convert it to a spatial dataframe using the ArcGIS API. Going ...
erudeeptio's user avatar
4 votes
1 answer
2k views

Export ArcGIS spatially enabled dataframe to feature class

I'm working to develop a tool that converts JSON data pulled from an API into a feature class to be stored in an ESRI file geodatabase. I'm currently testing the functionality in a Jupyter notebook ...
Joshua Croff's user avatar
1 vote
0 answers
406 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 ...
David Archibald's user avatar
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 ...
BERA's user avatar
  • 67.1k
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....
Aravinth's user avatar
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? ...
Aravinth's user avatar