Calculate Geometry using another spatial reference
We have some data in Web Mercator coordinate system, which is not very good for calculating geometry. So is there a way I can calculate geometry, such as line length using state plain coordinate...
View Articleperformance of SearchCursor and da.SearchCursor
I set up a comparison between SearchCursor and da.SearchCursor, the code is like this: Code: import arcpy, time shp = r"C:\Users\THINK\Desktop\python\Data\TOWNS.shp" #da SearchCursor sTime =...
View ArticleWhy would you import like this?
When putting a tool in a python script, I've always added a tool by putting the name of the tool, followed by an underscore and then the toolbox name like this: Code: import arcpy...
View ArticleDynamically Select Feature in Map with Python Addin
Hi guys, I'm trying to create a Python Addin to allow a user to dynamically select a feature in the Map Display Window in ArcMap, grab the ID of that feature and populate it in a variable, then select...
View Articlecopy features error in python and not modelbuilder
Code: import arcpy from arcpy import env arcpy.env.overwriteOutput = True arcpy.CopyFeatures_management("U:\GIS_Data\Geodatabase\TEST_2.mdb\lines\other_line", "U:\TEST_2.gdb\lines\other_line") Quote:...
View ArticleTrouble combining SelectLayerByLocation with an UpdateCursor. Please help!
Hi, First of all, I have been using ArcGIS 10 for a long time but I am a novice to using Python scripting. So please pardon my probably rather clunky code. What I would like to do for each feature is...
View ArticlePython Addins with comtypes/ArcObjects and Undo/Redo
I believe there is a simple solution to the following dilemma. Any insights/solutions would be greatly appreciated! I have several Python AddIns that edit features in versioned SDE feature classes. I...
View ArticleHow to iterate through unique values in a field name
I have a street atlas of our county in data driven pages (632 pages). I want to divide these up into mini atlases based on the fire district, so that I can give each fire department a mapbook of only...
View ArticleUse Sample feature to extract data
Hi, I tried to use the arcpy.Sample function of ArcGIS 10.1 to extract data from two rasters. The command line is Sample([smoothedDEMfile,DEMfile],septictankfile,"table2"), which is similar to the one...
View ArticleHow to convert a Google Spreadsheet to a .csv file with Python
I am working with a google spreadsheet that shows active big foot sightings data. What I am trying to do is convert the google spreadsheet to a .csv file so that I can then use geoprocessing tools...
View ArticleError of using Sort function
I try to use the Sort function (located in the ArcToolbox->Data Management Tools ->General) to sort a table for its specific field,, but had an error as follows: If the sorted table is saved...
View ArticleHow to extract points with specific attributes from shapefile?
Hey all, So I have a point shapefile consisting of 5 columns (ID, Description, X, Y, Z) and 99 rows. I already imported my shapefile into my python script. I need to extract points from my shapefile...
View ArticleHelp with Calculate Field Management
I have this code setup properly (or so I think...) but get ERROR 000989. It would indicate that my syntax in the expression and/or codeblock is incorrect but it works within Arcmap on a single field. I...
View ArticleProblemas al importar modulo arcpy al ejecutarlo como tarea
Hola, hemos implementado un proceso en python el cual queremos ejecutar como tarea programada, tal y como se ejecutarÃa desde la consola. > C:\Python27\ArcGIS10.1\python.exe c:\temp\test.py Si la...
View ArticleCreate multiple polygons in ArcGIS using Python and an XY table
Hi all, I have a X Y table with a single point in the lowerleft corner of a polygon and need to create a polygon layer from this table. I can make one polygon using a script, however, I don't have all...
View ArticlePython Script and Hyperlinks
Hello! I am wondering if anyone knows anything about the possibility of writing a script/model for hyperlinking multiple links to a geographic area. I am working on a project for a small city that...
View ArticleEasiest way to set results in Shapefile or Spreadsheet output?
Hey all :D! Ok so, as an amateur Python user, my first Python script finally works properly! :D EXCEPT for the last part! I have been trying to use different functions and codes in order to set my...
View ArticlePython Email on Error
Anyone written python email code that sends an email if the python script fails?
View ArticleCreating Point Feature Class from Fields in Table
Hi everyone one, I wrote a script that searches Tweets and writes them to a table in a geodatabase. I got this to work finally, and now I would like to map out the tweets that have a location attached...
View Articleget raster properties of each raster in mosaic dataset
Hello, i have the following problem. i have a mosaic dataset with many raster data in it. Now, i want to address the properties of each raster dataset in this mosaic. i need to do this, because i want...
View Article