Quantcast
Channel: Forums - Python
Browsing all 2485 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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 Article


ddp.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 Article


ERROR 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 Article

iterate 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 Article

The 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 Article


SetNull 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 Article

Selecting 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 Article

Shapefile 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 Article


Debug 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 Article


Question: 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 Article

Calculate 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 Article

Apostrophe 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 Article

Boundary 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 Article


Image may be NSFW.
Clik here to view.

Customize 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 Article

Image may be NSFW.
Clik here to view.

Clearing 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 Article


current 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 Article

I 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 Article


in-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 Article

I 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 Article

Copying .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
Browsing all 2485 articles
Browse latest View live