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
0
votes
1answer
23 views

Make Query Layer only returns first row of each table

I have been trying to conduct an arcpy.MakeQueryLayer_management and it is only returning the first two values from each table in the SELECT. When I run the same SELECT statement in Oracle SQL ...
2
votes
2answers
62 views

How can I create an inset map in DDP that zooms to a feature in a layer besides the index layer?

(ArcMap 10.6.1) I have a map that is using DDP to index through and show ~1800 short line features (bridges), and I need the map to be pretty zoomed in because I'm wanting to show the immediate ...
0
votes
1answer
51 views

Getting same result with less code with PythonWin ArcPy? [closed]

I have finished writing code and it does what I need without having any error. However, I am wondering if there is any option to get the same result in fewer lines, pecially the for loop inside the ...
0
votes
0answers
13 views

Automate simple kriging of multiple fields from the same shapefile using ArcPy?

I'm trying to interpolate temperature data that's in multiple fields of a shapefile automatically using ArcPy. It doesn't sound like a difficult task but I'm new to both ArcGIS and Python, so here's ...
-1
votes
2answers
56 views

Updating Z coordinates of points in polygons with ArcPy

I am trying to update Z values of polygon shape with ArcPy. This script is working without error but increasing the first (0 position vertex) vertex twice. I want to update only once. How can I avoid ...
0
votes
1answer
56 views

Getting 'list' object has no attribute using ArcPy for ArcGIS Pro? [duplicate]

I am using ArcGIS Pro with Python 3.6. I'm posting this as a new question because I've made significant headway in narrowing down the problem. I believe the issue is how ArcPy is used with ArcMap ...
1
vote
0answers
24 views

Layers being removed erroneously at Python script tool finish? [closed]

I've got two Python scripts as a tools in a standard toolbox, and when the tools finish they will sometimes remove a layer from the MXD. It is most likely to happen on the first run of the tool ...
2
votes
2answers
44 views

Drawing shapes like rectangle, polygons on fly using ArcPy in ArcGIS Pro?

I am trying to write a Python script that when imported into a toolbox can be used to draw user defined shapes on fly by clicking mouse points on the screen inside a GIS program. The motto of drawing ...
0
votes
1answer
32 views

Modelbuilder not recognizing table output and throws Error 000732

I am building a tool in ArcGIS Pro Modelbuilder (Pro version 2.2.1) that includes making a drop down list for user input based on the information contained in a domain of a feature class. The three ...
1
vote
1answer
32 views

Deriving field parameter from table parameter in Python Toolbox?

I'm trying to derive a Python Toolbox parameter from another parameter. I'd like to have a tool which determines fields from an input table and applies the list as a filter to a second parameter. This ...
0
votes
1answer
39 views

Creating Select Then Zoom Tool using ArcPy? [duplicate]

