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

learn more… | top users | synonyms (1)

0
votes
1answer
206 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
3
votes
1answer
948 views

Getting the name of the mxd using python

I have a python script which reads through all the mxd's in a folder and changes their properties from relative file paths to absolute file paths. I now want to add a bit to the script to change the ...
1
vote
1answer
255 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
7
votes
1answer
221 views

Draw middle ordinate perpendicular to chord, out to curve, with arcpy

I've been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; ...
3
votes
2answers
163 views

How can I generalize “field name” variable?

Here is my code: import arcpy import math arcpy.env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("NVF_*") try: for fc in fcs: rows = arcpy.UpdateCursor(fc) ...
2
votes
2answers
699 views

How to select specific filenames nested within several folders?

I have hundreds of shapefiles that are stored in separate folders, which are nested within several other folders. Among the shapefiles I only need the ones that are named 'POINT*.shp' How do I get ...
5
votes
1answer
272 views

Does arcpy have a method for accessing related records within a cursor?

I have a line feature class that represent sampling segments. I have a data table of field notes in the same Geodatabase that is connected to the feature class with a Relationship Class. Is there a ...
1
vote
0answers
90 views

Import related CSVs to geodatabase without losing foreign key relationships

For various reasons I understand it is poor practice to rely upon OBJECTID fields to relate different tables together using a relationship class. Therefore, I have a series of several tables related ...
1
vote
2answers
166 views

How to query a data table embedded in ArcPad AXF file package using VBscript?

I would like to ask for some help on writing some VBscript (Supported in ArcPad) in a user form Command Button where the user activated the form with a unique feature ID(hence named COA_ID) already ...
3
votes
1answer
778 views

How to export a mxd to a image with transparent background

I cannot get ArcMap 10.0 or 10.1 to "Export Map" to a png or gif with a transparent background -- no matter what I set the background and transparent colors to. Thus, I created the following script, ...
1
vote
1answer
168 views

Copy specific cell value from one feature class and append to another feature class

I want to copy specific cell value from one feature class and append to another feature class. I have the following code, however, when I run this, it does not produce the results, nor shows any ...
1
vote
1answer
837 views

Calculate coordinates of centroid in arcgis using python

I have polygon features and want to calculate coordinates of it's centroids in arcgis using python - all goes fine, but it gives me coordinates in meters and not in degrees as i want. Here is the ...
1
vote
1answer
128 views

How to add ArcPy Feature Layer to ArcMap automatically?

With Python, how do I get either the MakeXYEventLayer_management or the MakeFeatureLayer_management layer that is temporarily created added to ArcMap automatically after the tool is ran, without using ...
2
votes
0answers
33 views

Generating composite values ( MAPFID numbers) for previously duplicated vales based on 2 different fields

Good day everyone! I have lurked around here for info preiously, but this is my first post, so please be gentle if I commit any faux pas. Okay, let me try to break this down so we can all ...
4
votes
2answers
449 views

Focal statistics to calculate saddle points from DEM

I have a conundrum with Focal Statistics and kernel files. I am been trying to identify saddle points in DEMs. I am attempting to rewrite this (thanks whuber) in a python script for 10.1. I have ...
0
votes
1answer
126 views

How to filter shapefile using definition query?

I have a point shapefile which I want to interpolate using IDW interpolation. However, I want to interpolate only those points which satisfies a certain condition. I need to do it in python and I ...
3
votes
1answer
273 views

How to exclude stations from IDW interpolation?

I have the following problem: I need to calculate an average precipitation amount on a catchment using an IDW interpolation. The interpolation is performed in a loop since each precipitation station ...
0
votes
1answer
114 views

NameError: name 'finalPdf' is not defined

Could you please help me with this error: Traceback (most recent call last): File "C:\DDPeX\Export_GroupPDF.py", line 19, in finalPdf.appendPages(tempPdf) NameError: name 'finalPdf' is not ...
2
votes
1answer
276 views

Change label next to symbol in TOC

I'm trying to write a script to change the label next to the symbol in the TOC so it appears in the legend. Arcpy has a way to change the name of the layer, but I can't seem to find a way to change ...
1
vote
0answers
169 views

How to compare files in two folders? [closed]

I'm pretty new user of ArcGIS. My intention is compare files (csv) from one folder with files in another folders. In those folders exist files with the same name but in second folder files have ...
2
votes
0answers
45 views

Building Arc add-ins without needing to restart Arc [duplicate]

One of the things that annoys me the most with trying to use the Arc add-in wizard is that I need to restart Arc every time I want to test something. This is especially annoying if I've got syntax ...
1
vote
1answer
134 views

ArcGIS, Edit Layer Extents with Python script

I would like to read and edit the Extent Values of each Layer in a MXD-file. My code: import arcpy mxd = arcpy.mapping.MapDocument(r"D:\Work\myInFile.mxd") for lyr in ...
1
vote
1answer
484 views

Copy features from feature class to an existing feature class with arcpy

I see CopyFeatures_management, but this creates a new feature class. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000 Is there a way to copy features from a feature ...
1
vote
1answer
195 views

Read layer symbology class color with ArcPy

I am using ArcPy within ArcGIS 10.1 and attempting to read symbology from a *.lyr file created by a raster dataset within ArcMap. My goal is to be able read out the RGB (color) values assigned to the ...
2
votes
2answers
71 views

Accessing features via arcpy

i try to use arcpy to accessing the features of a shapefile. I tried to use a searcheCursor, like that: cursor = arcpy.da.SearchCursor(Points, ["SHAPE@XY"]) for row in cursor: x, y = row[0] ...
2
votes
0answers
283 views

How to programatically set default Geodatabase and Workspaces for a map document?

