A site-package created by Esri to expose many ArcObjects to Python.

learn more… | top users | synonyms (1)

0
votes
2answers
19 views

Iterating list returned by arcpy.ListFeatureClasses() gives error 'NoneType' object is not iterable?

I have the following code, where i write from a list of featureclasses the fisrt row of 2 specific fields to a text file. But when i run it either erases all the previous stored data from text or ...
3
votes
1answer
200 views

Debugging TypeError: SearchCursor() got unexpected keyword argument in ArcPy script?

I tried to use SearchCursor(points, fields=fieldname) but I get this error: TypeError: SearchCursor() got an unexpected keyword argument 'fields' I'm not sure why this doesn't work. # Local ...
1
vote
1answer
710 views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...
4
votes
1answer
149 views

How to create list from spatial join table using ArcGIS Desktop and ArcPy?

I have performed a spatial join on some data and now I would like to take that data and create a list. I'm trying to do this dynamically so that it can be easily repeatable via a script or model. I ...
1
vote
0answers
16 views

Are there any Python scripts are available for Hydrology to compute watershed Basin from csv file?

Let's say I have surface data available in CSV format (x,y,z). In order to create a watershed basin from surface data, there are some intermediate steps we need to follow. ASCII to surface raster ...
1
vote
1answer
14 views

Python script to accumulate flow volumes for a pipeline geometric network

I have a point wells layer and a polyline pipeline layer. The wells are snapped to the end of the pipeline segments. The wells layer has weekly updated flow volumes and I'd like to find a way to ...
0
votes
1answer
26 views

Error using UpdateCursor to copy a GlobalID field

I am trying to use an Update Cursor to copy a GlobalID field into a string field. However, I keep getting an error saying "Objects in this class cannot be updated outside an edit session [Medians]". ...
1
vote
2answers
42 views

Arcpy: how to use lists but have differing spatial ref depending on input file?

This is my first arcpy script attempting to use lists. Input: 4 dif Excel files, each with a dif spatial reference Output: 4 dif feature classes (in same geodatabase), each with original spatial ...
0
votes
1answer
14 views

MERGE/ COMBINE two ADJACENT CONTOUR-LINES with Python

I am a python begginer; I found a script that "BARBOSSA" posted in the "blog" ( Append or merge consecutive line segments (contours) as one single line of the same elevation value) I am trying to use ...
1
vote
0answers
28 views

Intermittent exceptions in CopyRows_management

Occasionally, but frequently enough to be a pain, my script throws an error. The script runs fine most of the time but when it fails, I get this: Traceback (most recent call last): File "XXX.py", ...
2
votes
1answer
26 views

problems overwriting files in ArcSDE with python script

I'm having a great deal of difficulty overwriting files when using ArcSDE. The usual 'arcpy.env.overwriteOutput' method doesn't seem to work. When I run this script: import arcpy from arcpy import ...
0
votes
0answers
32 views

Checking for overlaps using python

Trying to write a code where python checks for overlapping polygons within a file geodatabase in the current mxd and basically prints the feature class names overlapping. Here is what i have: import ...
4
votes
3answers
5k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
2
votes
1answer
52 views

ArcSDE reconcile versions and keep edit version in its current state

Reconciling versions makes both target and source(s) point to the same state. I have an arcpy script that essentially will create a version from a parent of the db - in a state that is empty - adds ...
1
vote
0answers
21 views

Clipping Feature Classes by Data View Extents with ArcPy?

Have a fully functional script about 90% of the time. It is that 10% that is really bothering me and I cannot seem to deduce a solution. Script will take the user defined dataframe view extents and ...
0
votes
2answers
43 views

Repair/Check for empty geometry in ArcSDE?

I understand that the standard validation/repair tools are not for use with ArcSDE and that ESRI needs to fix this, but are there work-arounds for at least checking where there might be empty geometry ...
-4
votes
1answer
57 views

Python script working incorrectly?

i am writing script which uses different Tools of arcgis and implementing different functionalities .. My script consists in different Functions running in an order. Each function is connected to ...
1
vote
3answers
35 views

ArcPy merge using a list from GetParameterAsText

