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.

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 ...
5
votes
2answers
77 views

Table to Table converting ArcMap table to CSV file in external location cuts column names short?

I am having a strange problem with the ArcPy Table to Table function. For some reason, when I use the function to create a CSV file in a folder that exists outside of my python project folder, several ...
0
votes
0answers
18 views

export pymssql query to geodatabase table

I have thousands of databases in Microsoft SQL Server and I want the user to select the server and DB they want so I cannot use arcpy.ArcSDESQLExecute I am trying to use pymssql to connect to the ...
0
votes
0answers
24 views

Split/Cut polygons within feature classes based on a polygon mask

I am looking for a way to split features based on a mask. The end goal is the deleting of the features within the mask, without creating an output. The polygons are bigger than my intented mask, but ...
1
vote
1answer
27 views

Running convert Raster to Point Features in arcpy returns an error

I'm trying to convert a bunch of rasters to point features to further build a regression of those. Is it possible to do that without a conversion using arcpy? If not what am I doing wrong converting? ...
0
votes
0answers
18 views

Selecting not null row in field using ArcPy? [closed]

I have gdb in which multiple feature classes. But featureid field is common. How do I select features where featureid field is not null in multiple feature classes?
0
votes
1answer
27 views

error on arcpy.FeatureSet() load from feature service: cannot open table for load

I am trying to pull data from a feature service into a feature set, and the following was working perfect: fsURL = baseURL + query fs = arcpy.FeatureSet() fs.load(fsURL) but all of a sudden, this ...
0
votes
0answers
20 views

Converting string 24hr date/time field values into new field with just 12hr time as string using ArcPy in ArcGIS Pro?

Without explaining all my reasoning for why we need to do this, I need to take a field that our GPS units create called "CreationDateandTime" and use the values in there to create a new "UID" field ...
1
vote
1answer
45 views

Getting for loop which stops after first one to iterate properly?

I originally asked UpdateCursor can't acquire lock, but can acquire lock in TestSchemaLock and got some help about why my code wasn't acquiring a lock. My new problem is that my code isn't fully ...
0
votes
1answer
37 views

Measuring distance to two Points in ArcPy?

I would like to know how to measure the distance from two Points in ArcPy? I know only Geometry has the distanceTo method but how do I could make a typecast in ArcPy? I got the following error ...
0
votes
0answers
26 views

Replacing a feature class in a work version, or emptying it\Splitting features by mask?

I am working in a versioned database, in a specific feature class. After changes are made to this feature class (a copy outside of the versioned geodatabase) I want to be able to "update" the named ...
0
votes
1answer
57 views

For loop can not find the next raster object in the geodatabase. OSError: “” does not exist

I'm trying to convert a list of rasters in a geodatabase to integer type and rename them with a specific folder name as the prefix. This first block of code moves the ASCII rasters into the ...
0
votes
1answer
10 views

Invalid Primary Key error message when attempting to join table view and feature layer

I am attempting to join a feature layer to a table view in order to export a table of all non-joining features in the table view by selecting NULLS from the join field related to the feature layer. ...
2
votes
1answer
45 views

Rotating polygons by azimuth from attribute table using ArcPy [closed]

I want to rotate some polygons according to the value of azimuth from attribute table. I try to use this code but there is an error that I can not understand. CODE import arcpy, math fc = 'Polygons'...
-1
votes
1answer
43 views

Finding polygons that overlap other polygons within same layer using ArcPy? [duplicate]

I have a shapefile containing polygons. I would like to select all polygons within the layer that overlap with other polygons within the same layer. The closest I have gotten is the Intersect tool ...
-1
votes
0answers
29 views

Reading mxd file in Python using ArcGIS Pro trial version? [closed]

I have installed ArcGIS Pro trial version and I am able to open mxd files in ArcGIS Pro. I tried to open the same via Python but it is not working means some of them are part of ArcMap, not with ...
1
vote
1answer
35 views

Arcpy CopyRows writes only a fraction of MakeQueryLayer results

