ArcPy(10.1) distanceTo using dynamic geometries?
I am struggling to get the arcpy point class method distanceTo to function with dynamically generated geometries with a Python addin. I have used the default tool addin function and set self.shape (in...
View ArticleClip_management to raster extent outputs larger raster than raster extent
Using Python and ArcMap 10.0 SP5, I’m trying to reproject and clip a large input raster to exactly the same grid as a smaller target raster (same extent, pixel sizes and projection). The problem is...
View ArticleHow to detect duplicate attribute values in a table using ArcPy
In ArcMap, the right-click Summarize option very quickly creates a frequency listing of the chosen field: Note that the count field shows the count of duplicate values. How can I access this using...
View ArticleHow to write raster field values into attribute table using ArcPy?
Is it possible to use ArcPy (10 or 10.1 )to write raster field types into a featureclass? either SDE or filegeodatabase?. I’m hoping to use arcpy as means of automating the process of adding rasters as...
View ArticleEditing (particularly flipping direction of) a polyline obtained through an...
I want to flip the direction of a polyline feature obtained as a result of an Update query; e.g. lines= arcpy.UpdateCursor(myFeatureClass,myQuery) dsc= arcpy.Describe(myFeatureClass) try: for ln in...
View ArticleArcpy Flip Line by Cardinal Direction
I am using linear referencing to travel a distance along the line and place a point offset in one direction or another. The only problem is that the data that has been provided isn’t to thorough. We...
View ArticlePython Delete point in a distance of x meters
I took this code from this source Select maximum number of points more than x meters apart It seems to work for other users, but for me it’s an endless loop. I do not understand why, though the code...
View ArticleHow to find features of certain name in multiple workspaces?
I have a similar issue to these threads: How to list feature classes in multiple geodatabases in a folder? How to list Feature Classes of Multiple geodatabase in Multiple Folder? However, I want to...
View ArticlePoints Solar Radiation reformat problem
I am trying to produce a set of monthly solar radiation maps based on a monthly parameterization of the diffuse proportion and transmissivity (i.e. new values for both parameters each month). The...
View ArticleHow to reduce the time for an 'Export to PDF' or any other alternative to...
For my work, I designed a tool to create PDF maps with large amount of data, intersected with 5 buffer rings using arcPY. The job involves intersecting points, selecting points, generating Elevation...
View ArticleArcpy Network Analyst solver error
Hello GIS Stack Exchange, I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem. I’m also having some trouble debugging my code....
View Articlehow to add a raw input to a SQL string?
I have this py script for selecting one point. # Within selected features, select only those points of a chosen value arcpy.SelectLayerByAttribute_management(“Stations”, “NEW_SELECTION”, ‘ “OID” = 465...
View ArticleARCGIS10: updatelayer results in error – LayerObject: Get attribute renderer...
I’m quite new in using python in Arcgis 10. I wanted to use the symbology of a geostatistical layer in the TOC in another geostatistical layer in the TOC. Therefore, one should use...
View ArticleShould Python Add-In installed in map which is packaged be part of *.mpk?
Using ArcGIS for Desktop 10.1 SP1, I just created a map package (.mpk) from a map (.mxd) which had a Python Add-In (.esriaddin) installed. When I unpacked the .mpk the .esriaddin was neither installed...
View ArticleArcPy SelectLayerByAttribute Error and how to control GP output layer name
I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I’ve been unable to figure out why the script will run...
View ArticleNeed help using FieldMappings object with Append_management in Python
I have a fairly large script that I’m reworking. The script is manipulating tables with 50 or so fields. (I will be cleaning some of these up to reduce the number.) Toward the end of my script I call...
View ArticleHelp writing script using a shapefile – select by attribute
I am trying to take an existing shapefile and narrow down the attributes using the ‘select by attribute’ The problem I am trying to solve is: Find parcels that have an acreage >= 100. The code I...
View Article“ERROR 000840 | The value is not a Relationship Class”
I’m stumped here. I’ve seen this error in other posts but not quite in the same context. I’m trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything I’ve...
View ArticleChecking if python script is run from ArcGIS (arcmap or on server) or a stand...
For debugging purposes I have created a hardcoded conditional that checks it the script is run as stand alone or as an ArcGIS tool. Is there anyway to fugure this out at run time? e.g. some environment...
View ArticleHow to save a copy of the current data driven page to a new map file?
I need to copy the current data driven page to a new ArcMap Document using arcpy so that I can make sure the file name follows the naming schema that we have defined and the user cannot change. Is it...
View Article