I have been trying to create a tool to make a simple select then zoom to selected but I've been running into some issues. I've been using the code from this original posting (https://community.esri....
0
votes
0answers
23 views

Changing NODATA value GeoTIFF with ArcPy of ArcGIS Pro?

I'm using a tool in ArcPy for Python 3 (ArcGIS Pro) which applies an operation to a raster file in GeoTIFF format. condicion = '("{}" - {}) / {}'.format(input_image,n,m) arcpy.gp.RasterCalculator_sa(...
0
votes
1answer
51 views

Update Z values of polygon veritices with multiparts and donuts [duplicate]

I am trying to update Z values of the vertices of the polygon shape. The script bellow works for polygons without multiparts and donuts. If I run this script for polygon shape that contains multiparts ...
0
votes
0answers
16 views

Error Projecting Raster (.hdf) Using ArcPy

I want to project HDF files (MODIS images) to another coordinate system using ArcPy. The following is the code I wrote: input_ras="N:\\mod16a2\\MOD16A2.A2001001.h24v05.006.2017068142418.hdf" out_ras=...
0
votes
0answers
37 views

Updating Symbology on Layer using ArcPy?

I've been trying to update the symbology of a layer on my Python script. The layer that is to be updated shows the percentage of an age range in each region across a county. I have created a test ...
0
votes
0answers
18 views

Maintaining attributes in feature class in memory using ArcPy? [duplicate]

i am trying to feature to line conversion that are not multipart lines and Merge output feature class but its loses the attributes. Here is my code: arcpy.env.workspace="in_memory/" with arcpy.da....
1
vote
1answer
33 views

ArcPy search data from a list of values

I have a list WRL_ID = ['NW-E8-105151', 'NW-E8-105138'] and I am trying to search these values in a field called ID. If the value exist, print 'It's in SDE', if not, print 'Not in SDE'. Right now ...
0
votes
1answer
47 views

ArcPy script causes Python crash when run outside of ArcGIS Python window

I have a Python script that will successfully complete when run from the Python window in ArcMap or ArcCatalog, however, when I run as a standalone it will cause python.exe stopped working crash once ...
0
votes
0answers
31 views

Assigning correct extent in create constant raster tool in ArcPy?

In my script I am creating a constant raster using the adjusted extent from a another raster (out_point). For my further calculations I need the center of all raster cells laying on integer ...
0
votes
0answers
14 views

Retrieve WMX Database folder using ArcPy?

By using 'WMXAdvancedSettings.exe', the user can modify/change the default Database folder path(jtc-file path). In such case, how can I find the "WMX Database folder path" from current settings by ...
1
vote
1answer
52 views

Updating Z values with geometry of multipart and donut polygons with ArcPy?

I am trying to update Z values of polygon features with point features. The code is (found on GIS Stack Exchange) working good if no 'interor ring' or 'multipart' features are present in the polygon ...
0
votes
1answer
57 views

Grouping wildfires dates by season and getting sum and count using ArcPy?

I am having some trouble creating a new shapefile and CSV to group wildfires into seasons. What I want to do is to group the wildfires by meteorological season (summer, fall, winter and spring) for ...
0
votes
0answers
26 views

Invalid expression in SelectLayerByAttribute?

I am coping with a shapefile and I want to select some rows if the values in one column are in a Python list. The following gives the code I write: tpu_involved = list(set(dataframe['SmallTPU'])) ...
1
vote
1answer
70 views

arcpy.ListFields() displaying numerical field names instead of actual field names

When I use the arcpy.ListFields() command, a bunch of random numbers and letters are returned instead of my actual field names. I created my data set in Excel, used XY Table to Point, and exported it ...
0
votes
2answers
36 views

Selecting multiple attributes with variables using arcpy

I'm working on a program for my work and I'm trying to select multiple power line segments from the same shapefile. I'm having trouble with my SQL syntax to pass both variables on to the selection ...
3
votes
3answers
164 views

Programmatic logic ArcGIS uses to determine added fields from geoprocessing when inputs have duplicate field names

ArcGIS has a confusing method for updating field names when combining tables with duplicate field names. For example, I have two tables containing the field Id. If I run JoinField_management, ...
1
vote
1answer
24 views

Joining feature classes defined in list to dbf tables which defined in another list using ArcPy?

I am trying to join feature classes in a list to tables in another list using a join field which is the same for all joins. In general terms, I want to join the first feature class in the list to the ...
-1
votes
1answer
53 views

Converting script written for ArcGIS Desktop 10.5 in Python 2.7 to be compatible with ArcGIS Pro and Python 3.x? [closed]

I am learning how to convert a script written in Python 2.7 for ArcGIS Desktop 10.5 to Python 3.x so that it is compatible with ArcGIS Pro 2.3. I used Analyze Tools For Pro to check the existing ...
2
votes
0answers
29 views

import arcpy in multiprocessing make script to hang indefinitely

I have a simple script to test multiprocessing with arcpy, but the script hang indefinitely. The problem is with the import arcpy statement that seems to be a problem in the child processes. Other ...
0
votes
1answer
32 views

Exporting toolbox from ArcGIS 10.5 (Python 2.7) to ArcGIS 9.3 (Python 2.5)?

I built an interface using ArcGIS 10.5.0 with Python ver. 2.7, I want to export this toolbox to an other PCs that using ArcGIS 9.3 with Python ver. 2.5. I did it using Toolbox save as but the toolbox ...
1
vote
0answers
14 views

Adding Z value to attribute table of shapefile from DEM? [duplicate]

I have one shape file(polygon) downloaded from freely available sites. I want to add the Z value or height value into it. I have corresponding DEM file. The Z column has come after using the 'Add ...
0
votes
1answer
28 views

Query of five fields using ArcPy in ArcMap?

I am using a long script for doing this query using select by attribute: this is the following code: are there any shorter form to do this?: level1 = arcpy.GetParameterAsText(0) level2 = arcpy....
1
vote
2answers
68 views

Printing error message to console or log file in ArcPy? [closed]

My code is as follows: Essentially, I have one table in my database that is not able to convert into my FGDB. When I run on command line, I am able to get an error message of: WARNING: Failed to ...
1
vote
1answer
28 views

Create Geometric Network Geodatabase Failed

I recently attempted to run the Create Geometric Network Geodatabase tool which is part of a water outage template download and process offered via the ArcGIS Solutions Deployment Tool within ArcGIS ...
0
votes
0answers
27 views

Multiple raster processing with SetNull?

I have two folders containing 5 raster files in each. FolderA="a,b,c,d,e" FolderB="f,g,h,i,j" All files are in .tiff format. The raster datasets in Folder A have valid range from -1 to 1 and those ...
0
votes
0answers
29 views

Using ArcPy 'Make NetCDF Raster Layer' tool for netCDF files composed of various sub-groups?

I have some netCDF data that I have been trying to import into ArcMap with ArcPy using the Make NetCDF Raster Layer tool. This should be straightforward, except I believe the structure of my NC files ...
2
votes
0answers
35 views

Speed up ArcPy CopyRows_management process on large feature layer?

I am attempting to automate an ArcMap process with Python and I am having difficulty with a particular part of a process taking too long when performed on larger datasets. The process is as follows: ...
1
vote
2answers
83 views

Finding number of days per ID in table using ArcPy?

I need to count the span of days an individual has been observed, from the first til the last observation day. There can be many observations per ID per day and not everyday has observations, hence ...
0
votes
0answers
28 views

Creating Vector Tile Package from basemap with ArcPy?

I am trying to create a vector tile package from a basemap with arcpy, but get the using arcpy.management.CreateVectorTilePackage() causes me an ERROR 001856: Cached scale doesn't match tiling scheme. ...
0
votes
1answer
32 views

Updating layer definition query using ArcPy? [closed]

I'm using ArcPy for some automation and I need to update the layer definition query multiple times while running the same script. I've only been able to find ways to update the layer definition ...
0
votes
0answers
29 views

MakeTableView of Excel spreadsheet tab gives ERROR 000732?

I have a very simple model built using Modelbuilder that takes a tab of an Excel spreadsheet and converts it using Make Table view. This works fine in ModelBuilder. I then export the model to Python ...
1
vote
1answer
19 views

Iterating through table for IDW says parameters are not valid?

I have a table with precipitation data from 5 weather stations and I am trying to iterate through the table to perform IDW on each field (month of precipitation). import arcpy from arcpy import env ...
0
votes
1answer
40 views

Updating z value of geometry using updateCursor?

I am trying to update the Z value of a polygon using update Cursor and it just doesn't work! I have been exploring this site and trying different codes without success. I have a shapefile with ...
0
votes
1answer
48 views

Removing duplicate values within rows using ArcPy?

How can I remove duplicate values within a text field using ArcPy? The following example shows a list of numbers for each row in a featureclass, some with duplicate numbers. I am aware of ...
2
votes
1answer
42 views

Setting up ArcPy virtual environment with Pandas?

Do I need to bounce back and forth between two virtual environments in order to run Pandas and ArcPy in the same script, while ensuring Pandas (or accidental updates to NumPy) doesn't break Arcpy? I'...
2
votes
1answer
46 views

Creating and calling virtual environment to run ArcPy script?

I'm getting a new computer and am trying to set up my virtual environments the right way. In the past, I've just been using PyCharm and running everything through "C:\Python27\ArcGIS10.6" so it's a ...
3
votes
0answers
55 views

Arcpy 'Append_management' much slower than ArcMap Tool?

Basically I have a script that grabs data from a web service, parses it, stores it in an intermediary local fgdb, then appends that data to the feature class in the enterprise gdb. The portion of the ...
4
votes
1answer
60 views

Limiting Input Parameter to only File Geodatbase in Python Toolbox?

I've been working with ESRI Python toolboxes for a while but I'm still having difficulties setting an input parameter as a "DEWorkspace" and using the parameter filter to make it so only file ...
2
votes
1answer
31 views

Finding documentation for changes to syntax/parameters of ArcPy tools/functions in ArcGIS Pro? [duplicate]

In a Q&A on this site I recall @KHibma pointing out where in the ArcGIS Pro Help any changes to the syntax (like extra parameters) of a particular tool/function since ArcGIS Pro 1.0.0 could be ...
0
votes
1answer
25 views

Getting RunTime Error: Object: CreateObject cannot create geometry from inputs when trying to add a polyline using an insert cursor

The objective for this code is to take a csv that contains rhino observations and create a polyline shapefile for the data. The shapefile needs to have the paths the rhinos take based on observations (...