Questions tagged [arcpy]

A site-package created by Esri to expose ArcGIS Desktop (ArcMap and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

Filter by
Sorted by
Tagged with
1 vote
0 answers
19 views

sql_clause with UpdateCursor does not honor DISTINCT like SearchCursor does in ArcGIS Pro 3.2

Using ArcGIS Pro 3.2 Here is the SearchCursor with sql_clause with arcpy.da.SearchCursor('Buildings', "type", sql_clause=("DISTINCT type", None)) as cursor: for row in cursor: ...
Clubdebambos's user avatar
  • 1,645
0 votes
2 answers
38 views

gdal projection string not recognized by arcpy.SpatialReference()

I have a raster image that has a custom projection system. I used the following code to retrieve the projection information from the raster and turn it into an ArcGIS recognized PCS following this ...
ESimonson's user avatar
0 votes
0 answers
14 views

Converting .mdb files to .gdb files using ArcPy [closed]

I have hundreds (if not thousands) of .mdb files in different folders on my server, I'm in the process of switching to ArcGIS Pro and since it doesn't recognize the .mdb file, I need to convert all of ...
Andrew Shafer's user avatar
1 vote
1 answer
54 views

Concatenate string variable and field in ArcPy "CalculateField" expression

I am trying to add a file path field to a feature layer in an ArcPy notebook in ArcGIS Pro. I have a variable with the beginning of the path (the path to the folder) and an existing field with the ...
Eleanor Horvath's user avatar
0 votes
0 answers
37 views

Changing table values in an enterprise feature layer using a geoprocessing tool [closed]

I have written a python script that takes the table of a polygon feature layer and returns an Excel file with unique IDs for each polygon (which is then joined to the polygon in ArcGIS Pro) I'd like ...
ZephyrZ's user avatar
  • 19
1 vote
0 answers
34 views

Values in second columns of GPValueTable Parameter reset after tool is ran

I am trying to create a .pyt python toolbox tool in ArcGIS pro and the issue I'm running into is that Values in second columns of GPValueTable Parameter reset after tool is ran. The parameter created ...
Live Strong's user avatar
0 votes
1 answer
37 views

OS Error CURRENT using ArcPy in ArcGIS Pro

I am relatively new in Python. I have a project that I need to adapt to work with ArcGIS Pro. This code runs in FME PythonCaller using Python 2 working with ArcMap. Now I need to migrate to Python 3 ...
Bram's user avatar
  • 1
0 votes
0 answers
45 views

My while loop in ArcMap using ArcPy is not giving what I want

I have revised my code I am trying to get cumulative catchments from a table in arcmap using a table, I am using four fields namely CatName(cid), Area(Load) and DS(Downstream Node) , I want the ...
Dingaan Mahlangu's user avatar
2 votes
1 answer
72 views

Turning off layer visibility in ArcGIS Pro with Python

I have code that exports several maps. For a set of maps, I want to make sure one layer used in a previous map is turned off. I don't want to remove it completely. Anyone know what I am doing wrong? ...
Mariah.H's user avatar
1 vote
0 answers
33 views

Why does arcpy.da.Describe return different keys for same feature class based on location?

I have a file geodatabase on a remote desktop with the following layer: r'C:\Folder\Database.gdb\Feature_Dataset\Feature_Class'. If I copy this entire gdb to my local machine, da.Describe does not ...
Dante's user avatar
  • 31
0 votes
0 answers
37 views

Edit PostgreSQL database with ArcPy

I have an ArcPy script that works locally with a .gdb database and create some features in this local DB. I would like to migrate my infrastructure on a server and do the same work but on a PostgreSQL ...
fed's user avatar
  • 9
-1 votes
1 answer
49 views

Moving points based on updated x,y values [closed]

In an ArcGIS Pro project, I have a feature class with over 2,000 points and I have updated the x,y fields of about 100 of these using a script. I now need the locations of these points on the map to ...
Bear's user avatar
  • 1
3 votes
1 answer
67 views

Using page query with python

I am trying to automate a process in ArcGIS pro using python. In this process I create several maps using a map series. I use a page query to filter my data based on the map series page name. I can't ...
GIS's user avatar
  • 53
2 votes
1 answer
38 views

How to increase line width?

I have a script that changes the symbology to unique values, but I can't figure out how to adjust the width? #isolate the symbology of the selected layer sym = lyr.symbology #set the symbology as ...
Davec433's user avatar
1 vote
0 answers
48 views

Ignoring Python warning messages in ArcMap

I want to calculate the OD Cost Matrix in ArcMap 10.3.1 using the ArcPy package. When running the arcpy.Solve_na, the Python console prints a lot of warning messages. After a while, ArcMap crashes, ...
Chen Chien Yi's user avatar
0 votes
0 answers
61 views

FlowAccumulation working when run as geoprocessing tool but not in ArcPy

I have a problem with this code: #actual problem code flow_dir_rast = flow_dir in_weight_raster = mine_flac_weight data_type = "FLOAT" flow_direction_type = "d*" # run the flow ...
Felix Chan's user avatar
0 votes
0 answers
48 views

Internationalization/localisation for environment variables arcpy GP tool

I had gone through the below post to achieve localisation for log messages in history tool using messages.xml as well as for parameter labels using toolbox xmls. https://pro.arcgis.com/en/pro-app/...
koulritash's user avatar
1 vote
1 answer
55 views

Importing CSV file in ArcGIS Pro ArcPy script using relative paths

I have a CSV file in my toolbox folder. I would like to import the CSV file into my arcpy script to run in conjunction with my arcpy script. Folder structure: src data my_csv.csv mytoolbox.pyt ...
Clouseau's user avatar
2 votes
0 answers
58 views

Removing joins to layers using ArcPy in ArcGIS Pro

I have some layers that point to feature classes in a geodatabase. Some of the layers are joined to a table also in the geodatabase and I am trying to remove all the joins so that I can run some other ...
James's user avatar
  • 41
0 votes
2 answers
47 views

Selecting records after using insert cursor

Using ArcPy and on the same script, I would like to perform a SelectLayerByAttribute tool to select the features created with the InsertCursor tool. coords = [1, 2, 3, 4] pointlyr = 'point' Sr = ...
user206005's user avatar
0 votes
4 answers
100 views

Adding Field Map to Append using ArcPy

I have a folder of shapefiles which I want to append to project geodatabase feature classes using ArcPy. So far, as I am testing with just a few shapefiles, the script works fine as long as all the ...
user-0326's user avatar
0 votes
1 answer
37 views

Search cursor skipping every other row

I am trying accomplish something which should be fairly straight forward. I am trying to merge snowfall events within 4 hours into a single event so. The end of the entire event, and the name of the ...
Ryan Gould's user avatar
1 vote
0 answers
38 views

How to fill/calculate a field in ArcGIS 10.5 based on condition of another field using Python [closed]

I have three fields in a featureclass. they are G_landuse (General Landuse), detail_lan (Detail landuse) and Type. Some values of G_landuse are blank. I want to fill all blank values of G_landuse ...
Abtahee Ankur's user avatar
0 votes
1 answer
31 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
1 vote
2 answers
81 views

ArcPy intersection method passing in two polygon features returns an inaccessible line feature object

I'm trying to calculate the area of two overlapping surface elements in order to calculate the area overlap between them. Then I used the intersect method to get the overlapping area of polygon A and ...
hx wu's user avatar
  • 13
-1 votes
1 answer
42 views

ERROR 000732: Input Rasters: Dataset input_dem does not exist or is not supported

Context : DEM Modification using shapefile. Scenario: Change elevation values of the dem using a polygon shapefile. Update the elevation values within each polygon according to the values specified in ...
Abhijit Biswas's user avatar
0 votes
1 answer
66 views

Changing Arcpy Message-Warning-Error Text Colors

I recently came across a post about changing "the default error color in python" and was interested in doing something similar with Arcpy's AddMessage, AddWarning, and/or AddError functions. ...
Binx's user avatar
  • 1,290
0 votes
1 answer
30 views

Python Toolbox - Parameters drop down list will not update with new parameter

I am making a python toolbox for ArcGIS Pro 2.9.8 with arcpy in Python 3.7 I have a workspace parameter defined as param1 = arcpy.Parameter( displayName="Feature Dataset or Geodatabase ...
MrKingsley's user avatar
  • 1,443
0 votes
0 answers
30 views

Save group layer to a layer file using arcpy (Convert Labels to Annotations)

I am running the "Convert Labels To Annotation" tool in ArcGIS Pro using the Python window. I need to save the output group layer to it's own lyrx file. According to the tool documentation, &...
al_sweets's user avatar
0 votes
0 answers
47 views

Check for ESRI geometry validity using shapely or similar

I have a geopandas dataframe in Python. Is there a way to check geometry validity under the ESRI scheme as opposed to the OGC spec using shapely/geopandas/some hacky way, or am I constrained to using ...
jesnes's user avatar
  • 423
0 votes
1 answer
81 views

Difference between "ESRI" and "OGC" validity

When I use the Check Geometry tool in ArcGIS Pro, it asks whether I want to validate using ESRI or OGC methods. What is the difference between these two methods? edit I originally asked a second ...
jesnes's user avatar
  • 423
0 votes
1 answer
38 views

WKT Conversion: Object: Error in executing tool

I have a script below where I am trying to convert a CSV of a WKT polygons that I would like to export out into a shapefile and keep getting the following error on line 21 with: arcpy.management....
Holly's user avatar
  • 1
2 votes
2 answers
180 views

How to add a custom tool to ArcGIS Pro tab/ribbon

In ArcMap, we were able to customize the toolbar to add our own Python or ModelBuilder tools. I'm trying to figure out how to do this in ArcGIS Pro but not having any luck. I am able to add a new tab ...
Steve's user avatar
  • 753
0 votes
1 answer
28 views

ArcGIS Pro Stops working after running a script on ArcGIS Notebook and generates error after a long pause

I was trying to perform Downscaling a Prediction Model Using ArcGIS Notebooks and ArcGIS Pro using the datasets provided by ArcGIS Lab and their instructions from this mannual. The provided code is: ...
Sakib Rahman Siddique Shuvo's user avatar
1 vote
0 answers
32 views

Edge holes created from ArcPy script

I'm working on creating floodplain polygons from Base Level Engineering Depth grids. When running this script I end up with holes that don't get filled in on the edges, as circled in red in the image ...
Tebetheia's user avatar
0 votes
0 answers
42 views

ArcPy JoinField Error 000574: Python is not installed

I am new in coding. I am trying to add a field of to my attribute map using "Zonal statistics as Table" and "Join field" tools. For the last one I am using arcpy.management....
Антон Попов's user avatar
1 vote
0 answers
24 views

Create a ArcGIS Online group with some specific settings using ArcGIS Python API

Those line of code create a new group with some specific properties and settings. But its not working for display_settings properties and Group membership settings (Who can view this group?) I set as ...
Prabhansu Adhikary's user avatar
1 vote
1 answer
59 views

arcpy Geometry pointFromAngleAndDistance method

In my workflow I decided to use pointFromAngleAndDistance method and was surprised by output. Script below: import arcpy import prettytable from prettytable import PrettyTable maxDistance = 100.0 SR = ...
FelixIP's user avatar
  • 22.7k
0 votes
1 answer
33 views

Using arcpy, need to find which polygon each set of coordinates in a table intersects with

I'm writing a Python script tool for ArcGIS Pro and among other things, I need it to compare coordinate values (lat & lon) in a GDB table to a polygon feature class and determine which polygon ...
jencarta's user avatar
  • 176
0 votes
1 answer
47 views

Error publishing feature layer using ModelBuilder in ArcGIS Pro

I've created a model in ArcGIS Pro ModelBuilder which attempts to carry out the following: Variable: Database connection (sql server) Make Query Layer (input = Database Connection, output = "...
furbaw's user avatar
  • 1
0 votes
0 answers
43 views

Get errors featureclasses of Trace Network ArcGIS Pro

I try to analyse road featureclass for errors of topology and I use Trace network tool in arcpy. I cannot just create topology and add some rules, because it doesn't work like I want. When I use the ...
Aleksandr Matveev's user avatar
0 votes
1 answer
62 views

How to use CIM in Python to enable time?

I'm trying to automate with Arcpy enabling time for the layers in my Drawing order but can't figure it out. From digging I've found that the only way to do it is through CIM but there's limited ...
Davec433's user avatar
0 votes
1 answer
57 views

Quickly convert point features to raster using ArcPy or GDAL [closed]

I have a very large point feature collection, about 40 million points, which are obtained by raster conversion, so the arrangement of points is regular (the distance between two columns of points is ...
宋宇飞's user avatar
0 votes
1 answer
31 views

How to use Python to update enterpise geodatabase user connections for layers within an ArcGIS Pro Project map

I tried to use the following code to update the connected database user for layers within an ArcGIS Pro project map. The code runs but it does not change the data sources from one enterprise ...
Nicole's user avatar
  • 19
0 votes
1 answer
51 views

Updating the source geodatabase for select layers in ArcGIS Pro (multiple geodatabases used in one map)

I have a map that uses shapefiles from several geodatabases. I need to re-source several layers from one specific geodatabase to another. They are the exact same geodatabase; Geodatabase X was copied ...
Sarah's user avatar
  • 1
0 votes
1 answer
57 views

Adding data to existing .aprx layout and zooming to extent of new data using ArcPy with ArcGIS Pro

I need to add data to an existing .aprx layout and zoom to the newly added data extent. Then, I need to export layout with new data as a JPEG. This workflow is not clear online. My data is not in a ....
Clouseau's user avatar
0 votes
0 answers
46 views

Differences between the size of the output area when using Polygon's symmetricDifference method versus the Symmetrical Difference tool in ArcGIS

I have two overlapping polygons to compare (using ArcGIS Pro 3.0) originated from a DWG file. One as a polygon (closed polyline in AutoCAD). The second as a 3D solid converted to polygon using ...
guymag's user avatar
  • 1
0 votes
2 answers
42 views

Symbology to layers not working

I want to apply layer symbology to all TIFF in a group layer but it does not work: import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = mxd.activeDataFrame groupName = "New ...
coral's user avatar
  • 79
0 votes
1 answer
42 views

Select Layer by Attribute not working with variable, but doesn't give errors using ArcPy

I'm trying to make a simple script tool that allows the user to search a for a specific polygon in a feature class using a unique number. Using the python window in ArcGisPro I run arcpy.management....
grahamsy2k's user avatar
0 votes
0 answers
20 views

Looping through raster symbology (.lyrx) files assigning and saving using ArcPy with ArcGIS Pro

I have a raster with 8 bands all meaning different wildfire behaviors. There is a designated folder that holds the symbology for each (rate of spread, flamelength, etc). From downloading from the ...
Jon's user avatar
  • 1

1
2 3 4 5
211