Using Python Dictionaries with Update Cursors instead of "Join and Calculate"
Like many others, I have become frustrated with the amount of time it takes to use the "Add Join" tool and "Calculate field" tool to get values from one table into another while working with Python and...
View Articleddp.pageRow.fieldname Not working when index layer is joined.
Hi, i've been using the DDPwithDynamicTablesAndGraphs_10_v1 as the base for this script. In my test mxd everything works fine, but in that scenario the index layer is not joined to any other FC. When I...
View ArticleERROR 000824: The tool is not licensed. in arcpy.Contour_3d
I am using "arcpy.Contour_3d" and get an error, and review in detail the parameters and apparently all is well I hope you can help me thank you very much Code: # -*- coding: utf-8 -*- #...
View Articleiterate through paired values in dictionary
I have converted grid1 and grid2 into arrays using numpy and using following function which iterates through table and should return corresponding value form table when grid1 and grid2 values are...
View ArticleThe intersection of two polygons
Now I have two shapes of polygons, how to get the intersection area of them? I tried: interShp = Shp1.intersection(shp2), but it does not work. Thanks in advance.
View ArticleSetNull for multiple cases
Hello, I have two overlapping raster, x.tif and y.tif. I want to assign NoData to x.tif pixels that correspond to y.tif pixels whose values are 65, 17, 85, etc. The code below does this but I have to...
View ArticleSelecting a point with least distance using python code
Hi I have selected points of interest from my points layer using the "select by attributes" in ArcGIS. My points layer have a distance column. Now, out of my points selection, i want to then select the...
View ArticleShapefile to Geodatabase scripting?
Hi all I've built a model in model builder (9.2) and need to export the resulting output shape files into a Geodatabase within the same directory. Normally I would use the 'Feature class to...
View ArticleDebug python script under arcmap
Hi, When I run my Python script in ArcMap from my toolbox, I would start debugging ... how? I use PythonWin and also Python Tools for VS2010; I tried in VS2010 the command 'attach to process' but it...
View ArticleQuestion: How do I use arcpy to update the missing directory pathnames
We recently moved to Window 7 and in that conversion phase we had to move all our files off our C: drive and Network drives and our map files (.mxd) have missing pathnames. How do I use arcpy to update...
View ArticleCalculate Field based on Filename
Ok, this seems simple but I am havnig issues figuring out how to incorporate the filename aspect. I have a gdb with several Polyline feature classes. In each of these feature classes I have a SPECCODE...
View ArticleApostrophe in query
How can I make this query work? query = '"CLASS" = \'Z'berg Park\'' I know it is not working because of the apostrophe on the name. Any ideas on what I should change? Thanks
View ArticleBoundary Feature Class within Mosaic Dataset
All , How can i access the Boundary feature class within Mosaic Dataset using arcpy ? Is there a way to get it Thanks
View ArticleCustomize Date Picker for Python Toolbox Parameters
Hi all, I have a Python Toolbox that converts a file geodatabase table to a format useful in external analysis. However, I would like to be able to export a subset of data by selecting a specific date...
View ArticleClearing Arc/Arcpy workspace locks
Particularly with the release of ArcGIS 10.1 I have had a great deal of trouble with workspaces being locked within complex codes that are creating, reading from and writing to numerous feature classes...
View Articlecurrent extent in geographic coordinates using python
Here is my problem: I have been using the maptokml tool extensively. My map documents are not in geographic coordinates, nor are the other users map documents that I support. When I use the maptokml...
View ArticleI have 120 features class within a database "SDE"
I have 120 features class within a database "SDE" and I need to delete them except one. As I can do with python? Thanks Gualberto
View Articlein-process .da searchcursor question
I have a script that uses the arcpy.da.SearchCursor method. I am using v10.1 SP1. The script basically runs the SelectByLocation tool in a recurisive loop and identifies "spatial clusters" - that is...
View ArticleI have a list of 10 values of time, I need to add those values to a raster
I have a list of 10 values of time, I need to add those values to a raster formed by 10 rows, ie each value for each row being all different, as I do this using "calculatefield". Now add the time...
View ArticleCopying .shp to Personal Geodatabase problem- File name change?
Hi all I have written a small Python script in 9.2 which copies several shape files to a personal geodatabase within the same directory on C: The script runs and succesfully copies the shape files...
View Article