I am pretty new to ArcPy so bear with me. I am having a hard time understanding how to feed a list of FCs from a "GetParameterAsText" into something like the merge tool. I have my GetParamterAsText ...
0
votes
0answers
24 views

How to add multiple feature classes from gdb to mxd using ArcPy? [duplicate]

I'm using ArcGIS 10.2 and I am trying to to add multiple feature classes (eg. c101ppt, c102ppt, c103ppt... [name end with ppt] from a geodatabase to a mxd. The name of feature layer need to be the ...
0
votes
2answers
60 views

Troubleshooting ERROR 000814: Invalid file type from arcpy.TableToExcel()?

I wrote the script below to iterate through a file geodatabase's feature classes and convert them to an excel table. However, it returns the error ExecuteError: Failed to execute. Parameters are not ...
1
vote
0answers
23 views

Update Data Driven Pages Index layer via Python

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
1
vote
1answer
18 views

Accessing bands in .pix (PCIDSK) file in python/arcpy

I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format. I have things working great with a tiff file. I am able to access the bands using this code: desc = ...
1
vote
1answer
17 views

Changing Mosaic Dataset Properties in Map Document using ArcPy?

Does anyone know if it is possible in ArcGIS 10.3 for Desktop to access and change mosaic dataset properties within a map document using ArcPy? I am trying to write text into the symbology ...
0
votes
0answers
10 views

How to call the Manage Map Cache Tiles tool hosted by default in the system folder of arcgis server. I am getting ERROR 001428

When I am trying to call the GP tool Manage map service cache tiles that is hosted on the arcgis server by default in the system folder, I am geeting the followning error: ERROR 001428 Failed to ...
0
votes
0answers
21 views

Checking if Terrain Model has pyramids or data sources using ArcPy/Python?

I asked this question in the Esri forums and got nothing but a lesson on LAS point cloud classifications—not even remotely what I had asked. I’m hoping someone here can point me in the right ...
1
vote
1answer
42 views

CSV to ArcGIS table, insufficient text field length

I currently use arcpy.TableToTable_conversion in order to convert a CSV file into an ArcGIS file geodatabase table. This works when string length is less than or equal to 255 characters. Whenever 255 ...
-1
votes
0answers
8 views

Add feature class from different geoodatabase to a single mxd [duplicate]

I need to add multiple feature class from different geoodatabase to a mxd and then change to same colour and making a definition query to it. The naming of all feature class are end with ppt. Is ...
6
votes
3answers
708 views

Zero filling attributes using ArcPy/Python?

I am just learning python and I need to convert a 2 digit numeric attribute in a table to a 2 digit zero-filled attribute in a script. For example, 9 needs to be 09.
3
votes
2answers
1k views

Constructing file path within Python for Feature Class within Feature Dataset?

Based on my understanding of the ArcGIS path structure, a feature class inside a feature dataset inside a geodatabase can be accessed by the following: C:\Menu\Lunch.gdb\Sandwich\Cheese Where ...
0
votes
0answers
24 views

Select Visible Rasters (Mosaic Datasets) using ArcPy?