I have a QC process that has a bunch of models that need to be sequentially run, and then the results manually inspected between each model. I know how to manually set the default GDB for the Map ...
2
votes
1answer
182 views

How to check if a shapefile is empty with arcpy

I have a bunch of shapefiles in a folder. But some of them are empty, i.e. there are no rows within the shapefile. Is there a simply to find those empty shapefile out?
1
vote
0answers
138 views

New python GIS Programmer : Fundamentals of the Python Language for ArcGIS [closed]

I am new to programming and I'm trying to learn "Fundamentals of the Python Language for ArcGIS" and then I've been trying to compile an example code but python GUI keeps throwing throwing this error ...
2
votes
0answers
72 views

Convert absolute file path to raster databaset [closed]

I wrote a simple python script that outputs an absolute path as string to a GeoTiff file. So this file can be treated as Raster. In a Model, the GeoTiff file is to be the input raster of a CopyRaster ...
0
votes
1answer
937 views

Problem adding a join to a table via Python using addJoin_management

I am currently building a script for a script tool that will join data from a multitude of tables into a single table based on a common join field. Now, I have attempted to use ...
3
votes
1answer
359 views

How to convert all shapefiles in folder into KML using ArcPy?

I was trying to convert all the shp in a folder into kml. featureclasses = arcpy.ListFeatureClasses() for fc in featureclasses: # Set Local Variables composite = 'COMPOSITE' pixels = ...
3
votes
1answer
243 views

Small script crashes Python

I'm running a rather simple script with ArcPy, which extracts values of raster to points of a shapefile: def raster_overlay(input_files): for raster in input_files: in_shp = ...
2
votes
0answers
134 views

Is it possible to run a search cursor on a multipart feature class?

I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where: one city is selected and a select layer by location is run to select all parcels that are ...
2
votes
0answers
58 views

Copying an entire column between layers (tables)

I have a raster layer with probabilities as values and I process them using the Spatial Analyst extension. After the processing the values are modified, however I would like to also have the original ...
2
votes
3answers
502 views

How to release locks to temp files after ArcPy script crashes in ArcMap?

Sometimes when I'm testing an ArcPy script and it ends with exception, ArcMap is still holding locks to some temp files (I run my scripts through ArcMap). I cannot run the script any more, because it ...
2
votes
2answers
232 views

Trying to use Python code and user defined inline parameters to build a SQL expression

I am trying to build a tool where the end user can run a model and make a selection from a feature class based on 3 different fields, calculate the total shape length, & export the results to a ...
3
votes
1answer
156 views

How can I make my python script results appear in model builder

I have a model (model builder) and within I added a python script to calculate a field. My problem now is, that I don't know how to make the output appear in my model as it is the same as the input ...
0
votes
0answers
23 views

Possible to automate Buffer Wizard in ArcGis 10.x by working in the Shell? [duplicate]

I'm trying to automate the Buffer Wizard since I have several large sets of the data that I need to buffer at multiple distances. Doing it by hand will take a long time and be quite tedious, but I've ...
3
votes
2answers
370 views

Using ArcScripts

I use ArcGIS 10 I want to use an arcscript to compute an index of ruggedness for each cell of my map. For this purpose, I found, Evan's TRI.aml script here: ...
0
votes
0answers
74 views

Select By Attribute sql problems [duplicate]

Having trouble with this python code. I keep getting a ERROR 000358: Invalid expression" code for the select layer by attribute management statement towards the end of the code. Moved the data to ...
1
vote
0answers
95 views

Get values from select by location to append to table

I'm trying to calculate the road frontage of polygons by converting polygons to lines and splitting in their vertices, then using select by location to find lines that are within 7.5 meters of the ...
2
votes
1answer
60 views

arcgisscripting in CGI script

I'm trying to write a Python script that imports arcgisscripting (stuck on 9.3.1 here) which is then run as CGI by a web app. It runs fine from the Windows command line but as soon as I drop it into ...
1
vote
0answers
72 views

Convert polygon feature to line feature

I have a polygon shape-file i need to extract the line segments where the polygon features intersect each other and also the segment where they don't. Can we automate this process or can scripting ...
1
vote
1answer
504 views

Subquery a list in select layer by attribute management using python

I am new to python and having trouble with my script. I want only the records from the COMTRS field (of the pur_dbf_view) that match values from the ComtrsList to be selected; however, I am getting ...
1
vote
0answers
132 views

What is a good way to cluster point data by item counts in ArcGIS?

I have point features that have as an attribute an asset count. For instance, point A may have 3 assets whereas point B may have 300 assets. My goal is to have each point be in two categories: ...
2
votes
1answer
77 views

Is it possible to display two categorical symbolizes for two different attributes in one layer alongside each other in ArcMAP 10.1?

I have a road layer that I would like to display attribute_1 = "speed" on top of the line segment and attribute_2 = "traffic_volume" below the line segment. For each attribute I would like to setup ...
6
votes
1answer
204 views

Generate ArcGIS spatial bookmarks from feature envelope

Curious if anyone has some code that would rip through a feature class and generate a spatial bookmark for each feature's envelope. You could define a field in the feature to be the bookmark's name.
1
vote
3answers
393 views

Does arcpy.SearchCursor function support field indexing?

Does the arcpy.SearchCursor function support field indexing? In the sample script below, can I sent my cursor to loop through the values in the first field by setting an index to search the first ...
3
votes
1answer
107 views

Join is deleting fields in arcpy

I'm working on a script to automate the conversion of CAD .dwgs of rooms to feature classes, I'm nearing completion and am now working on the second portion of the script (I've seperated it into two ...
4
votes
1answer
395 views

Problem: Arcpy Graph function empty graph output

Background: I have some python code that I need help with parameter passing into the MakeGraph_management arcpy function. I would like to create a two-series vertical line graph for every pair of ...