Arcpy.mapping is a Python scripting module that is part of the ArcPy site package.

learn more… | top users | synonyms (1)

0
votes
0answers
12 views

Panel plotting of raster images

I have never used panel plotting for raster images in TIFF format. Any ideas what would be a better module/library to panel plot raster images with examples?
0
votes
1answer
27 views

Problems with ApplySymbologyFromLayer

I'd like to use specific colors for my Unique Values. I tried creating another layer. choosing the colors that I want, and using the ApplySymbologyFromLayer. I also updated my new layer to make sure ...
0
votes
1answer
14 views

is it possible to export map as png without having the webmap JSON?

I want to export the image of a map from a page that I don't have a map available. In other words I need to call a service where I will provide the definition expression of a feature layer, retrieve ...
0
votes
1answer
41 views

Create Several Feature Layers and add them to a MXD

Every time I run this script now, I get an error on the line with the MakeFeatureLayer line. Sorry for all the questions! I'm really new to Python. import arcpy, os arcpy.env.workspace = ...
0
votes
1answer
61 views

ArcPy Script to update LYR data source not identifying all layers in folder

I've put together a script that for the most part works as intended - to walk through a series of folders, find SDE layer files and update their data source to direct connects if the layers support ...
0
votes
2answers
35 views

SaveToLayerFile failed - “value is not a layer”

Tried doing a SaveToLayerFile on a layer in a workspace, but it confusingly says it's not a layer. I know it is a layer because the script can access lyr properties (e.g. name) and all of the ...
1
vote
2answers
89 views

Using Python to export multiple layers to .pdfs

I have found a solution to the issue below. The problem had to do with coding GetParameterAsText without actually using it as an input in a tool. That was the reason the raster layers wouldn't turn ...
0
votes
0answers
43 views

Object: Createobject Layer Invalid Data Source

I'm using a tool made for ArcGIS, however I keep getting this error (see picture). I do not know any python code and I'm trying to get this script to run. # Import system modules import sys, ...
0
votes
1answer
20 views

Create KML from MXD that contains map service layers like feature layers

How can I create a KML (tools suggestion), provided that I have a map (.mxd) file which layers are service layers of hosted services and not local data coming from a geodatabase. I know that the map ...
0
votes
0answers
17 views

Retrieve locally the data of an mxd that are contained in sevice layers and recreate a new mxd with static data (not coming from service)

I want to get/dowload the data contained in a map service and recreate a new mxd file with static (not retrieved from a service) data. I am interested for data coming from feature and graphic layers. ...
0
votes
1answer
34 views

Arcpy:Set min height for contour area, with surrounding contour lines

I'm trying to create a tool that will calculate the min depth and the max depth of a contour polygon, based on the value of the depth attributes of the surrounding contour lines. This is what I have ...
0
votes
1answer
71 views

Looping through Layers, Add Layer to MXD, Export Image, Repeat, using ArcPy?

ArcGIS 10.2.2 I am trying to loop through a list of layers in a folder, add each layer to an mxd and export an image of the added layer. I have added arcpy.mapping.RemoveLayer to the script to remove ...
0
votes
1answer
41 views

Missing labels when using arcpy.mapping.ExportToPDF

I have a script that is run on a daily basis to export a folder of MXDs to PDFs and I have noticed some peculiar behavior. Many, but not all of the PDFs will be missing some labels or their label ...
0
votes
1answer
43 views

Map automation. Mapping same feature class – a map per data field (graduated symbols, customizable break values)

Map automation. Mapping the same feature class – a map per each data field (graduated symbols, customizable break values). I am trying to automate a mapping effort: I am mapping a (FC) features ...
3
votes
1answer
45 views

how to copy layer and add to same mxd and rename layer using ArcPy and ArcMap 10.2?

I am trying to copy a layer in an mxd and add that layer to the bottom of the TOC using Python, but I have not found a way to save the mxd programatically without making a copy. I also haven't found ...
0
votes
1answer
51 views

Get Path of File found with os.walk [closed]

I am trying to expose the full path of a file found using os.walk. The walk function is working correctly and is exposing all the files I want however when I try to get the path it looks like it is ...
0
votes
0answers
19 views