I have a query running against an Oracle non-spatial database that returns thousands of records, but when I run CopyRows against that query only 24 rows are carried over! What the heck is going on? I'...
0
votes
1answer
22 views

Read integer field as a string for list comprehension in arcpy

I have a script that is used to update a line feature class with the start and end elevations based off of a shared ID number with a point feature class using list comprehension in arcpy. However I ...
0
votes
1answer
22 views

Reading raster in Python to Clip USGS 3DEM?

I want to clip the elevation data (3DEM) downloaded from USGS website. The raster-clip tool "Clip (data management)" in ArcGIS Pro works very well. However, I cannot clip it using the python function "...
0
votes
0answers
34 views

Select Analysis Invalid Expression

I am attempting to select nulls from an in_memory feature layer using Arcpy's Select_analysis. Code example below, as well as, various iterations of attempts to alter the SQL query with no success. ...
0
votes
1answer
28 views

When iterating through TOC and erasing using ArcPy parameters are not valid?

I am trying to Iterate through my TOC and "Erase" part of the feature layers by using a predefined mask. However I keep getting an error that tells me the "Mask" is either not supported, or does not ...
1
vote
1answer
61 views

How to replicate a polygon over several points with different locations in Arcgis? [closed]

I have two shapefiles, one is a polygon and the other is points. I would like to create a new shapefile which has the shape of the polygon in all the places that there is points. I would like to ...
0
votes
1answer
41 views

Comparing Two Tables Using Arcpy

I'm trying to check the "fiberEquipment" table against the "material_cd" table and find instances where there are discrepancies. E.G -- Checking that "material_cd" 10785823 in "fiberEquipment" has all ...
2
votes
2answers
49 views

Locking stand alone ArcGIS Tool?

I have written a number of standalone Tools for ArcMap. These tools are all .py files and are run outside of ArcMap. At the moment it has only been me running these tools, but I have been asked to ...
0
votes
1answer
31 views

Open and save an .mxd with ModelBuilder

I am looking for a way to automatically save and open an .mxd file, be in in ModelBuilder (with ArcMap tools) or Arcpy, but I can't find any functions to support this. I basically want to save the ....
0
votes
1answer
29 views

Selecting records by SQL Query and saving SUM or COUNT result into differnt table

I am trying to create a python toolbox with the following function: I want to select points or lines within a polygon and save the selected feautres as a temporarily Feature. (That works) Then I want ...
1
vote
0answers
21 views

TableToTable_conversion using PostgreSQL and ArcPy

Currently, I am trying to convert a geodb to a table in my PostgreSQL db with arcpy as such. I've tried both with the parcels table being created and the parcels table not being created arcpy....
1
vote
0answers
35 views

Avoiding or reducing invalid geometries when geoprocessing in ArcGIS Desktop? [closed]

I use geoprocessing with large polygon datasets using ArcPy. I use Multipart_to_Singelpart and Repair_Geometry to remove all invalid geometries, prior using the tools like Union or Intersect. ...
1
vote
1answer
48 views

Need to convert feature classes regularly deleting/overwriting existing shapefiles and breaking the script to terminate

I know a little Python/arcpy, enough to barely get me by. My goal was to, on a regular task schedule, convert feature classes to shapefiles and overwrite existing shapefiles, but I realized that arcpy....
1
vote
0answers
24 views

Checking Shapefile type (Point, Line, Polygon) in ModelBuilder using python script?

I am creating a model and would like the input to branch off to different tools within the model based on the shapefile type (point, line, polygon). I haven't found a tool in ModelBuilder that will do ...
2
votes
1answer
56 views

Pivot Table - flatten multiple fields

I'm trying to flatten a table, but I want to keep/relate certain fields tied to each other. For context, I ran a Generate Near Table to try to find the traffic volumes near intersections. I am trying ...
1
vote
0answers
21 views

Set picture marker symbol for a layer with arcpy - ArcGIS Pro 2.2.4 & ArcGIS 10.6 [closed]

