SaveToLayerFile_management accepts only features save on disk
I'm trying to use SaveToLayerFile_management to save layers (in an mxd) pointing to features in the server "Internet", but it doesn't work When I use ArcToolbox (SaveToLayerFile) it doesn't work...
View ArticleNDVI function in Python
Hi everyone! I want to know if it is possible to call the NDVI function that is inside the Image analysis window of Arcmap 10.1 from a python script. I have the following questions: 1. If it is...
View ArticleRound to nearest 100th
I am a little confused about how to round a field to the nearest 100th. Would I use math.ceil() or the round()? Code: math.ceil([field]/100)*100 Does this only round down though? Thanks
View ArticleHow to end a script tool so it ends correctly in 10.1
I've got a script tool that I wrote for 10.0 and I'm trying to make it work in 10.1 now. It does in fact work--I can go to where the output file is stored on disk, but the tool never returns anything....
View ArticleAdd field: error in executing tool
I am trying to add a field to all layers with multiple GDB's. Am I unable to collect a list of values and run addField tool on them? Code: import arcpy import os, math from arcpy import env...
View ArticleGetting ObjectID's using Fieldmapping in FeatureClasstoFeatureClass tool
I have field mapping working for all fields but when I try to pull the ObjectID's in I get an error message: "FieldMappings: Error in getting field map from field mapping for GetFieldMap" Here is my...
View ArticleError message even though script finishes with expected results.
I am working on a script trying to plot lines from csv point data file.. It all seems to work until the end where I get an error stating that the table is not found.. when I open the FC in the map...
View ArticleUse user input in Combo Box to perform a Definition Query
I'm nut sure which function (i'm assuming onEnter) to use and how to write the code to be able to get a users input ( type it in the text box of the combo box), hit enter and have it performe a...
View ArticleUpdate Cursor script that allows selectable field to be updated?
I've written a code that selects attributes one by one. As each attribute is selected a select by location is performed to identify how many records in the select by location file intersect with the...
View ArticleSkipping schema locked data
Hi, I am attempting to delete some features out of an SDE database and keep running into a schema lock on a particular feature. I am wanting my code to skip past this feature and keep deleting the...
View ArticleFinding tables related to a selected feature.
Hiya, I am trying to write a script that changes values in a table that has been related to a selected feature. Can this be done with arcpy? I cannot figure out how to find related tables.
View ArticlePython script to create a point WITH attributes values
I have coded up a Python script that determines the coordinates of where I need to create a new (calibration)point, but I can't work out how to add it to a feature class WITH other attributes. I can...
View ArticleHelp with Expression Syntax with two variables - SelectLayerByAttribute.
I am trying to create and expression that uses the value of the ELEVATION field in a feature class to select out a single feature and export it to its own feature class; essentially "ELEVATION" = 3...
View ArticlePing: curtvprice -- RE: USGS waterservices xml
Curt or anyone else that has experience with the USGS waterservices webservice, We have developed some Geoprocessing tools that are integrating the Instantaneous Values Web Service...
View ArticleModules for Dummy
I have been diving through Python this year and have gotten stuck at modules. I have four scripts that perform some awesome fixes for MXDs when there is a database change. However, I have to put the...
View ArticleUpdate a field based on date
How can I update a field based on if the date in another field has passed or not? In other words, which arcpy function or method can be used that will change an attribute from "current" to "expired"...
View ArticleAdd layer to map with Python Toolbox (.pyt)
I'm trying to add a layer to the current MXD using an arcpy toolbox (.pyt). When I execute the program it draws the entire layer then immediately dissappears from the TOC which basically returns to the...
View ArticleSelect features using geometry objects
Greetings, I'm writing some arcpy to select polygons that contain the centroid of my current data frame extent. Here's my code: Code: import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df =...
View ArticleErase tool: Cannot create output
Hello everybody, what follows are my very first steps in Python, so my mistake might be easy to find. I have 22 Shapefiles, some of the overlap and I want to clean this using the erase function on...
View ArticleLooking for ways to optimize painfully slow code:
We are trying to accomplish the following: 1. Water Mains have a Pressure Zone assigned to them depending on what zone they are located in. 2. The junction/point features (valves, fittings, etc.) have...
View Article