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
14 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
26 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
34 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 ...
0
votes
0answers
7 views

ArcGIS API for Python edit attributes deletes map view

Currently I have a working script that searches for points within a layer that meets two conditions. It then edits a attribute. The script works well, however as soon as I run it, any point which the ...
1
vote
1answer
33 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
22 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
25 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
34 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
36 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\\...
1
vote
1answer
55 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
0answers
14 views

ArcGIS Python API Plotting ValueError: setting an array element with a sequence

Got a pandas spatial df using ArcGIS python API. The data is read in via pd.DataFrame.spatial.from_featureclass()–i.e., a shapefile. Once loaded, df has a SHAPE column, as you see here. Next, ...
0
votes
2answers
60 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 ...
0
votes
0answers
22 views

Capturing Layer Errors When Loading WebMap using ArcGIS API for Python?

Using ArcGIS Python API 1.6.2 (Python 3.7) with Jupyter Notebook, is it possible to capture the popup, "Error. The layer, <..some layer..>, cannot be added to the map."? Essentially: from ...
0
votes
0answers
53 views

Adding new layout to ArcGIS Pro project?

I'm trying to create a script to update extents of the ArcGIS portal items according to the actual extents of the participating data layers. My idea is to create a local copy of the web map, zoom to ...
1
vote
1answer
40 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 ...
1
vote
0answers
44 views

Importing/downloading symbology from ArcGIS Online using ArcPy?

I am currently attempting to create a script to download shapefiles from ArcGIS Online to my local drive before adding it to an aprx project and thereafter uploading it to a ArcGIS portal/enterprise. ...
2
votes
0answers
48 views

ArcGIS API for Python: Parameter Invalid - Item with the same key has already been added

I'm trying to update an ArcGIS Online (AGOL) feature layer using an updated local CSV file (the steps for this process are detailed in this Sample Notebook). I am using Jupyter Notebook to handle all ...
0
votes
0answers
22 views

How to populate an item's tables list for a ArcGIS API for Python Map Service Item?

I am trying to obtain a specific table from a Map Service item, however the table list is empty. The layers list correctly reports back 5 layers. My code snippet below: search_result = gis....
2
votes
2answers
49 views

Programmatically determining version of ArcGIS API for Python?

I would like to obtain the version of ArcGIS API for Python for logging/diagnostic purposes. Is there a way to determine this before a connection is made? I know that once I have the GIS object, I ...
0
votes
1answer
70 views

Batch uploading PDF files to ArcGIS Online?

I am trying to upload multiple pdf files to ArcGIS Online content all at once. Is there is a script that I can use to add content to ArcGIS Online?
2
votes
0answers
19 views

Function execution hangs if connection to Internet is lost

I am trying to update feature layer. I am updating the records in a loop. The problem is in the case Internet connection lost. It get stuck in the edit_features() function. I have to ctrl+c to stop ...
1
vote
1answer
24 views

Publishing error from ArcGIS API for Python?

I was trying to upload a CSV file on ArcGIS with Python. I wrote the code : import pandas as pd from arcgis import GIS import os import datetime import shutil URL = "https://www.arcgis.com/" gis = ...
0
votes
1answer
61 views

Adding features with attribution to Feature Service using Jupyter Notebooks and ArcGIS Python API?

I want to have a user add points by clicking on a map in a Jupyter Notebook and those points get pushed to a feature service. I'm able to accomplish that task, but I would like the user to be able ...
1
vote
0answers
85 views

AGOL Python Api - Modify Symbology of a Feature Layer

I want to modify the JSON properties of a Feature Layer hosted online to display a certain field in symbology. I am able to access the JSON properties, even the property itself but when I call an ....
0
votes
1answer
70 views

Generating Queried CSV from shapefile using ArcGIS API for Python?

I'm trying to create a csv from a query of a feature layer hosted in ArcGIS Online. The csv only needs to contain one field, where the query is met, geometry is not needed. I'm having issues getting ...
4
votes
1answer
825 views

How to update a hosted feature service on ArcGIS Online using the Python API for ArcGIS Pro?

I'm trying to follow the steps in the Esri blog post Updating your hosted feature services with ArcGIS Pro and the ArcGIS API for Python but am running into an error. To test this I published a ...
1
vote
0answers
36 views

Preserving data types when publishing to ArcGIS Online using ArcGIS Python API?

I have a Python script which does some data manipulation using Pandas dataframes, then outputs to CSV. The CSVs are then published to AGOL using the ArcGIS Python API, overwriting the existing ...
2
votes
1answer
662 views

Updating hosted feature layers on AGOL using the ArcGIS Python API?

I previously asked Adding data to a feature layer on ArcGIS Online using arcrest and arcresthelper.featureservicetools? regarding the most current process for establishing and then automating feature ...
5
votes
1answer
645 views

Using the arcpy Python library with hosted feature service layers from ArcGIS Online?

Is it possible to use the arcpy library with hosted feature service layers from ArcGIS Online? I am aware of the ArcGIS API for Python, but the API lacks many of arcpy's features. In my case, I'd ...
1
vote
2answers
35 views

Getting Exent of Queried Results using ArcGIS Python API?

Im trying to use the ArcGIS Python API to query a few results and gather the extent, I can query the results fine but as soon as I try to extract the extent I retrieve empty results. Using one of the ...
1
vote
1answer
359 views

How to search the folder's items in ArcGIS On Line using the ArcGIS API for Python

