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

learn more… | top users | synonyms (1)

0
votes
0answers
79 views

Copy Raster Catalog from .mdb to .gdb, but only within a certain extent with arcpy?

I am stumped again, this website has really helped me before so here is another shot. I am trying to copy a raster catalog from a personal geodatabase to a newly created file geodatabase but only ...
2
votes
1answer
831 views

How to add feature class to MXD with ArcPy (Python)?

I am using ArcGIS 10.1 and I am trying to add a feature class that I create to an MXD, so that I can join to it. This all needs to be done using Python. Is this possible?
3
votes
2answers
146 views

Detecting ring direction of a polygon using ArcPy

I am using ArcPy in ArcGIS 10.1 to process some geometry using the arcpy.da data access module. However I have run into a problem with complex Polygons that contain inner rings/holes. From the ...
1
vote
2answers
292 views

How to write raster field values into attribute table using ArcPy?

Is it possible to use ArcPy (10 or 10.1 )to write raster field types into a featureclass? either SDE or filegeodatabase?. I'm hoping to use arcpy as means of automating the process of adding rasters ...
10
votes
2answers
516 views

Is there a compelling case to learn/use Python Toolboxes (new at ArcGIS 10.1) over Python Script Tools?

I've written a few Python Toolboxes (which are new at ArcGIS 10.1), but am yet to decide whether/when I should write them rather than Python Script Tools in a standard toolbox. I thought the Online ...
4
votes
1answer
764 views

How to reduce time for 'Export to PDF' (or any other alternative to print maps) in Python?

For my work, I designed a tool to create PDF maps with large amount of data, intersected with 5 buffer rings using ArcPy. The job involves intersecting points, selecting points, generating Elevation ...
3
votes
1answer
162 views

How to get default parameter value for script tool from csv file?

I am fairly new to python scripting. I have just figured out how to read and write input parameters for a python script from a csv file. Now I am being asked to pre-populate the script tool dialog in ...
1
vote
2answers
122 views

Python select by attribute using a variable counter

I am brand new to python and trying to learn how to do some simple loops but I have hit a snag. Below is what I am working with, I am trying to select the polygon row by row, but I keep getting EOL ...
7
votes
3answers
354 views

can arcpy detect whether it's running in Desktop or Server?

I'm developing some code that I want to run both as an ArcGIS Server web service and as a standalone script. I want to be able to modify the execution slightly depending on whether it's running as an ...
0
votes
2answers
132 views

ListFeatureClasses brings back more than expected

Why, when I issue the function: fcList = arcpy.ListFeatureClasses(feature_type='point') does it bring back a list of grid/rasters as well as all my point featureclasses from ArcSDE. All I want is ...
0
votes
0answers
607 views

insert cursor and arcpy.da.editor

I am trying to insert geometries and attributes to a featurclass the has attachments enabled. The featureclass is in an sqlserver SDE 10 database with service pack 2 installed and the featureclass is ...
4
votes
2answers
983 views

How to copy selected (targeted) features to new shapefile using ArcPy?

I'm trying to copy specific attribute table rows from one shapefile to a new shapefile that will contain only the specified rows in its attribute table, that is, if a field GDP_TOP10 = 1. I'm using ...
1
vote
2answers
138 views

Python: Arcpy: Adding data to a shapefile

