1
vote
1answer
40 views

Multiple arcpy.env.workspace

thanks in advance. Is possible to set multiple env.workspaces on the same script to listDataFeatures from different spaces ? eg. import arcpy def readFromGdb(): arcpy.env.workspace = ...
1
vote
0answers
23 views

How to access annotation feature classes in ArcPy?

I want to batch replace paths in a series of .mxd files using Python. Many of the layers have moved and in some cases the name has changed or its dataset is different. I've written this code which ...
4
votes
2answers
63 views

Bulk convert DBF to CSV in a folder ArcGIS 10.1 using Python

I would like to convert 1000 dbf files to CSV. All dbf files are in one folder and they have sequential names (S:\output_tables\tcb1.dbf, S:\output_tables\tcb2.dbf, S:\output_tables\tcb3.dbf, up to ...
3
votes
2answers
113 views

Converting Vertices of Polylines and Polygons to Points and Maintain Attributes

I'm pretty sure someone has done this before, but I'm having no luck. I'm using ArcGIS Standard version 10.2.1 and I want to convert all the vertices of a polyline or polygon to points. Essentially, ...
0
votes
1answer
50 views

Error with Python Script tool for ArcGIS 10.2

I am trying to create an ArcGIS map tool that includes creating TINS and uses parameters. This tool works fine when taking the data from shapefiles, but when I use map layers, which is what I want it ...
3
votes
0answers
47 views

After ArcGIS 10.2.1 update, Arcpy 64 bit import Error

I've updated my ArcGIS desktop version from 10.2 to 10.2.1 and have noticed that when I run the 64 bit version of IDLE I now get an error when trying to import arcpy: Python 2.7.3 (default, Apr 10 ...
0
votes
1answer
21 views

How do I check spatial reference on all parameters during Tool Validation?

How do I check spatial reference on all parameters during Tool Validation? Just looking for recommendations. Here is what I have already. This must work with existing validation. import arcpy class ...
3
votes
1answer
25 views

Why is Mosaic or Mosaic To New Image causing a 1-pixel gap between adjacent images?

I have a series of adjacent PNG images, and I'm trying to merge/mosaic them into a single seamless image. The images have clean "cuts" between them, with no overlaps. However, when I use either the ...
3
votes
4answers
133 views

How to convert all values in all fields of table to upper case using ArcPy & Python?

Does anyone know how to use the .upper() in a stand alone python script so it can be used to change all characters in a table into UPPER case? I don't want to use the field calculator since I have ...
-2
votes
0answers
39 views

intersect zip python

I try to change the python script ExtractData to do the intersection., but until now I fails to do so. i change the funtion : clip_analysis by intersect_analysis. i change also the parameters: ...
0
votes
0answers
16 views

Min value (OD Cost Matrix)

I have an attribute table with columns that I have gained from running an OD Cost Matrix. In one column named "Total Minutes" I will select the lowest value (the shortest route). Then I will create a ...
0
votes
1answer
38 views

arcpy absolute file path failing with AddLayer()

I have the following code: import arcpy.mapping as mapping mxd = mapping.MapDocument("current") print mxd.title df = mapping.ListDataFrames(mxd)[0] print df.name layer = ...
1
vote
0answers
36 views

How can a script tool share (dynamic) variables among different modules?

I'm running a python script from the toolbox window (as a script tool). I have a second python (tkinter) module that I use as an input interface. Now, I know that the script tool can call the ...
0
votes
2answers
36 views

How to add data to a newly created folder using arcpy?

I'm writing a script to create a new folder and then copy a feature class to a shapefile and add the shapefile in the new folder. The folder gets created but the script is failing on the feature class ...
-1
votes
4answers
105 views

Issue with UpdateCursor and if/else statement

I have been working on this code for awhile and I can't make it work the way I need it to. The code is suppose to move a feature according to a set distance from types in a designated field. As the ...
1
vote
0answers
38 views

using arcpy to query sde database in python

I have three variables: view_name, column_name, and column_content. column_name contains id, name, address, etc. column_content contains 123, John, 200 King st, etc. user specifies the column_name ...
2
votes
2answers
32 views

Update raster value to reflect total number of points within cell- python

I have what should be a fairly simple task, but I can't seem to figure out how to do it. I have to do it in python/arcpy/gdal/whatever because I'm trying to automate this process for a hundred or so ...
3
votes
1answer
41 views

How to obtain the width and height of an image using arcpy

This Stack Overflow question shows how to obtain the pixel dimensions of an image using Python. Is it possible to find an image's height and width using arcpy and ArcGIS? arcpy.Describe would seem ...
0
votes
0answers
26 views

How to intersect widget using script python arcpy and geoprocessing service? [closed]

Is it possible to develop an intersection widget with geoprocessing service using script python arcpy? I try to do that with ModelBuilder but after publishing, in geoprocessing service i don't find ...
1
vote
2answers
107 views

Import CSV column into existing feature using arcpy

My goal is to take a CSV that contains 50 rows and one column and import the data into a feature class with over 3,000 rows using arcpy. I want to pick a random row from the CSV and then iterate ...
0
votes
0answers
44 views

Intersecting Polygons

I have 10 shape files containing polygon features. I would like to produce a single polygon layer containing portions of the input polygons where no fewer than two of the aforementioned feature ...
2
votes
2answers
35 views

Why is arcpy.StackProfile_3d -> arcpy.SaveGraph_management creating empty graph?

In a python script I'm trying to save a graph to a .png file with graph output from arcpy.StackProfile_3d but the .png file shows an empty graph. The table created from arcpy.StackProfile_3d shows ...
2
votes
2answers
51 views

raster standard deviation stretch python script

I am looking for ways of applying a permanent standard deviation stretch to rasters via python script. Are there any arcpy raster stretch functions? I was looking for a reference but could not find ...
1
vote
1answer
60 views

Using 'construct points' on all lines in a shapefile (arcpy)

I need to use the editing tool 'Construct Points' on several shapefiles that each have ~1300 polylines. I need to do this to create points every 1km along each of the polylines, which represent the ...
0
votes
1answer
23 views

replace data source for all layers that point to shapefile

Hi I'm trying to do something quite simple but its not working. I want my python script to change all of the layers that point to the same datasource (a point shapefile) to another point shapefile. ...
5
votes
2answers
87 views

Is there a way to refresh imported modules in a ArcGIS Python Toolbox?

When using a python toolbox (.pyt) in ArcMap, I'll typically follow a pattern where the .pyt file itself is simply a wrapper to collect input arguments and define the tools themselves. Supporting ...
1
vote
1answer
66 views

Arcpy Script tool

I'm creating a script tool and using the SelectLayerBy Attribute function (below), arcpy.SelectLayerByAttribute_management("cities_lyr", "NEW_SELECTION", '"CRIME_INDX" <= 0.02') However, I keep ...
1
vote
1answer
47 views

Python syntax error -can't figure out why? [closed]

This should be simple. I hope I don't get down votes! I just got the following code from an article about using Google Maps API and ArcGIS to calculate routes without network analysis and just can't ...
0
votes
1answer
16 views

whereClause syntax for Cost Distance parameter

I am looking to create a sql expression regarding point feature class and selection based on 'Name' field to pass to arcpy.sa.CostDistance() param[0]. similat to: savepath = env.workspace = ...
1
vote
1answer
58 views

empty file geodatabase error (nowhere feature class)using arcpy [closed]

i want to import a python(2.7) script to arcmap 10.1 my script has 2 inputs variables one for workspace and another raster dataset and i want o convert input raster as feature class polygon . i want ...
0
votes
1answer
43 views

Weighted Overlay - passing parameter as text error?

For some reason when hardcoding the save path for the wieghted raster just before runtime it works perfectly. Like such... arcpy.env.cellSize = "90" arcpy.env.workspace = r'G:\Xcel\Route ...
-1
votes
1answer
42 views

define error for python script to import arcmap [closed]

i want to create a simple python script for create one file geodatabase but show me define error # Import arcpy module Import arcpy import sys import os from arcpy import env from arcpy.sa ...
2
votes
1answer
46 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
2
votes
3answers
265 views

Adding a new field and calculating area using Python

Using Python, how do you add a new field to your shape file and calculate the area in km2?
1
vote
0answers
60 views

Running python script outside of Arcmap's python console

My codes works fine in Arcmap's python windows. But when I try to run it in a command promt windows, It says that; ERROR 000837: The workspace is not the correct workspace type. But it works fine ...
0
votes
1answer
26 views

registering or unregistering as versioned a future dataset with python

As you know, you can store feature classes in arcsde in two ways. Firts, in the root path: sde_conn_file.sde/FeatureClass Second, in a dataset: sde_conn_file.sde/DataSet/FeatureClass How can I ...
0
votes
1answer
68 views

Unique Values in validation

How do I ensure the same selection is not made on param[2] and param[3] both of which are populated from the same field using tool validation? import arcpy class ToolValidator(object): """Class ...
4
votes
1answer
116 views

Determining Shape Area Field Name

I'm dealing with a varierty of spatial polygon files (shapefiles, file/personal gdb feature classes, sde feature classes (some with spatial views)) and depending on the file type, I get a mulittude of ...
3
votes
2answers
39 views

Using arcpy, is it possible to check if a thumbnail exists for a specified file?

I have written a very simple tool that builds thumbnails for every map document in a folder : root_fld stands for root folder and rec tells if search must be recursive. import arcpy import os import ...
-1
votes
2answers
242 views

How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?

I have a proplem with arc hydro in arcpy,i want to create a simple script where automated some tools from archydro in arcpy.. I use arcmap 10.1 and python 1.7,my import is one dem and my export is a 6 ...
0
votes
1answer
44 views

How to identify a selected graphic element(s) in python

I have a situation where I am inserting items from Excel into maps a lot. When I insert the items it always makes them a fixed width and then adjusts height to maintain aspect ratio. What I would ...
0
votes
0answers
21 views

Points Missing on Import of LongLat data to SHP using ESRI script CreateFeaturesFromTextFile()

In ArcMap 10.0 I am using a 9.1-era ESRI script in Python called CreateFeaturesFromTextFile. There appears to be no ArcMap 10 update. The input text format is the strict format ESRI point,X,Y layout ...
0
votes
1answer
38 views

Is there an equivalent to arcpy.ImportToolbox() in 9.3.1?

Is there an equivalent to arcpy.ImportToolbox() using ArcGIS 9.3.1? I'm assuming it would use arcgisscripting instead of arcpy but I can't find any documentation.
0
votes
0answers
75 views

I could use some help with a bit of code optimization

See edit below. I posted here a couple weeks ago looking for some advice on the best way to iterate through data. You can find that post here. I have since done some tweaking to the code, and ...
0
votes
2answers
53 views

Python script to check node / edge coincidence

I have written a script with arcpy to test node and edge coincidence. Each edge (line) should have a node (point) at either end. If this is true, the script does not write anything. If there is node ...
0
votes
1answer
34 views

How to schedule a model to run at a certain time?

I'm trying to schedule a model to run at a certain time and have found this ESRI Blog post which is providing a good start. What I can't figure out though is where in the importToolbox function I tell ...
0
votes
1answer
45 views

automatic save outputs variables in the folder workspace using pyhon for arc map 10.1

I want to create python script with aim to import him in environment arcmap 10.1 and to make a hydrologic analysis because the scipt meybe can have many outputs raster file or feature class would ...
0
votes
1answer
67 views

Using Python for Polygon Neighbors Analysis in ArcGIS 10.1: Script producing erroneous results

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
0
votes
0answers
41 views

Using ArcPy, is there a way to change the color of a symbol in a UniqueValuesSymbology object?

I have an template mxd I reference with several pre-defined layers. The only variable I need to modify is the color of certain symbols in the layer. I have tried to modify and dig around the Symbology ...
0
votes
2answers
72 views

I get an ERROR 000622 when it checks for arcpy.DefineProjection_management

So the purpose of my code is to create a loop that copies shapefiles from a folder to my folder and change its projection 'GCS_WGS_1984'. Each shapefile starts with the year follow by the month and ...