Python script changing ArcSDE data source not updating all MXDs?
We recently made significant changes to our ArcSDE database setup by splitting our original database into five databases and renaming most of the feature sets. Right now I have a script that opens all...
View ArticleCreate a Loop for Arcpy
I am looking for help to write a loop a arcpy.CalculateField_maagement process where the User is asked with the ‘raw_input’, prior to the tool running “Do you need to change a field value(yes/no):”, if...
View ArticleParameter to script tool gives Invalid expression ERROR 000358?
I have created python script tool in arcgis 10.1 as below. I am trying to take input parameter and passing to select statement. There is error when i execute this tool. import arcpy from arcpy import...
View ArticleMoving a Map Service Group Layer out of a Group Layer with ArcPy
I am struggling to move web services (tiled basemaps) out of group layers into the data frame. I’ve used arcpy.mapping.ListLayers to compose a list of layers, then I’ve ascertained what is a group...
View ArticleChanging Mosaic Dataset Properties in Map Document using ArcPy?
Does anyone know if it is possible in ArcGIS 10.3 for Desktop to access and change mosaic dataset properties within a map document using ArcPy? I am trying to write text into the symbology description...
View ArticleProper syntax for Select Feature Layer by Location
Can someone let me know how I can use a single feature from one layer as the “Select Features” when using the Make Feature Layer by Location tool with another layer as the input? In the code below I...
View ArticleHow to enter date with arcpy.GetParameterAsText with arcpy?
I want to allow users to enter a date as a parameter through a dialog window in a toolbox script. I have obviously defined the field with a “Date” data type but something is wrong with the formatting....
View ArticleCalculating lat/long in NAD 83 and NAD 27 using arcpy or modelbuilder
I have four double columns for lat/long with NAD 83 and NAD 27. The native projection of the data is in NAD 83, but the client want’s the attributes filled out for NAD 27 as well. I want to calculate...
View ArticleHow to add feature class to MXD with ArcPy (Python)? [duplicate]
This question already has an answer here: Adding shapefile or feature class as layer in ArcGIS Desktop using Python/ArcPy? 2 answers
View Articlescript to draw a square where the raster pixels contained within are a...
I have a raster containing different pixel values and I am interested in having squares drawn around areas that are at least X m^2 and containing at least Y type of pixels. The data looks like this, a...
View ArticleScript for selective dissolving of multiple features
I am kinda new to Python and arcpy and have done some basic online courses on this. So I do have an idea how these scripts are structured/written and how they work. Now I have to perform a seemingly...
View ArticleRead raster at request size through Python
I’m trying to read the raster (tif) file using Python. What I want is to read the raster at a specific request size rather than its original resolution. Example: If a raster has a cellsize of 5 x 5, I...
View ArticleArcMap 'in_memory' trouble?
Being new to ArcMap, and ArcPy I have a problem with a script including several geoprocessing functions. The number of functions inspired a search for a means to save outputs (subsequent inputs) to...
View ArticleUsing Arcpy to Update Data Source Does Not Update Related Tables
I have a python script that updates the data source of mxd’s from staging to production. Here is an example of the code: import arcpy mxd = arcpy.mapping.MapDocument(r"C:ProjectMyMap.mxd") for lyr in...
View ArticleField mappings object not functioning with Merge_management
I’m trying to limit the number of fields when I perform a merge to two. Below is the script I have created to do so. However, the merged feature class carries over all fields, despite my use of a...
View ArticleArcmap grid index feature
I have used the Grid index feature tool to create an index grid. The label/attribution of the page names are populated in a “row” orientated manner. eg lef to right a1,a2,a3,a4,a5,a6 b1,b2,b3,b4,b5,b6...
View ArticleCreate an array from field values in ArcPy
I have a feature class that has a field of unique ID numbers. I would like to create an array of these numbers so I can loop over them in ArcPy. Any ideas?
View ArticleSelect by attributes with user input using Python
I am new to GIS and Python is not my forte, so I am looking for some help. Ideally, what I am trying to do is create a tool that allows the user to select an address from my Address points layer. I...
View ArticleUpdate Cursor with Date Issue [closed]
My dates (maxDate, minDate, avgDate) all print out with the correct datetime format, but I am unsure if the problem is how the loop is written to update the cursor. Error: line 102, in updateRow return...
View ArticleArcpy Append doesn't work with tables
I am trying to get data from table A to table B. But it is important that domains in table B would remain. So I tried to use Append, but it doesn’t work with tables. Any ideas?
View Article