Complete arcpy beginner here... I have a shapefile with the fields CNTRY_NAME and GDP_HEAD. I have a list in Python gdppop2002 = [['Country1, 234.1232341], [Country2, 23.2341234],...etc...] I'm ...
2
votes
1answer
531 views

Why does copy convert my Tiff raster value range?

Recently I have worked with some raster dataset. And I found there are different kind of raster dataset. Till now I have worked with grid type raster dataset and my add-in works fine with this type. ...
7
votes
1answer
541 views

ArcPy method to determine ArcMap document version

Is there a way with ArcPy to identify the version of a Map Document (MXD). I am working on a solution to inventory our MXD's and would like to know if a document is 8.1, 9.2, 10.0, etc. I am ...
1
vote
1answer
292 views

Creating an Origin/Destination (OD) cost matrix using ArcPy

I have created a python script that runs an OD cost matrix over five years from 1999 to 2004. I have set up an OD cost matrix for each year, which I think is very cumbersome. Is there someone who can ...
1
vote
0answers
250 views

Python Addin toolbar- Environment mask parameter not being recognised?

I've created a button on a python addin toolbar which uses the selected features from the selected layer in the TOC, creates a feature layer from that selection and uses that feature layer to set the ...
2
votes
2answers
98 views

How to reproject all featureclasses in a database to another database?

I am very new to arcpy and have ArcGIS 10.0 I would like to make a script where I would only have to change two variables in a script (database_input and database_output) so that I can reproject all ...
0
votes
1answer
249 views

Apply Symbology to a group layer

I currently have around 200 features that all need have the same symbology applied to them. I have used the ApplySymbologyfromlayer_management however this takes much to long to process, at least a ...
0
votes
0answers
55 views

Pyscripter hangs on spatial join?

I've got a script which loops through a series of FC layers (tracker points). Using a FOR loop, they're reprojected then joined to a streets layer. Sometimes it works fine, then other times it never ...
6
votes
4answers
944 views

How to check via Arcpy if ArcMap is currently in an edit session or not?

I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target ...
1
vote
1answer
189 views

OD cost matrix Arcpy [closed]

I'm trying to create an OD cost matrix python script. I'm doing an OD cost matrix analysis. I'll find out the average time with patients to hospitals over 10 years. When I do this analysis, the ...
2
votes
1answer
158 views

How to catch invalid expression errors in Python?

I have a script that creates a new feature using arcpy.GetParameterAsText, but I'm having trouble creating an error message for incorrect user input. The input for a parcel # should be something like ...
1
vote
2answers
339 views

ArcPy Field Calculation with special characters

I'm trying to calculate a string field, using "µSv/h". Running this in the manual field calculator works just fine, but I've tried this in the Python window in ArcMap as well as the IDLE, but both ...
2
votes
2answers
283 views

Python Code: “Compare two fields and select missing records”

The code I wrote is not right!! It's selecting more than what is actually missing. I think I'm wrong on the matched code line. I need the script to make a list of the "FLAG" field and a list of the ...
1
vote
2answers
222 views

Polyline will not turn into a feature layer via MakeFeatureLayer_management (arcpy)

I've got a python script that is connecting a sequence of points to make lines (script is based on answers to my previous question). To attempt to make subsequent processing more efficient, I would ...
6
votes
1answer
431 views

How to add layer with ArcPy and retain feature class metadata (like Credits) in layer properties?

I have multiple feature classes in a geodatabase, each feature class has metadata including a Description, Credits, and other information. If I use the 'Add Data' button in ArcMap 10.1 to add one of ...
1
vote
1answer
250 views

mosaic raster to file geodatabase yields missing raster sections

Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working ...
1
vote
1answer
70 views

Feature to Line on feature selections with ArcPy

I'm trying to collapse parallel polylines (dual carriageways in a shapefile of roads) to single centrelines. I'm aware of cartography's dual lines to centerline tool, but I find Feature To Line (Data ...
2
votes
0answers
460 views

Fixing “spatial index grid size is invalid” without Recalculate button

I've got a python script that is connecting a squence of points to make lines, and putting them into a feature class (based on answers to my previous question). It works wonderfully on a small area ...
2
votes
2answers
246 views

Errors using SelectLayerByAttribute in ArcPy

I cannot for the life of me persuade SelectLayerByAttribute to work (I need to automate this for a complex script). Working in ArcMap's python console on already loaded shapefile, the format below: ...
2
votes
1answer
114 views

Reporting Engines used with ArcGIS Server

I'm curious what others are using to build the more elaborate reports out of ArcGIS Web API apps? By elaborate I mean ones that include lots of dynamic charts and tables, multiple maps/data frames ...
0
votes
1answer
364 views

Can an arcpy.da.SearchCursor be used on a dataset residing in a ParcelFabric?

I'm using ESRI's LocalGovernmentMI.gdb data model and am managaing parcel data in a ParcelFabric dataset. I'm trying to use a search cursor on the ParcelFabric_Parcels dataset but I recieve this ... ...
8
votes
1answer
163 views

Difference between python window and toolbox

Are there differences in performance or other potentially critical area between running a python script in the python window versus running it from the toolbox in ArcGIS 10.0? I am asking in cases ...
1
vote
2answers
76 views

Select individual lines from feature class, convert to unique rasters: “raise e” error?

I have a feature class with 5 lines in it, and need select each one and turn them into its own raster -- for example, line 1 is raster 1, line 2 is raster 2, etc. This is the python script: import ...
2
votes
2answers
347 views

Run Python child script using Python Add-In button class?

I have a Python script which I want to execute using Python Add-In button class. Right now, I am using following: class child(object): """Implementation for Toolbar_addin.button2 (Button)""" ...
13
votes
1answer
292 views

Watermarking photos using their geotag and create a shapefile

I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates. Does anyone know of any ...
0
votes
1answer
397 views

UnboundLocalError: local variable referenced before assignment

I have following simple function to get percent values for different cover types from a raster. It gives me following error: UnboundLocalError: local variable 'a' referenced before assignment which ...
0
votes
0answers
185 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
1
vote
1answer
571 views

How to use CURRENT map document in Python tool?

I am attempting to use this code in a tool that I am working on: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] XMIN = df.extent.XMin YMIN = df.extent.YMin XMAX ...
2
votes
2answers
264 views

Create line from two points, two different feature class

I'm attempting to automate this in ModelBuilder in ArcMap. I have one feature class with one point (Start) and one feature class with multiple points (Destinations). I want to iterate through the ...
4
votes
2answers
179 views

Accessing arcpy functions from IronPython

I made a few python scripts to automatically optimize and publish my data.. Now i'm thinking about writing a .NET program to manage and run these scripts: the obvious way is invoking them in a ...
0
votes
1answer
602 views

How to insert values from one table into another?

I am trying to write a script that iterates through each row of a table, calculates for this row something. The result of this calculation is finally stored in another table (with just one row). Now I ...
3
votes
1answer
148 views

How to make multivalue input script run from a toolbox?

I have a working python script: import arcpy sdeconnection = arcpy.GetParameterAsText(0) layerfiles = arcpy.GetParameterAsText(1).split(";") for layerfile in layerfiles: print layerfile lyr ...
2
votes
1answer
197 views

How to read XY, get raster value and then update field?

I've written a script to run through a point layer, using the SearchCursor in the data access module and then read the XY values. Within the with statement, I then use GetCellValue to get the ...
1
vote
1answer
117 views

Problem with calculating the total cell values

aa= arcpy.RasterToNumPyArray("water_depth") sum = numpy.sum(aa) print sum -2933737 Why I am getting negative values ? In my raster there is no any negative ...
2
votes
1answer
200 views

Arcpy Network Analyst solver error

Hello GIS Stack Exchange, I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem. I'm also having some trouble debugging my ...
0
votes
0answers
28 views

using python and arcpy , how can I compute the direction and angle of a line segment? [duplicate]

if start_point_x < end_point_x and start_point_y > end_point_y: slope = ((end_point_y - start_point_y)/(end_point_x - start_point_x)) radian = math.atan(slope) degrees = ...
2
votes
0answers
114 views

Different results from Spatial Analyst GP Tool and Python

I am writing a script that has to subtract one raster from another. The rasters I have represent 1) Parking Lots (1 = Parking Lot, 0 = not Parking Lot) and 2) a buffer around the Parking Lot (1 = ...
0
votes
1answer
154 views

arcpy.setValue for Condition from Dictionary

Hi: I am trying to create a function to update multiple fields based on different criteria. I want to pass the field name and condition thru' a dictionary (please see the function description in the ...