6

I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number.

In the case of the sample included, 18-385 is the lot being exported. Pieces of several other neighboring lots are also printed.

What I would like to do if possible is format the label of the lot being exported different from the neighboring lots.

The first picture is what I have so far, and the second picture is what I would like to do.

  • I am very new to ArcGIS.
  • I'm doing the exports in the Geoprocessing->Python box. I don't know yet how to get to a full IDE where I can save code.
  • I'm using ArcGIS 10.1

If it helps, here's the code I'm using.

mxd = arcpy.mapping.MapDocument("CURRENT")
ddp = mxd.dataDrivenPages
basePath = "C:\\Downloads\\Dev\\ArcGIS\\Fulton\\" 
for pageNum in ddp.selectedPages:
   mxd.dataDrivenPages.currentPageID = pageNum
   distNum = mxd.dataDrivenPages.pageRow.DistNum
   savePath = basePath + distNum
   fileName = savePath + "\\" + mxd.dataDrivenPages.pageRow.DistPage + ".png"
   print fileName
   if not arcpy.os.path.exists(savePath):
      arcpy.CreateFolder_management(baseDir,dirName)
   arcpy.mapping.ExportToPNG(mxd, fileName,resolution=300)
del mxd

What I have: What I have

What I want: What I want

8

There isn't a really an elegant way to do this, as far as I know. However, I've recently successfully accomplished something similar using multiple copies of the layer and using Page Definitions.

Here's the basic idea, and you can modify it to suit your needs:

The layer which defines your Data Driven Pages should show the symbology but no labels. Then, you can have two separate copies of the layer which would have no symbology. One of them will label the lot you want and the other will label the surrounding lots. In order to define which ones get labeled, go to Layer Properties, and on the Definition Query tab, select Page Definition:

enter image description here

Then, on the layer that will label the surrounding lots, set it to show features that don't match the page name. You'll have something that looks like this:

enter image description here

Similarly, for the lot you want to label in red, you'll have something like this:

enter image description here

There are other variations you can do as well, such as running your Data Driven Pages from a layer that is actually turned off. Then, you can set the symbology of the lot you want to focus on to be a thicker outline, or a different colour to help it stand out.

Note, this should all be set in your MXD. Then your code should work the same.

3
  • 1
    I have done this as well. As good practice now I normally use a "turned off" version of the layer as the ddp source, then anything with the labels, page definitions, symbology etc I set on a copy of the ddp layer (or two copies, depending on the project). I find it easier that way, so I know at a glance LOTS DDP is the ddp source while LOTS contains the actual visible features. Nov 25 '13 at 5:29
  • Sorry didn't notice I had a reply. That sounds like it'll work. I'll give it a try. Thanks. Dec 3 '13 at 2:39
  • My system keeps crashing when I try this. Not sure if it's a bad install, or the system memory issues I know I have. I'm not on the project anymore so I'm not going to spend my time on this right now. But I will go ahead and mark your answer as accepted since I think that will work. Thanks. Dec 19 '13 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.