Stack Exchange Network

Stack Exchange network consists of 174 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
11 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
6 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
18 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
0answers
21 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
12 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
8 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
17 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
24 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
40 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
33 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
14 views

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

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
21 views

Parsing Value Table for Python buffer tool? [on hold]

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
13 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
68 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
29 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
22 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
11 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
30 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
39 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
33 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
36 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
32 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
16 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
37 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
43 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
58 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
36 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
43 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 ...
0
votes
1answer
23 views

Update attributes with arcpy.updateCursor and updateRow

I need to update attributes with arcpy.updateCursor and updateRow based on a list of service numbers, but I can't even get one row to update. This is my beginner code. df= r"GAS FEATURES\SERVICE ...
2
votes
1answer
38 views

How to use SQL queries in arcpy.SelectLayerByAttribute?

I'm trying to select features from a layer that I know exist. I'm using SelectLayerByAttribute_management in arcpy. I have a layer that is properly defined earlier in the code named "tourmaline". I'm ...
4
votes
2answers
53 views

Identify and delete all unrequired fields from Shapefile using ArcPy

I have some Shapefiles inside one Folder and for the sake of data compression I want to delete all fields from Table of Content that can be removed (that are not required)! What I have: What I ...
1
vote
1answer
18 views

Using RemoveLayer in arcpy.mapping?

I am trying to use RemoveLayer within the mapping module, but seem to be getting mixed results. I do the following to add a layer to the map mxd = arcpy.mapping.MapDocument("CURRENT") # define map ...
0
votes
0answers
29 views

Using ArcPy to extract certain data to Excel? [closed]

I have very little experience with ArcPy or coding but i was wondering if there is a way to use ArcPy to select a point features within a polygon and extract the data that is in the fields into a ...
2
votes
2answers
28 views

Calculate field does not update using ArcPy

I want assign 33 if the field no_apt is zero and 34 if no_apt is any else value. The model run without any error, but no value are assigned the field GGV_kW. What is wrong with the code since it doesn'...
1
vote
2answers
32 views

Converting DXF file to shapefile by exporting only certain fields using ArcPy?

I have a problem converting multiple DXF files into shapefiles. In particular I use the script that is shown below for conveying multiple files. But the output shapefile is very large due to the ...
0
votes
1answer
13 views

Getting SyntaxError from Coordinate Transformation (points) with ArcPy?

I'm trying to do a coordinate transformation for points with ArcPy in ArcGIS Pro by using x and y coordinates as Input. I tried the following: import arcpy inputSRS = arcpy.SpatialReference(31467) ...
0
votes
0answers
15 views

Extracting map properties (extent, metadata, coordinate system, transformation) using arcpy.mp? [duplicate]

I am trying to fetch map properties using arcpy.mp (since I am using ArcGIS Pro trial version) from mxd files. I am able to get the extent info for individual layers but not for the dataframe. ...
1
vote
0answers
21 views

Merge dbf files from different folders in Python or Arcpy

I am new to Python. I have over one hundred dbf files to merge in two diffrent workspaces. Workspace 1: PCPT100100 PCPT101101 PCPT102101 Workspace 2: s100100 PCPT101101 s102101 I want to merge "...
0
votes
0answers
20 views

GDAL 202-1500 driver plugin missing

I have a machine setup with Windows 10, ArcGIS 10.2.1 and Python 2.7 from ArcGIS. I installed GDAL according to cartometric. The gdal-202-1500-core.msi and then gdal-202-1500-filegdb.msi. With Python,...
4
votes
1answer
40 views

Separating points with identical coordinates using ArcPy?

I need to move apart points with identical coordinates. I have a point layer where there can be as high as 4 points on each other (same coordinate). I want to separate these points from each other (...
1
vote
1answer
20 views

Extracting values from array created with FeatureClassToNumPyArray and converted to DataFrame?

I cannot understand how to use the values in the arrays created with arcpy.FeaturesToNumPyArray. I want to create an array and then convert them to a pandas DataFrame. So I created an array from ...
1
vote
0answers
33 views

arcpy.SummarizeWithin_analysis error: error in executing tool

I am trying to identify and sum the lengths of line segments within a polygon boundary using the arcpy tool: arcpy.SummarizeWithin_analysis('my_gdb.DBO.gridzones', 'my_gdb.DBO.lines', 'my_gdb....
0
votes
1answer
34 views

Associating Inset Map with Layer using ArcPy?

I'd like to only display an inset map, inset map scale bar, frame and leader if an associated layer is displayed. Similar to Associate Point Layer, Annotation Group and Line Layer in Map Legend but ...