Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [arcpy]

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

0
votes
0answers
5 views

Compact_management making spatial index invalid? [on hold]

I am compacting file geodatabases and afterward I am having trouble drawing lines linger than about 12000 feet without getting "Invalid Spatial Index". The Esri documentation does not say anything ...
0
votes
1answer
13 views

Error 999998 Saving Raster with Arcpy

To start, I found a similar question posted on stack exchange here, but I am not using the zonal statistics tool, which the answer to that question is based on. With that out of the way, I'm ...
1
vote
2answers
24 views

Copying shapefile to Feature Dataset using ArcPy?

How do I copy a shapefile to a Feature Dataset? Here is is my script. import arcpy import os arcpy.env.workspace = "C:/temp" dataset1 = "C:/SDE.gdb/temp1" arcpy.CopyFeatures_management("scrap....
0
votes
1answer
31 views

arcpy.Rename_management() returning ERROR 999999 and [Errno 13]

I have a function where I am trying to rename a geodatabase, both os.rename and arcpy.Rename_management() work in the Python window but not in the Script when run as a tool through ArcCatalog. ...
1
vote
0answers
16 views

ArcGIS Python Add-In Extension - how to make it immediately functional after install?

I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant ...
1
vote
1answer
23 views

If Statements in ArcPy Select Feature SQL Query

I'm trying to select pipes with specific codes. These codes are 8 digits long and I only need to select certain combinations. For example, pipes that have codes with the number 8 in the 7th position ...
3
votes
0answers
44 views

ArcPy Memory issue re-using dictionary?

Before I start I should mention that before this I have never worked in Python before. I am trying to process a large fc to fc update, 3 million plus rows with 70 columns. I tried using updatecursor ...
0
votes
0answers
15 views

Select DDPages before exporting

I have script for exporting separate data driven pages (script tool in a toolbox). import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pageNumbers = [4,7,11] #select pages before exporting ...
0
votes
0answers
19 views

GIS Shapefile to CAD dwg using arcpy [on hold]

I'm trying to convert a ArcGIS shapefile to CAD dwg format using arcpy But having trouble with my code Anyone done anything similar ?
0
votes
0answers
38 views

Script sometimes stuck at arcpy.SplitRaster_management

my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management. import arcpy import os #nearly 700 rows of script fclist: [ ...] # some fc rasterlist = [...] # many raster ...
0
votes
1answer
17 views

Projects feature with attachments from one coordinate system to another

I'm trying to projects a feature with attachments from one coordinate system to another without loosing the attachments. I'm using the GeoTagged Photos To Points function to create a point feature ...
1
vote
1answer
38 views

Accessing Home directory of ArcMap using ArcPy?

I want to access to a directory and set that as a arcpy.env.workspace in my Python Script Tool. However, this workspace depends on users so I cannot just use my own folders. Is there a way to access ...
1
vote
1answer
33 views

Collections.DefaultDict(list) : Why is my data a string?

While creating a defaultdict(list) containing street names, x and y coordinates, my x and y entries are converted to strings. This prevents me from doing calculations on them. I've been looking around ...
0
votes
1answer
23 views

arcpy.da.SearchCursor storing data in a list with a query

I am currently working with a database that hold street names, x and y coordinates and many more fields. I would like, through a search cursor, to store the x,y coordinates in a separate list for ...
0
votes
0answers
26 views

ArcGIS 10.5 Python script integration to 'script/tool' not outputting data

In ArcGIS 10.5 I have a python script that works well in the python window, however, I am trying to integrate it in a tool, mainly to make use of the arcpy.GetParametersAsText() input feature for the ...
0
votes
0answers
18 views

Updating field in attribute table based on values in another field [on hold]

I am working in Visual Studio to create script tools that will run in ArcGIS Pro. I am trying to populate a newly created field (Field2) in an attribute table based on the values from another field (...
0
votes
0answers
12 views

Using Python / ArcPy to activate feature in one of ArcMap toolbars?

I'm writing a basic python script that will change a definition query and export. That is simple enough, but I would like to also add these arrows that only show up when you manually check a box ...
1
vote
1answer
21 views

Naming exported features from attribute information?

I am new to Python and in the process of learning. As a self test I am trying to export all of the municipalities of a single county feature layer as their own feature layers. I am trying to name each ...
1
vote
1answer
28 views

ArcPy progessor not progressing?

I have a script too that works fine, but the progressor is not counting up at all (staying at "0%") when I run my tool, even though I can confirm it is working - I can see the products of the script ...
0
votes
0answers
13 views

Initiating Edit Session when opening Python Toolbox?

I initially posted a question regarding the use of the GpFeatureRecordSetLayer Parameter in a Python Toolbox I am creating. Original Question: Using GPFeatureRecordSetLayer in Python Toolbox for ...
0
votes
0answers
9 views

Creation of multiple Referenced Mosaic Datasets with different names and coordinate systems

I am trying to create multiple Referenced Mosaic Datasets with different names and coordinate systems based on 1 source mosaic dataset. My code is as follows: # test referenced mosaic dataset ...
0
votes
0answers
19 views

Selecting layer by attribute in Python Toolbox of ArcPy?

I have this code where te input parameters are a shapefile [param0] and a string list [param1]. The second parameter is a list because I want that user select it. class Tool(object): def __init__(...
0
votes
0answers
30 views

Installing pip on ArcGIS Python Installation?

I have a problem installing pip on my Windows Server 2016 on ArcGIS 10.2 Python installation. Actually, I want to install requests package and I want to install it through pip. I have downloaded get-...
3
votes
2answers
41 views

ArcPy UpdateCursor deleting duplicate records?

I am working with .dbf files. I have two columns of data that have duplicates. A column of parcel numbers with duplicates and a column of letters that are duplicated. I want to delete all parcel ...
0
votes
1answer
36 views

Loop through a range of rasters and use tool output as input for the next tool run

I'm using the particle track tool and limiting it to a specific trackingtime. For each tool run, I want the rasters input (magnitude and direction) to change to the next rasters in the lists, and the ...
0
votes
1answer
15 views

Simulating navigation bar in attribute table of ArcMap using ArcPy? [closed]

I want to focus on specific record in the attribute table when it is open. I have made several experiments with SearchCursor but that just selects the record, even focusing on the feature on the map ...
0
votes
0answers
24 views

Parsing Value Table for Python buffer tool? [closed]

I'm creating a tool and the type of one of the parameters I'm using is a value table. I'm having issues with the Notes field (type string). Users will want to possibly add sentences to that field ...
1
vote
0answers
9 views

Snap pour points not recognizing sample sites as valid points when using ArcPy?

I am trying to go from a CSV of sample sites and a DEM to creating watersheds. I can process the DEM fine to stream networks and can import the points (first to event layer, then convert them to a ...
1
vote
0answers
15 views

How to fix error 000840 the value is not a raster dataset for Mosaic?

I'm trying to to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second raster to mosaic ...
1
vote
4answers
69 views

Retrieve last Row and specific field values with SearchCursor

I have a shapefile from which I want to retrieve the last row values for specific fields to use them as input in a tool. So far this is what I have which does not work. length=int(arcpy....
2
votes
0answers
30 views

Removing extra dots when loading Python script

This is probably a silly question, but I'm having a problem whenever I load a Python script in ArcMap where extra dots are loaded with the script (see below) that I must manually delete prior to ...
2
votes
0answers
29 views

Check Geometry - Bad Envelope

I have a polygon feature which returns Bad envelope when run through the Check Geometry tool. According to the help: Bad envelope : The envelope does not match the coordinate extent of the ...
0
votes
0answers
15 views

Performing iterative Mosaic in ArcPy?

I'm attempting to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second and third raster ...
0
votes
1answer
23 views

Copy Table Failing with ERROR 000732 in ArcPy?

Very new to Python. I am trying to copy between Feature Datasets, Feature Classes, and Tables between two GDBs. Here's my code: The following attempt works when Irfan_FC is a feature class: #Copy ...
0
votes
1answer
13 views

Changing thickness of lines in GraduatedColorsSymbology using arcpy

I have been using the following code (works) to update the symbology of a layer in ArcGIS. Now, in addition to this, i need to change the thickness of the lines previously symbolized by using ...
1
vote
1answer
31 views

Using Data Driven Page Extents for 2 data frames in ArcPy?

I have an MXD with two data frames. I want to use Data Driven Pages (DDP) to export this to PDF but have the second of the data frames be one extent ahead. I have the following script to export the ...
1
vote
1answer
40 views

Is Geometry object intersect faster than Intersect_analysis in ArcPy?

I have a script attempting to identify Many-to-Many matches between two different parcel layers. It is an iterative process, during which I dissolve the selected polygons in layers A and B, intersect ...
0
votes
2answers
36 views

Adding row with default values to new created table with ArcPy?

In my code I am creating a table with some fields. The fields should be filled with 0 (Datatype of the fields are LONG or DOUBLE). I want to fill them because afterwards I want to update the values. ...
0
votes
1answer
34 views

Using ModelBuilder to Create Python Script for xls to csv Conversion?

I am currently trying to create a python script within ModelBuilder to convert an xls file to csv. I created one already using the "Table to CSV" tool which was successful. However, I tried to add ...
3
votes
0answers
29 views

Sampling list of rasters in ArcPy?

I've been trying several times to sample (Sample tool from Spatial Analysis ArcGis 10.5.1) a list of rasters to a location sample (also in raster format .tif). Here's the code I've been using, and ...
1
vote
2answers
37 views

arcpy.da.InsertCursor generating empty polygons?

I am using this script to copy some features from an input featureclass into an output featureclass. This works for points but surprisingly not for polygons. For polygons it is generating features ...
2
votes
1answer
35 views

Check 2 Extents with Disjoint in Arcpy - Wrong Result

I'm now facing a problem using Disjoint in Arcpy to check if 2 extents are intersected. I have 2 extents like this: Ext1: 33206887.500051 5890587.49999999 33460887.500051 6060887.49999999 NaN NaN ...
0
votes
0answers
17 views

How to add rules to the topology from a .rul in ArcPy

I am trying to create a new topology using and ArcPy script and I have a lot of rules inside a .rul archive. The function to do that is: arcpy.AddRuleToTopology_management(out_topo, rule_type, in_fc1,...
0
votes
2answers
41 views

Getting error 000732 when running python script

I created a tool for a team, which worked perfectly. Once I started changing the directories of where things are saved it stopped working. I keep getting error 000732 for my code. I think it's because ...
1
vote
2answers
58 views

Getting Erase ExecuteError 999999?

I've made an arcpy script which worked last week, but I placed it somewhere different on my computer. I've made sure all the source files etc. are connected. However now I keep getting an error ...
4
votes
1answer
46 views

Object error while running arcpy.CreateFileGDB_management() outside of ArcGIS Pro

I have a script that starts by creating a FileGDB by calling arcpy.CreateFileGDB_management. It runs without error on my own laptop, but raises an error when my colleagues try to run it outside of ...
1
vote
1answer
61 views

Changing data source file path?

I have little experience in scripting and I'm looking for a more efficient way to replace the source file path of over 1000 shape files. Is there a way I can do this without manually changing each ...
1
vote
1answer
38 views

Using ArcObjects in ArcPy to change map grids in Data Driven Pages

I'm a newcomer to Python and have been working on using ArcPy scripts to automate Data Driven Pages in ArcGIS. I would like some help please to use ArcObjects in ArcPy and change map grids in DDP with ...
1
vote
1answer
44 views

Using data from SQL Table instead of File Geodatabase Table

Does anyone know of a method to use the table from SQL Server table using OS Authentication, instead of a File Geodatabase Table in ArcPy? I have been using the below to reference the table ...
1
vote
0answers
25 views

Using ArcPy to select polygons one by one and export them? [closed]

I want to select polygons in a (double field type) and export them, and I keep getting this error: ExecuteError: ERROR 000358: Invalid expression "dobule" = '1' Failed to execute (Select). This ...