Questions tagged [arcgis-python-api]
ArcGIS Python API for working with ArcGIS Online and Portal for ArcGIS
129
questions
0
votes
0
answers
11
views
Exporting and updating ArcGIS Online hosted feature class to file GDB [closed]
I am new to ArcPy and the ArcGIS Python API in general.
I have a hosted feature layer in ArcGIS Online that contains a few point and polyline layers. Each layer contains an "Exported" field ...
0
votes
0
answers
25
views
ArcGIS API for Python Create Feature Service with Feature Layer and Table from Shapefile and CSV
I have a point shapefile with one field, a unique id called reg_no. I have a csv file with a reg_no column and other fields. I want to create a Feature Service in AGOL with the point geometry as a ...
0
votes
1
answer
36
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
...
0
votes
0
answers
57
views
Issue with Python Script: Overwriting Hosted Feature Layer on ArcGIS Online: Error Code: 406
I need assistance with my script. Can anyone point me in the right direction?
I'm attempting to overwrite a feature layer with data from a CSV file, both of which are hosted on my portal on ArcGIS ...
0
votes
1
answer
76
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 ...
0
votes
0
answers
49
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 ...
0
votes
0
answers
23
views
Filter invalid geometries in a spatial dataframe
I'd like to join two spatial DataFrames using the ArcGIS API for Python, arcgis.__version__='1.9.0', but the join keeps failing, "likely" based on invalid geometries.
import arcgis
import ...
1
vote
0
answers
49
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 ...
0
votes
0
answers
29
views
Converting feature layer to point using ArcPy with ArcGIS API for Python
I'm using jupyter notebooks (localhost, not in pro or AGOL), and I want to convert a feature layer to point. I've been trying to do it using arcpy.FeatureToPoint_management() but I'm having some ...
2
votes
0
answers
42
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 ...
1
vote
0
answers
49
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....
2
votes
0
answers
37
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?
...
0
votes
0
answers
22
views
Update Source of PDF file on ArcGIS Portal
I have a map in PDF file uploaded on my portal.
I get weekly updates from some other system and after processing it, I generate a new map and update it manually via Portal interface.
I have automated ...
0
votes
1
answer
62
views
Access ArcGIS Python environment, installed via in Anaconda Navigator, from .bat script in normal cmd window?
I'm trying to run a Python script (shapefile_upload.py) which uses ArcGIS libraries. I installed the ArcGIS libraries by following exactly these instructions.
The Python script uploads a shapefile to ...
0
votes
0
answers
51
views
A change in Python API for ArcGIS Online regarding geocoding?
from arcgis.gis import GIS
my_gis = GIS()
m = my_gis.map('Stockholm, Sweden')
m
This has previously worked but now second last line takes a lot of time and gives following error. Wondering if this ...
0
votes
1
answer
80
views
Upload shapefiles to ArcGIS Online using Python script on computer without ArcGIS Pro installation [closed]
We are trying to automate the upload of shapefiles to ArcGIS Online using a Python script. This script will need to run on a (virtual) computer that does not have an ArcGIS Pro installation. We have a ...
0
votes
0
answers
52
views
ArcGIS Python API - FeatureLayer set CRS
I'm loading a layer from ArcGIS with the ArcGIS Python API:
from arcgis.features import FeatureLayer
layer=FeatureLayer(lyr_url)
Then I make it a pandas dataframe and then move it to Geodataframe as ...
1
vote
1
answer
99
views
Updated JSON not showing up in feature layer properties on ArcGIS Online
I wrote a script that will automate the overwrite feature layer process using a map object in ArcGIS Pro. When changes are made to the underlying data they show up on AGOL after running the script. ...
2
votes
1
answer
73
views
Putting shapefile on map in ArcGIS Online using ArcGIS Python API and Jupyter Notebook
I inserted a shapefile (in .zip as required) to ArcGIS Online through Jupyter notebook:
from arcgis.gis import GIS
my_gis = GIS()
m = my_gis.map()
#let's put the shape file to AGOL
shp_item = my_gis....
1
vote
0
answers
46
views
Exporting FGDB From ArcGIS Enterprise using ArcGIS Python API
I am building a Python script for a client who wants a bunch of hosted feature services exported to file geodatabases. The script I've written works just fine. Each hosted feature service is exported ...
0
votes
0
answers
74
views
Error when cloning ArcGIS Portal file based items
I'm trying to set up some ArcGIS Python code (in ArcGIS Pro Notebook) which aims at cloning Portal users, groups and items like in https://developers.arcgis.com/python/sample-notebooks/clone-portal-...
2
votes
0
answers
84
views
ArcGIS API for Python: AttributeError: module 'brotli' has no attribute 'error'
from arcgis.gis import GIS
when run in ArcGIS Pro 2.6 notebook results in long error message (below).
What might be wrong?
Note that import arcpy works without difficulties.
--------------------------...
0
votes
1
answer
325
views
ArcGIS Python API "unable to generate token" upon login attempt
I've been trying to log into either my ArcGIS Online or ArcGIS Enterprise portal through the ArcGIS Python API.
Using the GIS module, I have tried the following:
gis = GIS("https://subdomain....
0
votes
1
answer
45
views
How to specify the default display style for a FeatureLayer using ArcGIS (Python) API?
Is there a way to edit the default display style of FeatureLayer on ArcGIS Online via the (Python) API?
Currently I can use the gis module to publish a GeoJSON to ArcGIS Online.
The GeoJSON in ...
1
vote
0
answers
65
views
Accessing hosted feature layers in ArcGIS Portal
The feature layers can be accessed using the item type, is there any way to retrieve only the hosted feature layers from the Portal ??
from arcgis.gis import GIS
gis = GIS(url='https://pythonapi....
2
votes
2
answers
75
views
Downloading ArcGIS Online feature service using ArcGIS Python API
I rarely use ArcGIS Online but I have been tasked to download all layers on this https://services5.arcgis.com/gFh7gtZrHd449arT/arcgis/rest/services/greenez514_SW5_District_Layers/FeatureServer
I found ...
1
vote
0
answers
20
views
Non-editable Field names differ Between AGOL and File Geodatabase
While attempting to overwrite a hosted feature layer from a local featureclass, field.name "Shape__Length" cannot be updated using values from field.name "Shape_Length". When ...
0
votes
0
answers
20
views
Publish OGCFeatureService ArcGIS online - Python
I have successfully uploaded a geojson file to arcgis online, and published it to a feature service. I have read through the API documentation and for the life of me I can't work out how to publish ...
2
votes
0
answers
298
views
arcgis to_featurelayer() crashes kernel with ImportError: PyCapsule_Import could not import module "datetime" [closed]
My python kernel and ArcGIS both crash when I try to export a spatially enabled DataFrame to a featurelayer or featureclass in one of my virtual environments.
In addition to the python and ArcGIS ...
3
votes
1
answer
735
views
Overwriting Feature Layer on ArcGIS Online using ArcGIS Python API
I get a generic error "Job Failed" when using the below code to try and overwrite a feature layer on ArcGIS Online:
shp_fp = 'E:\folder\shapefile.shp'
feat_id = 'q3p094rupqe9vntowe98w98eyt0w'...
1
vote
0
answers
81
views
Updating Portal Item Thumbnail ONLY if it is has not been changed yet using ArcGIS Python API
Using Python, is it possible to check if the thumbnail for a Portal Item is the default thumbnail? I want to update thumbnails if they have not been updated yet.
I know I can update thumbnails using ...
0
votes
0
answers
24
views
Removing rows limitation when making feature layer query using ArcGIS Python API
I have a fairly big spatiotemporal dataset located at a server, which gets additional 1000 rows every 10 seconds for like two moths already. I am concerned to download and process this data day by day,...
0
votes
0
answers
33
views
How to save result of arcgis.learn.prepare_data (ArcGIS Pro)
After running 'Export training data for deep learning' tool in ArcGIS Pro, named as 'training_folder', I did data augmentation on the 'training_folder' using arcgis.learn.prepare_data. Then, I would ...
0
votes
0
answers
66
views
ArcGIS Python Overwrite AGOL Feature Class with Spatially Enabled Dataframe
To sum it up, I've accessed an AGOL Feature Class, converted the point layer to a Spatially Enabled DataFrame (SEDF), and made the edits to the attributes that I needed. I have the Dataframe I want, ...
0
votes
0
answers
37
views
Python: Unexpected area results after converting lat/long coordinates to wkid:3857
My end-goal is to be able to calculate the areas of small polygons (between 1000 and 5000 sq ft) with lat/long coordinates. I am having some unexpected results when doing this and decided to switch to ...
1
vote
0
answers
241
views
Script using Python API and Windows task scheduler
I have a Python script that uses the Python API to logging into the server, stop geocode services, rebuild locators and start services. I'm using task scheduler on a server machine where other Python ...
2
votes
1
answer
463
views
Upload GeoJSON files to ArcGIS Online content
I would like to upload local GeoJSON files with Python automatically to ArcGIS Online. Now I have to upload them one for one, which takes quite some time. So I looked into the ArcGIS API for Python.
I ...
1
vote
1
answer
340
views
Back-up Feature Services with a script
Goal: I want to create copies of feature services and save them in a FGDB in a network folder on my machine. The overall purpose of the script is to have back-ups of my authoritative feature services ...
2
votes
0
answers
266
views
Connecting Python to get data from Survey123 and show it on Web AppBuilder
I am downloading a survey data from survey123.com by using GIS services however I am not able to create a widget on webapp to show it on ArcGIS webapp. I am not familiar with ArcGIS but here is the ...
0
votes
0
answers
59
views
Query point-intersection layer values with ArcGIS webmap (Python REST API)
I've created a webmap with ArcGIS. It has about 7 layers of information that are valuable to an app I am building. Is there any way to query intersecting layer values if I provide coordinates? For ...
0
votes
0
answers
28
views
Finding available options when adding layer to the WebMap() model through ArcGIS Python API?
I'm trying to find available options I can use when adding a layer to WebMap() in the ArcGIS API. The esri examples don't expand on all the available options and when looking at the API reference ...
1
vote
1
answer
282
views
ArcGIS : You do not have permissions to use this resource. (Error Code: 401)
I am trying to query Demographic data using ArcGIS Python API and the following is my code to do the same.
from arcgis.gis import GIS
from arcgis.geoenrichment import Country, enrich, BufferStudyArea
...
1
vote
1
answer
174
views
Using ArcGIS Python API to consume standalone ArcGIS REST API
I have access to a ArcGIS REST API service running on a standalone, unfederated ArcGIS Server. (Not AGOL or ArcGIS Enteprise) ie (https://xxxx.xxxxx.com/arcgis/rest/services/xxxxxx/xxxxMap/MapServer)
...
1
vote
0
answers
32
views
ArcGIS Python API - feature renderer faild in AGOL
I am trying to save a feature service in AGOL using ArcGIS Python API with symbols. I use the same symbols in a map widget and the features appear correctly but when I save the feature as a feature ...
0
votes
1
answer
109
views
Esri Notebook - Select and append records to table
Using Notebook editor in ArcGIS Online i want to extract from a FC table, those records with a specific data and then insert them into a separate table. I am trying the code below, but getting an &...
0
votes
1
answer
202
views
Filtering by folder or authoritative maps when using gis.content.search
I use the code in Python
for item in gis.content.search(query="owner:MyUsername", item_type='Feature Service')
to go over the feature classes uploaded on my organization's AGOL page. I want ...
1
vote
1
answer
125
views
Creating new Feature Layer from existing feature layer on ArcGIS Online using ArcGIS API for Python
I have a folder on ArcGIS Online for a city that has few layers in it.
I need to create separate folders for each city and then create new feature layers using these existing layers, preferably using ...
1
vote
1
answer
558
views
How to append a FeatureCollection to a hosted Feature Layer in ArcGIS Enterprise?
This question pertains to arcgis.gis in Python, for working with hosted Feature Layers in ArcGIS Enterprise.
I'm using the enrich_data function to calculate a buffer polygon from my input (hosted) ...
3
votes
0
answers
396
views
Mapping .csv file using ArcGIS online with Python
I have .csv data in the format:
Longitude Latitude Threat
-24 45 0.5
-31 40 0.9
. . .
. . .
I want to visualize this data as a threat ...
0
votes
1
answer
166
views
Publish CSV to Enterprise Portal as table
I'm following this help doc.
https://geosaurus.maps.arcgis.com/home/item.html?id=a1db6db172bc49a8932daacc2ed3d3ac#preview
I'm able to add the CSV to the Portal, but I cannot get it to publish. I need ...