2
votes
3answers
77 views

How do I insert the string field and calculate it in Python?

Hello I am trying to insert a code that force a column Sum_Acres_ to add a comma to display like this 300,000 from 300000.456 Here is my sample I wrote from a ModelBuilder and export it to python. ...
1
vote
1answer
26 views

ArcObjects SQL Server Connection not recognizing instance

I am trying to make a connection to a SQL Server database with SdeWorkspaceFactory. This is from my Windows 7 x64 Desktop to a Network database. If I use this: SDEWorkspace = ...
1
vote
1answer
48 views

Writing multiple file geodatabase tables into csv file with arcpy

I was asking a question about Merging geodatabase previously, (link: Merge from arcpy.ListTables() producing duplicate rows?) and although the script worked, it took more than 9 hours to run when ...
1
vote
1answer
22 views

Writing list of feature classes with fields to one csv file per feature class?

I have a database with multiple feature classes. Now I extracted a list of feature classes and a list of fields. I figured out how to write the list of feature classes and the corresponding fields to ...
1
vote
0answers
56 views

How to extract NetCDF raster values to time enabled shapefiles?

Does anyone know a good way to extract NetCDF raster values to each data point from a time enabled shapefile at the correct time? I have tried using a python script tool and a loop that steps ...
0
votes
1answer
71 views

Extracting NetCDF raster values to time enabled shapefiles - what's wrong with my python script?

I'm trying to make a python script tool that extracts the values from a NetCDF raster to each data point from a time enabled shapefile at the correct time. My NetCDF raster consists of monthly sea ...
1
vote
1answer
56 views

Habitat fragmentation tool error

I am trying to calculate the habitat fragmentation of a forested region in Africa in order to protect the areas less fragmented. I have used the tool "Landscape Fragmentation Tool V2 requiring Spatial ...
0
votes
1answer
77 views

batch buffer with different distances with python 2.7 in arcgis 10.1

I am trying to write a "smart" way in Python to process multiple buffer to lines, polygons and points with different distances. I use Python and ArcMap 10.1. I can figure out to separate lines, ...
2
votes
0answers
45 views

How to use matplotlib with ArcGIS 10.1 without Microsoft Visual C++ Runtime Error?

I have problems using the matplotlib for python with ArcGIS 10.1 If I run the code below as a script tool in ArcMap. No pdf is generated and when I close ArcMap this error is shown. If I run the ...
1
vote
1answer
65 views

Find minimum elevation along a polyline and return xy or point?

Using ArcGIS 10.1 and Python IDLE 2.7.2... I'm trying to find the minimum value of a polyline with a raster layer and turn that LOCATION into a point. I put everything together in model builder, but ...
1
vote
0answers
56 views

How to create a circle vector layer with 12 sectors with Python and to save average value of underlying raster in each sector?

Hi I am writing a code with Python 2.7 using Arcpy 10.1 and I guess I am doing stuck with a silly problem that lies under my eyes. I have created a grid of points (with "Create fishnet" function) over ...
6
votes
1answer
324 views

Increasing speed of Python scripts using arcpy

Update 4/11/2014 It looks like the script was getting hung up on the Delete Features tool, so I switched to Truncate Table, as suggested in the answer below. I also removed the unused variables from ...
0
votes
1answer
25 views

How to map factors and their relative importance in ArcGIS 10.1 for Desktop?

I want to know how I can calculate a map from a set of factors (in the form of raster layers) and Their relative importance for example: slope 20% lithology 10% . . .
1
vote
1answer
28 views

How to Select by Location and assign attributes using Python?

I have a polygon layer with a 'lot' field, and a points layer. How can I use python to select the points by location (to find what points are contained in what polygons) and assign the value in the ...
0
votes
0answers
23 views

Reload Table Cache with Python & ArcGIS 10.1 [duplicate]

I am trying to create a button in arcmap that reloads the table cache. Exactly, like the existing button Table Options > Reload Cache. The button is inside when you open an attribute table. I would ...
5
votes
1answer
297 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...
1
vote
1answer
481 views

What might cause “python.exe has stopped working” when closing ArcPy script?

I created a script that take a .tab file and join it to a shapefile. The script works perfectly but when it finish, it gives me an unhandled exception which crashes python. I dont know what might be ...
3
votes
1answer
141 views

Can folder connection in ArcMap Catalog window be added using python?

I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
1
vote
1answer
93 views

3D roof polygon creation from polylines in ARCGIS 10.1

I am Working in arcgis 10.1,I would like to create roof polygons from lines, the lines are captured with photogrammetry technique. As per my requirement I have found tool "3D Building Generator ...
1
vote
0answers
126 views

Why do I get different results running a script in PyWin and loading it to the Python shell in ArcGIS? [closed]

I've been trying to teach myself Python scripting for ArcGIS and have gotten frustrated on multiple occasions when I try to debug my script endlessly, only to later find out that it actually works ...
1
vote
0answers
77 views

Why does Describe function fail on annotation layer with RuntimeError: Object: Describe input value is not valid type?

I am accessing layers in an mxd programatically and also accessing the layer properties using the Describe function lyr =arcpy.mapping.ListLayers(mxd) # gets me the list of layers in mxd desc= ...
4
votes
1answer
198 views

Why does ArcGIS 10.1 Upgrade Geodatabase tool throw ERROR 999999: Error executing function?

