Select to view content in your preferred language

Need a solution

740
3
03-11-2014 10:09 AM
AndrewBardin
New Contributor
A am making hundreds of plat maps using parcel data. Many of the maps have several parcels per map. Each parcel needs to be a seperate color and I would like to use the same colors so the maps will have a standardized look. However the parcels are always different values so label files have not worked. I tried to add a field to my data, that denotes the parcels 1 through x and assigning the numbers 1 though 10 colors through a layer file, but then I would need to change the symbol description so that the parcel number will be listed with in the legend.

Once that is done I am exporting these maps to PDF. Essentially I would like to have a script that would automate the whole process from the data, and automatically export the maps. Everything seems do-able except the issue with not being able to use my own colors. Can anyone provide a solution or advice. Thanks
Tags (2)
0 Kudos
3 Replies
DouglasSands
Deactivated User
A am making hundreds of plat maps using parcel data. Many of the maps have several parcels per map. Each parcel needs to be a seperate color and I would like to use the same colors so the maps will have a standardized look. However the parcels are always different values so label files have not worked. I tried to add a field to my data, that denotes the parcels 1 through x and assigning the numbers 1 though 10 colors through a layer file, but then I would need to change the symbol description so that the parcel number will be listed with in the legend.

Once that is done I am exporting these maps to PDF. Essentially I would like to have a script that would automate the whole process from the data, and automatically export the maps. Everything seems do-able except the issue with not being able to use my own colors. Can anyone provide a solution or advice. Thanks



I've been in similar situations before. Unfortunately, I have bad news...


If you can create a single layer file based on the entire set of parcel maps, then you can do what you want. However the layer file must be created and saved first - your script will just reference it. If you want to create the layer colors dynamically for each map this is not possible because layer files cannot be created in arcpy and the layer symbology properties for colors etc are unavailable.

See this thread : http://forums.arcgis.com/threads/44502-Managing-Symbology-using-Python

And this post to ArcGIS Ideas: http://ideas.arcgis.com/ideaView?id=087300000008FolAAE

Good luck,
-Doug
0 Kudos
KimOllivier
Honored Contributor
Maybe you can make up a legend and convert it into graphic elements?
Then ungroup parts so that you can change the legend text.

Then you can edit the graphic elements in a Python script to match the parcels.

In effect you can fairly easily create your own custom legend if you are using data driven pages.

There are several tricks to using graphic elements, give them all a name so you can reference them.
Place a lot of copies off the page for each style and just move the required one on to the page as required,
say with different numbers of columns.

You need to be organised with a list of element names that are easy to iterate over from a list of parcels in the view.
0 Kudos
AdamCox1
Deactivated User
Here are the basic steps I've used to do something similar to this:

1. make 10 different layer files, each for a polygon with one your 10 different colors (or however many you'd like to have)
(set symbology on any polygon feature class in ArcMap to a simple color outline symbol and then right-click and "Save As Layer File")
2. place them all in the same folder and name them "color1.lyr", "color2.lyr", etc.
3. add a color field to each parcel feature and enter the desired color.
4. when adding layers to the TOC with python, use the value in the color field to set the definition query, or use the parcel number if you want separate layers for each parcel.  You can then name the layers with the parcel number.
5. use the value in the color field to construct the path to the correct layer file on disk and then use ApplySymbologyFromLayer

Dealing with the various layer objects in arcpy has been a little confusing to me, so be thorough and get ready for some trial and error.  I've found it necessary in some cases to use the Layer method to make the initial layer which will be added to the display, and then to use ListLayers to create a "layer as it appears in the TOC" object.

Hope this is helpful,
Adam
0 Kudos