Exporting multiple map pages from list of apns

I use the code below to export two maps with different layers active for a single apn. The problem is I have a large list of APNs to go through so plugging in each apn at a time isn't really feasible. ...
0
votes
0answers
32 views

Symbology templates mess up colors and legend labels when used in Python script

I'm having issues when trying to symbolize a layer from a .lyr template using a python script. The templates work when imported in ArcMap as seen below: But when run with the following Python ...
1
vote
1answer
48 views

Error using arcpy.da.SearchCursor and MakeFeatureLayer

im trying to write a script that allows me to iterate through my map layers, and for each layer, iterate over each feature and add a field that gives the location of the feature using my index layer ...
1
vote
3answers
110 views

Programmatically adding .shp file to .mxd file

I have spent hours attempting to find the solution to the following problem online, but all answers I have found are quite old, and none work. Here is the situation: I have a variety of .shp files. I ...
1
vote
1answer
45 views

ApplySymbologyFromLayer works in ArcMap but not in python script

So the ApplySymbologyFromLayer_management() tool doesn't seem to like me, at least when I try to use it in a script. I have a Field_Boundary2.lyr file that has a "hollow" fill color and a black ...
0
votes
0answers
72 views

Output extent environment is not respected by Select Layer By Attribute (ArcGIS 10.2)

I cannot get the arcpy.env.extent working for Select Layer By Attribute GP tool. I can verify that I get various values for coordinates when I have panned to various areas on the map. Copy Features GP ...
0
votes
0answers
48 views

Training course for Fixing Data Sources

Is there any good training course or literature that pays some attention to automated processes for fixing map documents' data sources? Esri's little documentation on it is not helpful enough for me.
-1
votes
1answer
125 views

ValueError: Layer: Unexpected error from replaceDataSource()?

I'm trying to write a script that allows me to look through map documents and replace each layer's data source in each map document. Everything is working logically I believe, and all my loops are ...
0
votes
1answer
50 views

Layer still in map after running arcpy.mapping.RemoveLayer?

I'm trying to run a script that removes a group layer from a set of map documents, the code runs and the correct zone to be deleted prints out, However, when I check my map documents, the layer is ...
0
votes
1answer
128 views

AssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?

I'm trying to write a script that allows me to list the layers of each map document in a folder. However I keep getting this error after it displays the layers in the first map document: Traceback ...
0
votes
3answers
157 views

AttributeError: 'unicode' object has no attribute '_arc_object' from arcpy.mapping.ListLayers?

I'm trying to write a script that allows me to list .mxd files in a folder and then list the layers in each map document, however, I keep getting this error: Traceback (most recent call last): ...
1
vote
2answers
58 views

Best way to have title which includes dynamic text of a layer name?

What I'm currently working on: approximately 20 historical topographic maps of a specific area spanning 70 years. What I'd like to do: instead of saving each historical topo as a different file, I ...
1
vote
1answer
64 views

arcpy.mapping.MapDocument(“CURRENT”)

Can't share my script as geoprocesing service. The warning message: 00068 Script Script contains broken project data source: CURRENT Here is this part of the script, where the "CURRENT" mapping ...
0
votes
0answers
28 views

Meaning of AttributeError: 'module' object has no attribute 'da'? [duplicate]

error is : AttributeError: 'module' object has no attribute 'da' Code is below: import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection ...
2
votes
1answer
62 views

How do I import an ASCII grid using arcpy?

I'm trying to automate the setup of some flood depth/hazard maps. The user specifies a folder containing depth grids generated by a hydraulic model (.asc format) and some background mapping (geotiff ...
2
votes
1answer
96 views

MakeFeatureLayer weird behavior from script

I am trying to add a feature layer to my map document as the output from my python script. The goal is to limit the number of fields in the attribute table to a pre-defined list. I am able to add ...
0
votes
1answer
42 views

Assertion Error, Trying to add .tif to group layer

So I am trying to add a layer to a group, but running into problems most likely because of the file is a .tif. I have tried quite a few different iterations of this and looked at a few solutions but ...
1
vote
1answer
106 views

findAndReplaceWorkspacePaths does not work for sde files so as to change datasouce (geodatabase)

