Select to view content in your preferred language

reclassify clobbers symbols  and UpdateLayer clobbers classifications

3599
5
Jump to solution
09-18-2012 08:41 AM
AngieGreig
Deactivated User
I would like to use UpdateLayer to add the symbol styles but also use reclassify to set each layer to quantiles based on its data.
UpdateLayers clobbers the classifications and reclassify clobbers the symbols.  Is there something that I am missing?

    arcpy.mapping.UpdateLayer(df,lyr,srclyr)
    lyr.symbology.reclassify()

Thanks,
agreig
0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
Esri Regular Contributor
Thanks for providing the data/scipts.  I can reproduce the issue.  Layer.symbology.reclassify() is resetting both shape and outline properties but it is maintaining the colorramp colors.  For example, if the symbol loaded from UpdateLayer is a square with with NO outline color, the symbol gets changed to the default circle and the outline color/thickness returns to default when .reclassify() is applied.

The only work around I can think of is to NOT use .reclassify() and instead determine the breaks and labels using some scripting logic and then apply those values to the renderer via .classBreakValues and .classBreakLabels.

We will investigate this further and try to make a fix available as soon as possible in a service pack.

Thanks,
Jeff

View solution in original post

0 Kudos
5 Replies
JeffBarrette
Esri Regular Contributor
I'd like to learn more about your workflow.  Would it be possible to include screenshots?

The layer that you are using as your source layer must have the correct classification method.  You are not able to change classification methods using arcpy.mapping.  Reclassify essentially refreshes the layer against the source data (this is especially useful when using UpdateLayer).  If your classification methods are different I would expect things to get "clobbered".  You can always programatically control the breaks, labels, etc using arcpy.mapping.

Again, it would be nice to see more of what you are trying to do.

Jeff
0 Kudos
AngieGreig
Deactivated User
UpdateLayer Does exactly what I want.  It uses the lyr file to create 4 quantile classes and the desired symbols. 
reclassify Also does what I want. It bases the breaks on the data for that species but in doing so it reverts to the standard symbols.
How do I get both the correct breaks and the desired symbols.
[ATTACH=CONFIG]17807[/ATTACH][ATTACH=CONFIG]17808[/ATTACH][ATTACH=CONFIG]17809[/ATTACH]
0 Kudos
JeffBarrette
Esri Regular Contributor
Could you send me a map package, so I can give it a try?  Include the script and the layer file.

jbarrette@esri.com

Jeff
0 Kudos
JeffBarrette
Esri Regular Contributor
Thanks for providing the data/scipts.  I can reproduce the issue.  Layer.symbology.reclassify() is resetting both shape and outline properties but it is maintaining the colorramp colors.  For example, if the symbol loaded from UpdateLayer is a square with with NO outline color, the symbol gets changed to the default circle and the outline color/thickness returns to default when .reclassify() is applied.

The only work around I can think of is to NOT use .reclassify() and instead determine the breaks and labels using some scripting logic and then apply those values to the renderer via .classBreakValues and .classBreakLabels.

We will investigate this further and try to make a fix available as soon as possible in a service pack.

Thanks,
Jeff
0 Kudos
AngieGreig
Deactivated User
Thanks Jeff.
0 Kudos