I want to have a list of the items inside a folder created by my user in AGOL, I want to use the ArcGIS API for Python. so far I have found this: import sys from arcgis import gis import os ...
0
votes
0answers
72 views

How to get Borough names using ArcGIS API for Python through geocoding?

I'm new to ArcGIS API for Python. Is it possible to do do geocoding of an area, specifically New York City and get all the boroughs' names? i.e.: Geocode request for all boroughs in New York city. ...
1
vote
2answers
458 views

Setting basemap layers of WebMap using ArcGIS Python API?

Using the ArcGIS Python API, I've create a WebMap and two Layers (one containing features, the other containing labels): cbmt = WebMap() cbmt_geometry_layer = Layer(url = <url of geometry layer>...
1
vote
0answers
188 views

Uploading mxd to ArcGIS Online with Python?

I need to create a Python script to upload an MXD to AGOL. I have created an script in arcpy to create a service definition file (*.sd) from the mxd. I have not been able to upload the sd to AGOL ...
1
vote
0answers
99 views

Authentication Error 499 using ArcGIS API for Python?

Using the ArcGIS API for Python, when I create my GIS object: gis = GIS(config["agol"]["agol_gis_url"], config["agol"]["agol_gis_user"], config["agol"]["agol_gis_pass"]) I can verify that it ...
3
votes
1answer
263 views

Update field properties of a layer definition with ArcGis Python API

We have a fields in a large amount of AGOL hosted feature layers that we want to make un-editable and others that we do not want visible. Rather than going into the service definition for each and ...
1
vote
0answers
460 views

How to include maps in Jupyter notebook HTML export?

I'm running the 1.4.2 version of the ArcGIS Python API. In a Jupyter Notebook, I create a map like: lowes = "Arkansas USA Lowe's" lowes_map = gis.map("AR, US", 6) lowes_map ...and get my output. I ...
3
votes
1answer
458 views

Using ArcPy and ArcGIS API for Python together?

I am having trouble with how I am supposed to use both ArcPy and ArcGIS API for Python. ArcPy is only in Python 2 and ArcGIS API for Python is in ArcGIS Pro and is Python 3. I don't know how to set my ...
1
vote
1answer
87 views

Displaying 3rd party FeatureSet geometries on jupyter notebook webmap using ArcGIS Python API

How can I add all geometries included in a FeatureSet to a web map? Trying to add geometries (i.e., shapes) to a Jupyter notebook web map (see code sample below). Adding features from the ArcGIS ...
1
vote
0answers
87 views

Finding closest feature to given address in ArcGIS API for Python?

I'd like to find the closest open space (i.e. a park, square, playground) from a City of Boston MapServer using Python's ArcGIS package. I'd like to use arcgis.features.use_proximity.find_nearest() ...
1
vote
1answer
335 views

Retrieving layers from items of type Web Mapping Application from ArcGIS Portal using ArcGIS API for Python?

I'm serializing portal data so two instances of arcgis portal can be compared and the serialized data can be searched for specific keywords. More specifically, I need to retrieve all layers (and their ...
1
vote
1answer
177 views

ArcGIS API for Python Delete Multiple Features

Can you help me with my code below to delete/send multiple ObjectIDs to a delete parameter? Currently the code just finds one record and send that Object ID to the delete paramter, but id like to be ...
3
votes
1answer
94 views

Using ArcPy to retrieve maps posted on an ArcGIS portal?

I'm using ArcPy and python 3.5 to connect to a few different instances of ArcGIS portal. The goal is to produce a report listing the maps, layers, and datasources that each portal instance has to ...
2
votes
1answer
165 views

Creating Tile Service in ArcGIS Online Python API

I'm trying to create a tile layer via the ArcGIS API for Python. When creating a tile layer in AGOL (manually) they have you specify a range of scales for the zoom level (e.g. 1:1000 or 1:4000). ...
1
vote
0answers
98 views

Can ArcGIS Python API automate functionality provided in Web AppBuilder?

I was feeling adventurous the other day and I decided to dive into ArcGIS Pro and the new ArcGIS Python API. I watched some training videos and since I've been working with ArcGIS Online a lot, I ...
0
votes
1answer
2k views

Difference between ArcPy and ArcGIS API for Python? [duplicate]

Could someone explain, from a high level overview, the difference between ArcPy and the new ArcGIS API package in Python?
1
vote
0answers
210 views

how to plot lat lon data to a map using jupyter notebook?

import arcgis from arcgis.gis import GIS from arcgis.features import SpatialDataFrame ago_gis = GIS() search_subset = ago_gis.content.search("Hong Kong Topographic Map") subset_item = search_subset[...
1
vote
0answers
171 views

Cannot plot map on ArcGIS python API?

I do not have ArcGIS desktop. And I have installed the ArcGIS Python API. And I tried the following: import arcgis from arcgis.gis import GIS from arcgis.mapping import WebMap gis = GIS() map1 = gis....
6
votes
1answer
1k views

Replacing ArcPy with ArcGIS API for Python?

Today I found out about the ArcGIS API for Python. I was wondering if you could use this to (eventually) replace ArcPy? Recently I have been doing analyses that require cloud based solutions. When ...
0
votes
1answer
314 views

ArcGIS Python API FeatureLayer query by buffered point

I am really running into some problems with the Python API, I am trying to query a feature layer and return all results that fall within a certain distance of a supplied point. According to the docs ...