I manage to change my datasouce by right clicking on an mxd file and choosing a different sde database connection file as shown in the following image. However When I try to do this using arcpy ...
0
votes
1answer
40 views

Problem in adding raster layer from arcpy

I am using the following code to add the raster layer using arcpy in arcmap def AddRasterLayer(path,layerName): layer=os.path.join(path,'new'+str(layerName)+'.lyr') ...
1
vote
1answer
286 views

ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Layer Name or Table View: Dataset L does not exist

Hi I am trying to create a loop so that each layer is produced in its own map. This is my code: import arcpy path = "C:\Users\Et\Documents\ArcGIS\Default.gdb" mxd=arcpy.mapping.MapDocument(path ...
2
votes
0answers
40 views

A list of layer names that you want to be turned off when Layers name are in Right to Left Such as persian

When I ran this code I got "UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal" error I don't know why I tried many way but I ...
0
votes
0answers
38 views

Labels aren't displayed for layers inside a group

I'm using a python script to create an empty group layer in the current map document, add some layers to this group and update their symbology from an existing .lyr file. I also want to to turn on ...
2
votes
0answers
71 views

Validating whether PDF file Uploaded as part of Geoprocessing Service of ArcGIS for Server?

I'm developing a Python Script that will be a Geoprocessing Service in ArcGIS Server. The Script has a Button for Users to OPTIONALLY Upload a PDF. If the PDF is Uploaded it gets inserted into the ...
2
votes
1answer
38 views

Is there a a way to add a topology dataset to an mxd with arcpy?

I have a script that identifies certain layers from a folder containing several geodatabases. Part of the scripts purposes, or intended purpose is to have it add a topology dataset to the dataframe. ...
2
votes
1answer
85 views

Exporting layout elements and constants to Python script?

Is it possible to export the elements and constants used in a layout to a Python script? Something similar to creating a model and exporting it to Python but instead of being a model, it's a layout? ...
1
vote
0answers
64 views

How use DataFrame Geographic Transformation User Interface with ArcObjects?

I am bringing data from SQL Server into ArcMap with ArcObjects as a Query Layer. If I do this manually, a 'Geographic Coordinate System Transformations' UI pops up. I would like the same thing to ...
1
vote
1answer
77 views

Add annotation feature class to mxd with arcpy

From what I have researched, I'm pretty sure the answer is NO, but I want to make sure no one has found a work-around. Annotation feature classes in personal geodatabases need to be added to mxds. ...
1
vote
1answer
214 views

Conditional drop-down menu list in a python script tool

I have created a script tool from some python code, and in a previous question, I learned how to enable a drop-down list in this tool by changing the Validation code - see link and image below: ...
2
votes
1answer
85 views

Is it possible to create a data frame graphic using arcpy?

I'm interacting with an MXD using arcpy, and wish to create a graphic within a data frame - as with the Draw toolbar when working manually. The GraphicElement page says... The GraphicElement ...
2
votes
1answer
76 views

How do I rename rasters in an mxd by using my csv?

I have the following data in a csv: RasterName First name Raster 1 Aaron Raster 1 Paul Raster 2 Bryan Raster 3 Cranston Raster 3 Vince I have added these ...
0
votes
1answer
571 views

Copy Features giving ERROR 000210: Cannot create output in ArcPy?

I have an issue where I'm trying to save separate feature classes for each route in an already solved closest facility problem, and one seemingly arbitrary route won't save. I tried to look at the ...
1
vote
0answers
84 views

Script tool: Batch downgrade MXD version

I am trying to take the guts of this code (Batch convert ArcGIS 9x files to 10) and build it into a tool that we can more flexibly use and share around our organization. I think I'm almost there but ...
1
vote
0answers
42 views

Speeding up arcpy's TextElement.delete()

I'm making tables to go on data driven pages. For each page there are a series of tables that are produced. The elements of the tables are made using the clone method. The problem is that it takes ...
3
votes
0answers
15 views

List Joined tables

I've a question about arcpy List* modules. I have a quite large amount of data on SDE Server. Earlier I made a list of the feature classes , and tables in the mxd-s placed there using da.Walk and ...