I am trying to upgrade File Geodatabases using a Python script that runs fine until the step where it runs the Upgrade Geodatabase tool. The error is: "ERROR 999999: Error executing ...
2
votes
1answer
59 views

ArcGIS 10.1 Upgrade Geodatabase Check Version

Hi I am trying to check the version of filegeodatabase before upgrading to 10.1, I have a list of file geodatabases and some of them are already in 10.1. Can anyone suggest me how to update only those ...
4
votes
1answer
88 views

ArcGIS 10.1 Anyway to make a script tool run immediatly upon opening

I have a script tool that creates an ArcSDE connection folder and copies data from the server to a new folder on the users computer. The tool has no parameters runs fine but when you open the tool it ...
1
vote
0answers
38 views

How to find out which layer had a Selection made on it? [duplicate]

If the user makes a select using arcpy.SelectByAttribute() or arcpy.SelectByLocation() how do you find out which layer they made the select so you can use arcpy.SearchCursor(layer)?
0
votes
1answer
78 views

Is there an event handler for a Selection being made using ArcPy?

I want to be able to capture an arcpy.SelectByAttribute() or arcpy.SelectByLocation() event being triggered. There doesn't seem to be an extension that is able to handle this. Is there a way to do ...
0
votes
0answers
25 views

ImportError: No module named arcpy - ArcGIS 10.1 and Python 2.7 [duplicate]

Traceback (most recent call last): File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict_ File ...
1
vote
2answers
235 views

How do you get all the results from a Selection made by Attribute or Location using ArcPy?

Using arcpy I'm trying to get the results of a selection, or what is currently selected as a list. Basically I'm attempting to build an addin which on click will either perform an operation where I ...
1
vote
1answer
163 views

Find Direction/Location of point in polygon using Python ArcGIS10.1

I have a point located inside a polygon, I want to determine its location or direction i.e. if it is in the northwest corner or southwest. I have the x,y of the point. Any idea on how to do this? I ...
0
votes
0answers
249 views

ERROR 001269 : Compressing the service definition failed.ArcGIS 10.1,Python 2.7

I am trying to publish an mxd using python script. I invoke this pyhton script from c# application, after creating the sddraft file, the system throws up this error "001269 : Compressing the service ...
1
vote
0answers
59 views

Insert last coordinates from a list of coordinates with line ID into a multipart polyline feature class

I'm having problems creating the last line from a list of coordinates that I have. I have a text file with coordinate data with a X, Y, and a Line ID (LID). I read the file and inserted each ...
3
votes
2answers
297 views

How to control state of buttons in Python Add-In?

I have bunch of buttons to perform separate tasks within a Python Add-In. Buttons are greyed out and required to be enabled after initial tools run. In the following example, tool1 is turned off after ...
1
vote
0answers
55 views

Convert List by Source to List by drawing order using arcpy

When I do some calculations, it results in adding a table to TOC which converts "List by drawing order" to "List by Source". I want to convert it back to "List by drawing order" using arcpy and I am ...
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 ...
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 ... ...
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)""" ...
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 ...
2
votes
2answers
296 views

Quick way to make a convex hull

I am using Python and ArcGIS 10.1. Is there a function or very quick way to extract points out of point feature class into an array without looping through a search cursor (as I have millions of ...
2
votes
2answers
384 views

Help with Python and adding a grouplayer to arc, renaming it from a folder name, then adding layers to it from that folder

I am trying to use os.walk to go through a directory tree, pull out all the .shp files in it, create a grouplayer in the mxd, rename the grouplayer the folder name, then add the layers from that ...
1
vote
1answer
311 views

Make Table View with field_info Output

I am using Make Table View to copy data from one table to a table view object and in the process hide and/or rename some fields. When I output the data to a dbf it hides and/or renames the fields ...
0
votes
1answer
321 views

Dissolving shapefile python script not working, syntax help please

I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just ...
2
votes
0answers
279 views

ArcMap runs custom script once and then it crashes on second run

So I made a script that takes data from an MSSQL database and inserts it into a featureclass. I added the script to a toolbox and am able to run the tool from within ArcMap 10.1. The problem is that ...
3
votes
2answers
319 views

Concatenate only when all fields to be concatenated have values

I have two fields that I want to concatenate. Field1 contains null values and Field2 has values for every record. I want to concatenate only when both fields have values. I tried using a function ...
3
votes
1answer
610 views

Import functions in python Add-In logic script

I am running into an error. I have a set of functions which I want to import in the python Add-In script at the time of execution, but when I built Add-In with "import stats" line then tools are ...
2
votes
1answer
93 views

How to declare folder name as global?

I have asked similar question at stackoverflow but posting here as well since it involves ArcGIS and python Add-In. Following code shows first step where i have to declare output folder as global so ...
3
votes
2answers
4k views

Read specific column and row value from a text file using Python [closed]

I have a text file as following: 1.25 177. 1.50 220. 2.00 272. 5.00 427. 10.00 556. 25.00 763. 50.00 916. ...
3
votes
2answers
566 views

How to draw rectangle to clip layers using python addin in ArcGIS 10.1?

I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any ...
0
votes
1answer
385 views

zonal histogram fails to create output table when looping

Using python I'm having problems when trying to attempt a FOR LOOP with the ZonalHistogram function of ArcGIS 10.1. It works fine if I use it only for one image but it gives me this error while for ...