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

learn more… | top users | synonyms (1)

0
votes
2answers
46 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 ...
2
votes
1answer
34 views

script to draw a square where the raster pixels contained within are a certain type and greater than X

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, ...
1
vote
1answer
144 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 ...
1
vote
1answer
91 views

Weird Error when setting the source path in the “PICTURE_ELEMENT”

I am trying to set the sourceImage to a tiff file using this code: m=1 pic = arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT" , str(m))[0] pic.sourceImage = ...
0
votes
1answer
23 views

Changing Field Visibility with Arcpy

I have the same problem stated here: https://geonet.esri.com/thread/98493 When I set the visibility of a field to HIDDEN, the field will not become hidden. l = arcpy.mapping.Layer("myLayer") desc ...
0
votes
1answer
21 views

Set polygon boarders to transparent in python

I am creating automated maps in ArcGIS with a similair Python Code which can be found here: Map automation to iterate through attribute table using ArcPy? I cannot find out on how to set the ...
0
votes
1answer
30 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
1answer
42 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
47 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
54 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 ...
0
votes
1answer
126 views

AddLayer method failing when script in ArcToolbox is run from ArcCatalog

I need a 2nd set of eyes to do a sanity check, as I am not been able to figure out why a script that runs fine in pywin, does not run properly as a tool in a toolbox. Below is the script that runs in ...
3
votes
0answers
36 views

arcpy, ExportToSVG using paths

I want to export part of the map into (very big) SVG file. First I tried to do this using REST API: https://*server*/ArcGIS/rest/services/General/Etages/MapServer/export. This worked, the SVG file ...
3
votes
0answers
17 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 ...
3
votes
0answers
84 views

Is it possible to access individual pages within an existing pdf using arcpy.mapping?

I've used the arcpy.mapping module for some time now to create mapbooks and other pdf documents, using a combination of Data Driven Pages and Python. I would like to take an existing pdf and save each ...
2
votes
0answers
48 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 ...
2
votes
0answers
80 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
0answers
57 views

Problem with adding mosaic layer via arcpy

I have a mosaic layer that I want to add to my map in ArcMap. When I add this layer manually (i.e the "Add Data" button), a raster image, a boundary, and a footprint are added to my table of contents. ...
2
votes
0answers
52 views

Difficulty in running the script

I have developed a script tool for adding a layer in the current map document. It did not work.. The message is "Completed script addlayer...". But there were no layers added in the TOC. Another issue ...
2
votes
0answers
302 views

Can not get text element to update?

I can not get text element to update? Text ELement has been added "Subdivision" Still not updating?.. class ButtonClass2(object): """Implementation for FemaMapper_addin.button (Button)""" def ...
1
vote
0answers
31 views

Arcpy change highlight property of a layer or table field

I need to highlight a field of a layer. With ArcMap it is accessed from Fields property page of a layer. From there one can reorder, hide and highlight the fields. I couldn't find a property or ...
1
vote
0answers
85 views

Update Data Driven Pages Index layer via Python

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
1
vote
0answers
58 views

Automating creation of ServiceDefinition from Python toolbox of ArcPy without broken project data source?

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
1
vote
0answers
82 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
0answers
107 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
48 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 ...
1
vote
0answers
317 views

Why is arcpy.mapping.ConvertWebMapToMapDocument slow?

We use arcpy.mapping for print tasks. The slowest part in workflow is arcpy.mapping function ConvertWebMapToMapDocument; it takes 10-12 seconds each time, doesn't matter if map is big or not. We use ...
1
vote
0answers
77 views

Convert List by Source to List by drawing order using arcpy

When I do some calculations, it results in adding a table to TOC which converts "List by drawing order" to "List by Source". I want to convert it back to "List by drawing order" using arcpy and I am ...
1
vote
0answers
267 views

arcpy ArcGIS Server

Could someone please help me by giving me an example on how to make/connect/Add ArcGIS Server connection via python/arcpy? Thank you in advance. I'm using ArcMap 10.0 I desire to "Use GIS Services" ...
0
votes
0answers
56 views

Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data

I'm using ArcGIS for Desktop 10.3.0.4322. I have a peculiar occurrence that I don't quite fully understand. I have a Python Script Tool that does a number of different things, to include using the ...
0
votes
0answers
39 views

Feature Services & arcpy.ConsolidateMap_management & .replaceDataSource

We have several in house published feature services, including some from our Esri Data Stores. When I use arcpy.ConsolidateMap_management on an mxd (10.1) the Feature Services are nicely consolidated ...
0
votes
0answers
54 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
0answers
22 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
0answers
25 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
45 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 ...
0
votes
0answers
109 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
49 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.
0
votes
0answers
45 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 ...
0
votes
0answers
119 views

arcpy.mapping.Export creates some labels but not others

I've created a simple python toolbox (pyt) to export map layouts to multiple formats. My problem is that some labels which are defined in the layout are exported, but others are not. For example ...