A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

0
votes
1answer
86 views

Select by location using ArcPy

I try to select by location all layers that intersect layer named "frame", and then remove from the maps other layers that don't intersect it. Finally, i want to print the all the removed layers and ...
1
vote
1answer
59 views

Insert (or Update) Cursor setting value to None not honored when field has a default value

To set a field to null, the InsertCursor or UpdateCursor is setting the value to None. Here is a sample for the UpdateCursor: with arcpy.da.UpdateCursor(test_fc, ['SERVICEINDICATOR'], """"OBJECTID" ...
2
votes
2answers
79 views

Python script runs in ArcCatalog and ArcToolbox, but not in PyScripter

I have a script that imports a custom toolbox, copies data from an sde to a file/personal gdb, removes custom feature class extensions, etc. The script runs fine in Catalog, but I receive the ...
4
votes
0answers
61 views

Cell Statistics standard deviation values incorrect

I'm having some issues with the Cell Statistics tool in a python script I am writing. I am using 30 years worth of global cumulative annual rainfall data as input and am getting strange values in some ...
1
vote
1answer
52 views

How to create dynamic text in ArcPy that recursively reflects the exported layer name from a list of layers

I have a script shown below with the help from @Midavalo that exports irrig_0, citylyr, boundlyr as a GIF. Once this is done the script then exports irrig_1, citylyr, boundlyr as another GIF and so ...
0
votes
0answers
34 views

Redrawing multisegmented lines as arcs using measurements stored in attributes

I'm beginning the process of moving our local government cadastre data in to a topologically clean parcel fabric layer using ArcGIS. I'm at the stage where I'm looking to clean the data and get it ...
1
vote
0answers
51 views

Adding multiple fields to feature classes in enterprise geodatabase using ArcPy?

I am very, very new at python and am trying to put together a tool that can be run on an enterprise geodatabase that will add a series of fields to each feature class. So far I have only been able to ...
1
vote
0answers
29 views

Size of the Output Files Cannot Match After Converted From Polygon to Raster

Basically, the emodisfile is the raw data file, and shapfile is one of the CLU shape files. I need to convert the shapefile from polygon to raster and then to ASCII file based on the emodisfile. So I ...
3
votes
2answers
39 views

How to detect Query Layer for toolvalidation using arcpy?

For an arcpy toolvalidation script, I have been trying to figure out a good way to detect ArcGIS layer files (*.lyr) based on "Query Layers", and to distinguish them from "normal" feature layers ...
0
votes
1answer
50 views

Invalid Expression ERROR 000358: Select by Attribute

I'm attempting to select a certain point in a feature layer so I can perform buffer analysis on it. The code seems fine, but I am getting an invalid expression error: File "C:\Program Files ...
0
votes
1answer
56 views

Arcpy turns off all fields in a MXD file that all of the values are Null [closed]

I am trying to turn off all fields in a MXD that have all null values. I have been looking at a SearchCursor without much luck.
1
vote
1answer
34 views

Arcpy how to get field names dynamically from shape file in customized plugin?

On selection of a feature layer ArcMap tools display all the fields, Zonal Statistics is one of the example. I have entered my feature as fishnet and it has shown me all the fields in a list below. I ...
2
votes
1answer
56 views

Why is my ArcPy script deleting its workspace?

I wrote an ArcMap script to go through a feature layer, identify unique values in a given field, and output a feature class from each unique value to its own feature class or shapefile. As an ...
2
votes
0answers
46 views

Identifying lines of one feature class that touch another feature class with their endpoints in ArcMap? [closed]

I want to find out and select the features of one feature class, which both endpoints touch another feature class. In the picture above it would be the left pink line which touches feature of ...
1
vote
0answers
59 views

Python Addin - Run script from button [closed]

I'm developing a Python Addin for ArcMap. This will consist of a button that will run another python script: import arcpy from arcpy import env import pythonaddins import os class ...
0
votes
0answers
35 views

Geometric Network Comparison with some other Geometric Network

How can I get report of geometric network rules in details. I want to compare geometric network rules with another geometric network to analyze the difference. In Geometrical Network I have plenty ...
1
vote
1answer
56 views

How to update new column in attribute table with same values but different field type?

I am struggling a bit with debugging my code, over something that seems very simple. I am using an update cursor to copy and convert existing string data into a new float column of my shapefile's ...
1
vote
1answer
38 views

Near analysis for nearest feature in a distinct angle

I want to calculate the nearest distance from a point feature to a line feature in a distinct angle. When using the Near analysis tool in ArcGIS I get the nearest distance in a angle where the ...
1
vote
1answer
36 views

“Extract by Mask” saving output as temporary file, instead of saving it in specific directory. How to remove this error?

I am using ArcGIS 10.0, while using ExtractByMask in arcpy output file is being stored as a temporary file, though the same file appears in the designated directory but it's status is temporary, which ...
1
vote
1answer
53 views

Passing field name as parameter to script in ModelBuilder?

I am new to ModelBuilder. I am running a python script from ModelBuilder that requires as it's parameters a table view and specific field names from that tableview. Essentially the script is looking ...
1
vote
0answers
47 views

delete feature classes with a similar name in arcpy

I have a script that does a dissolve on polygons with a common field. I'm only interested in keeping the outputs that contain more than one polygon. I'm new to python and having trouble writing a ...
1
vote
1answer
52 views

How to export specified layers in ArcMap using ArcPy

I am trying to export specific layers from an ArcMap .mxd. From the TOC below I would like to export "irrig_2, citylyr, boundlyr" as a GIF. Once this is done the script would then export "irrig_1, ...
2
votes
2answers
93 views

Why does FeatureClassToFeatureClass work in ArcMap but not in Python script?

When trying to copy a feature class from an SDE connection file to a scratch GDB, the FeatureClassToFeatureClass_conversion works in the ArcMap Python window, but I can't get it to work in a Python ...
-1
votes
1answer
44 views

Trying to use functions [closed]

Trying to use functions. First, embed the code in script, then I'll trying calling them from a file. I'm getting the error denoted below. After two days, it's time to get some fresh eyes ... Python ...
1
vote
1answer
48 views

How to create dynamic text of a layer name?

I'm trying to implement the code mentioned on this post: Best way to have title which includes dynamic text of a layer name? and I'm getting the error below. I am a novice and know nearly nothing ...
2
votes
1answer
39 views

lyr.datasetName works with “CURRENT” mxd but not with mxd path

I have some mxds in wich I want to set all the layers a layer description. This works as far as I use the code with current mxd, but if I give a path it has no results, and I also don't get any error ...
1
vote
2answers
47 views

Use arcpy to Import Symbology instead of Apply Symbology?

I am using arcpy (ArcMap 10.1) to create a series of maps of the same extent that show increased count of disease in areas over time. For example, in the first map, the disease count will be low in ...
1
vote
0answers
42 views

How can I Use Python in ArcGIS to Manipulate the Underlying Data of Selected Polygons [closed]

I am relatively new to python in ArcGIS. I have a shapefile loaded in ArcGis (v 10.0) and will select two adjacent polygons using the selection tool. Once I select my two polygons, I want to use ...
2
votes
1answer
69 views

Filter the Feature Layer parameter in Python Script Tool

I have a Python script tool where I have a parameter of type Feature Layer because I want to have the already opened layers as a dropdown list. I was wondering if there is a way to filter this ...
4
votes
1answer
42 views

Arcpy and multiprocessing not working

I want to utilize multiprocessing within my arcpy scripts but my first test has run into a problem which I don't understand. I'm running the script in the python window: import arcpy from ...
0
votes
0answers
39 views

How to change the color of a polygon in ArcPy?

I am trying to write a script that changes the color (fill and outline color) of a single polygon in a layer using ArcPy. Is this possible without importing properties from a reference layer file ...
-4
votes
1answer
51 views

Where to incorrporate IF and Else if file doesnt exist after os.walk? [duplicate]

How would you skip the arcpy.Merge and arcpy.Clip if 'AAA010.shp' does not exist in the directory that os.walk is going through. I will have more code after the last line in this snippet. import os, ...
0
votes
2answers
87 views

Converting ModelBuilder to Python Script?

I have exported a ModelBuilder into a Python script. I am not able to figure it out at which point of the python script I need to make changes so that I can completely run the python script in Python ...
0
votes
1answer
43 views

how to skip creating an empty feature class using featureclass to featureclass in arcpy

I have a script that finds points outside of selected areas and creates a feature class in a file geodatabase. However, sometimes there are no points outside of the selected area. Currently, the ...
2
votes
1answer
30 views

ArcPy: Aggregate points using multiple aggregation distances and output names

I would like to be able to run a whole load of aggregate polygons with a variety of aggregation distances, using Arcpy. I have successfully done it using model builder, but specifically want to do it ...
1
vote
1answer
23 views

exporting a polygon from a layer file to a file geodatabase feature in arcpy

I have a script that creates Service Areas(SA) using Network Analyst. I need to use the polygon of the SA later on in the script. I need to do an analysis using each resulting SA individually. The ...
0
votes
0answers
16 views

Add field, if not alredy exist. Else do nothing [duplicate]

I want to develop a python code that: Enters a shapefile. Determines all its fields and, if among these fields there are some missing from a certain list, it add them. An example may be easier to ...
0
votes
1answer
20 views

ArcPy - error with updateRow() using UpdateCursor

I am trying to use the UpdateCursor function to run through each field in each row and to compile a string which is then added to the AbvField. I'm trying to do this in the python window, rather than ...
1
vote
1answer
40 views

Why I'm getting “Runtime error <type 'exceptions.ValueError'>: Object: CreateObject Layer invalid data source” while adding shapefile using ArcPy?

I am trying to add shapefile using ArcPy, but each time my script is ending in showing runtime error? I am using ArcGIS 10. Here is my script import arcpy from arcpy import env ...
1
vote
1answer
54 views

How to use ArcPy to list feature class and number of rows per feature class?

I would like to iterate a geodatabse to get the name of each feature class/data set in it, in addition to the number of rows in the feature class. I would also like to identify whether the dataset ...
1
vote
1answer
69 views

Spatial Join in Python Field Mapping with Multiple Merge Rules

I'm performing a Spatial Join with a polygon (target) and a point (joinFeature)- which has 5 fields in it that I need to "sum". I have written a Spatial Join and (after many long days) gotten the ...
0
votes
1answer
98 views

How to code to skip a shapefile, if it doesnt exist? [closed]

So if shape file 'AAA010' does not exist, how can I skip the Merge and Clip and move on to the next part of the script? If possible I would like to keep the current script as it is, but by just adding ...
0
votes
1answer
46 views

Attribute error in arcpy script [closed]

So here is a script that is used to extract a specific file from multiple folders and subfolders. It run smooth, until the end. import os, fnmatch, arcpy arcpy.env.workspace = ...
2
votes
1answer
44 views

Arcpy “print” works only the first time [duplicate]

I am running this extremely simple code using the ArcGIS python environment: import arcpy test = r"C:\....\New_Shapefile.shp" #test contains several fields, including one called "Number". ...
1
vote
0answers
44 views

Exporting .jpg files from data driven pages in Arcmap (name file is a text) [closed]

I am trying to export my Data Driven Pages to JPEG files named wiht an index layer field. I have used the code posted in other answer and it seems to work fine when the page names are numbers. ...
1
vote
1answer
32 views

SelectLayerByAttribute_management - Python string syntax

I am having trouble getting my syntax correct, currently I have arcpy.SelectLayerByAttribute_management ("SpatialSCRIMNet", "NEW_SELECTION", RtyF LIKE 'D%' OR RtyF = 'S1' ) RtyF is a defined ...
1
vote
1answer
30 views

Replace Statistics_analysis with SearchCursor?

I'm using ArcGIS 10.3, 64bit with an advanced license. I have the following code, that runs just fine. It goes through a table that contains a large number of entries with zip-codes and population ...
1
vote
1answer
44 views

Getting 'module' object has no attribute 'ExtractValuesToPoints_sa' error in ArcPy while extracting values to points?

I am using ArcGIS 10. I am trying to extract values to point using ArcPY but getting error as Runtime error : 'module' object has no attribute 'ExtractValuesToPoints_sa' Below is what I am ...
0
votes
0answers
29 views

Trying to delete specific features within feature class

I am working with arcmap 10.2. I have a database that has a few feature classes in it. Within these feature classes, they have a field labeled as Height. Height is a string field that houses numbers ...
0
votes
1answer
38 views

How to select specific feature classes nested within several folders? [closed]

I have hundreds of shapefiles that are stored in separate folders, which are within several other folders. Among the shapefiles I only need the ones that are named 'LAP010'. How do I get that ...