Hot answers tagged layers
A SearchCursor in arcpy is the most direct route for accomplishing this: import arcpy fc = "c:/data/base.gdb/roads" field = "StreetName" cursor = arcpy.SearchCursor(fc) row = cursor.next() while row: print(row.getValue(field)) row = cursor.next() Note that you can use the where_clause property to perform your selection.
First You should define the layers but do not add them to map. Then set map.baseLayer = your-layer then add all layers to map. OpenLayers add the first baselayer in map.baseLayer property but calls it only when add to map. So you can change the layer before being called.
In ArcMap - you could do the following: Select the polygon you want to copy. Open the Python window and type in the following code: cur,row = None, None cur = arcpy.SearchCursor("NAME OF THE LAYER HERE") x = 113 for row in cur: shp = row.getValue("SHAPE") cur,row = None, None cur = arcpy.InsertCursor("NAME OF THE LAYER HERE") for i in range(0,x): ...
I suggest you search the help file for the topic Layer (arcpy.mapping) as you actually want to be using saveACopy()! There is a subtle difference between save and saveACopy and how they behave depends entirely on how you got a handle on the layer. There is a code "Example 1" showing how it is done. The Desktop Help always provides code snippets, they are ...
Your problem is what the ArcGIS Network Analyst extension was designed for. An extensive tutorial exists which should get you started. A free training seminar is also available from ESRI: Training Seminar
I understand that you want to render a layer which has 8 fields, and each field can be categorized into 3 sub-categories. My first reaction to that would be: Are you sure? You have a maximum number of 3^8 ==6561 possible combinations of these sub categories. Much research has been done on how many colors can be distinguished by most people in a map, and ...
So I figured out the problem I was running into. I was accidentally entering 'item == item.longName' rather than 'item.name == item.longName' which was resulting in the same name rather than a different one. Here is the working code: import arcpy, re, os arcpy.env.overwriteOutput = True #loop through layers and save a copy def layer_save(mxd_path,path): ...
The Layer To KML tool only takes as input: The feature or raster layer or layer file (.lyr) to be converted to KML Consequently, you will need to use the Make Feature Layer tool first which Creates a feature layer from an input feature class [including shapefiles] or layer file.
Only top voted, non community-wiki answers of a minimum length are eligible