I am wondering if anyone knows if there is arcpy functionality available in ArcGIS 10.3 or can be coded easily to replicate the select visible rasters command (manually right clicking on a Mosaic ...
1
vote
0answers
42 views

Automating creation of ServiceDefinition from Python toolbox of ArcPy without broken project data source?

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
0
votes
1answer
22 views

Zonal Statistics as Table output is missing some polygons ONLY when run from Python script

I have a raster file from which I am attempting to calculate mean values for polygons defined in a shapefile. Using the Zonal Statistics as Table tool from within ArcGIS works great. My shapefile ...
0
votes
0answers
23 views

Computing Area Weighted Average on Rasters Using Raster to Polygon

I am using ArcGIS 10.3 for Desktop. I am trying to compute area weighted averages for polygons in a shapefile using values in a single band raster data set. The approach I am taking is that I am ...
3
votes
1answer
86 views

Can I project a single set of coordinates that are not in a table or feature class with arcpy?

I have been searching for the easiest way to convert a single set of State Plane Coordinates (in units of "Feet") to Decimal Degrees using arcpy. All the methods I have seen so far involve one of the ...
0
votes
1answer
42 views

How to check for empty string?

I am running a loop to go through tables of a database's feature classes to rewrite the URL links that are currently in the records. The first elif statement is to check whether there is an empty ...
4
votes
2answers
109 views

How to Parse Unique Address Data

I'm trying to parse some funky address data into separate fields either using ArcMap's Field Calculator or a Python Script. Currently, my address data including street number, street name, and ...
-1
votes
1answer
25 views

NumPy Array to Feature Writes only first array object to feature class

I am consuming a json web-service with NumPy Array to Feature, I have many nested try/except blocks to consume the data/find errors/etc. The script is functional, however I am having trouble seeing ...
0
votes
1answer
18 views

How to publish the Manage map server cache tile (Server) tool as an arcGis geoprocessing service?

I need to publish the Manage map server cache tile on the arcgis server as a geoprocessing service. As a result I will be able to update the tiles of a tiled service through a service call. I face ...
5
votes
2answers
833 views

Making Buffer like Offset in ArcPy?

I would like to make a buffer for a polyline and get as Output a Polygon with the same angles as the polyline, having not arcs, like in ordinary buffers. i tried the FLAT option in ArcPy, but it's ...
3
votes
1answer
104 views

Is there a quick way to see the fields in a table via arcpy?

I frequently find myself in Python debug mode, trying to examine the fields of a layer or table. arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn't ...
2
votes
3answers
40 views

Skipping an iteration in modelbuilder

So I've been assigned to clean up someone else's model. Here's the situation. The model is supposed to iterate over a few hundred folders containing feature classes and convert the contents into ...
2
votes
2answers
131 views

Script to buffer 2 shapefiles within each folder of root folder?

I need some help with ArcGIS python script My folder tree is like this: /Testing location C1 POIS.shp STREETS.shp C2 etc, etc I'm trying to make a script to run from arcgis that would ...
1
vote
0answers
209 views

Composite bands produces a single band image

Running this produces a single band tif and not a three band image. Has anyone seen this before or can suggest ways to trouble shoot it? Input_Rasters = path + parentdir + "/" + dir + "/" + ...
1
vote
1answer
124 views

Python Stand Alone ArcGIS toolbox output feature class becomes input feature class within same tool?

Developing a script in toolbox. I have a table that I use to make X Y layer (input 1) I am saving that created layer as a point feature class. (output 1) I then want to run kriging on that newly ...
0
votes
0answers
12 views

Problem with schema synchronization using Import Replica Schema (Data Management)

I want to synchronize the schema of replica. The steps I am following is documented in ArcGIS Resources: Export the geodatabase_1 replica schema using Export Replica Schema (Data Management) tool. ...
0
votes
1answer
150 views

How to automatically generate least-cost paths between several polygons?

What is the fastest way to automatically generate least-cost paths (LCPs) between several polygons with ArcGIS ? I created a python program to do this by using the functions "CostDistance" and ...
1
vote
1answer
40 views

gdal RasterizeLayer gives different extent to arcpy PolygonToRaster

I have an existing arcpy script which uses PolygonToRaster_conversion to convert a polygon shapefile to raster (tiff). I am now exploring GDAL/OGR and have used the cookbook approach to carry out the ...
1
vote
2answers
48 views

How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

I'm trying to generate a shapefile of random points using FID from the attribute table. My attribute table has 800,000 features and I only need a sample of 240. Is there a way to do it in arcpy or in ...
2
votes
2answers
134 views

Python Script tools for ArcGIS 10.2 is very slow (get raster properties)

I am using python script tools for ArcGIS 10.2, under Windows 8.1 64bit. When I am using the arcpy.GetRasterProperties_management() command, it's very slow to process the data. For example. I tried ...
2
votes
1answer
143 views

Choosing specific ArcSDE version to create replica geodatabase from?

I'm trying to automate the process of exporting a replica geodatabase using the geoprocessing tools and eventually a Python script. I can't figure out how to create the replica from a specific ...