A little UP about the question in the title. I found yet this question on a topic : Set picture marker symbol for a layer with arcpy (ArcGIS) And my question is the same. My purpose is about how to ...
0
votes
1answer
26 views

Selection by attribute from list

I need to select a layer with all attributes while the selection comes from a table. With my code I get only empty feature classes and emtey Excel files. The tab_list Elements are the selection value. ...
1
vote
1answer
30 views

Classifying quantiles in raster dataset with ArcPy?

I am trying to write a Python script which uses the reclassify function in ArcPy to create 9 classes in a raster file. I want to use the quantile method to create the breaks, but so far, I can't seem ...
0
votes
1answer
28 views

Arcpy way to access underlying feature classes contained in a web map

I am building a stand alone arcpy script, and need to connect to the specific feature classes within a published web map, query/copy from those feature classes, then after some processing update those ...
1
vote
1answer
28 views

Merging feature classes in memory gives ERROR 001156?

arcpy.AddField_management("in_memory/originalfc","ALPHABET","TEXT",1) arcpy.Select_analysis("in_memory/originalfc","in_memory/A","attr<=0") arcpy.CalculateField_management("in_memory/A","ALPHABET",'...
2
votes
1answer
43 views

Updating vertices Z in polyline from points

I'm trying to snap a line's vertices to several points in height. The XY have already been snaped, but the snap tool doesn't seem to get the Z value. There is one vertex for each point. Is there a way ...
0
votes
1answer
19 views

Value Error from arcpy.getLayerExtent

The objective of the following code is to pan the main map to the definition queried point and then zoom or pan the vicinity map to the county the point is contained in. I have working code for other ...
1
vote
0answers
16 views

Polygon Clip While mainting Ratio Policy

In my project, I am using drivetime polygons to clip block group data to get the population in that drive time. The drive time shapefile I am testing on has 5 polygons. I want to update the population ...
3
votes
1answer
43 views

Using ArcPy to write feature class name to field in GDB?

I have a file GDB living in a network directory with 17 or 18 feature classes. I already created a field I want to populate with the file name of the feature class. Whenever I run my code, it ...
2
votes
1answer
77 views

Extracting projection from each LAS file in directory using ArcPy?

I am using ArcPy to automate the conversion of LAS files to Raster in ArcGIS. I'd like to extract the spatial reference from each LAS file along the way. Is it possible to do this using ArcPy tools?...
1
vote
1answer
61 views

Rotating polygons by value from attribute table using ArcPy?

I have 60 polygons saved in one shp file. Is there a way to rotate them by the angle value stored in the attribute table? I know how to do it manually; I am looking for more automated way (Every ...
0
votes
0answers
30 views

Calculating sequential numbers into sorted table not dependent on OBJECTID? [duplicate]

I am having a problem with adding sequential numbers to the new column based on other sorted value. I would like to use 'Sort by' column to be able to generate numbers in the 'Required number'column. ...
3
votes
3answers
90 views

Comparing value with value from the next row

I have a table with two elements in this format: a b b a b c c b c d ....f g g f I have to analize if the second element is equal to the first element of the following row. If it's true, 1 is ...
0
votes
1answer
24 views

UpdateCursor cannot see new field added to feature class

I needed to add a new field to a feature class to act as a unique key, but when I run: fields = ['OID@', 'state', 'navkey'] ids = inspected_points #list of oid values oidfield = arcpy.Describe(points)...
2
votes
1answer
39 views

What is happening different to my TIFF between export data and arcpy

I am working in FME with TIFFs downloaded from sentinel-1 (SAR). These TIFFs display correctly in ArcMap but in FME is loses its spatial reference and a bound box calculation gives the number of ...
0
votes
2answers
41 views

Arcpy - Python script select many values from attribute table raster

I run this simple script, line-by-line, and I get the error Runtime error SyntaxError: can't assign to literal (, line 1) What am I doing wrong? import arcpy # Set workspace arcpy.env.workspace = ...