Select to view content in your preferred language

How to rewrite the minimum value of a symbol class in Arcpy?

433
5
01-29-2024 09:48 PM
-_-
by
Occasional Contributor

The image is from the "Use symbology histograms" page. How can I rewrite the value in the red circle with Arcpy?

 

GUID-2D15D045-D899-4C5D-9D21-CC971290C9C6-web.png

0 Kudos
5 Replies
AlexanderDanielPratama
Esri Contributor

From my experience, you cannot change the minimum value by arcpy. Neither are the other values of the histogram. If your aim is automation, you need a strategy for the output at least similar and you can apply the symbology using symbology tools or symbology parameters in the Script tool.

Hopefully it can help you.

Cheers   

0 Kudos
-_-
by
Occasional Contributor

Thanks for the reply.

In ArcMap, by rewriting the classBreakValues property of the GraduatedSymbolsSymbology class with a list, it was possible to make the first number the minimum value.
When using Apply Synbology From Layer, if there are features that are less than the minimum value of the original layer, they will not be displayed.
I was using a script that rewrites the minimum value to -1000000000 and the maximum value to 1000000000 so that it can be applied to a general range.

I would like to create a similar script in ArcGIS PRO.
Do you have any ideas for alternatives?

0 Kudos
AlexanderDanielPratama
Esri Contributor

I'd like to confirm, does your current script follow this documentation RasterClassBreak—ArcGIS Pro | Documentation

Based on my understanding of that documentation to change the value you must access it in arcpy.mp module. Go to the map, then to the layer. Next you can change the minimum value with its class break by looping it.

breakVal = 50
cv = 0
for brk in sym.colorizer.classBreaks:
    brk.upperBound = breakVal
    brk.label = "\u2264" + str(locale.format("%d", breakVal, grouping=True))
    brk.description = "Description " + str(cv)
    brk.color = {'HSV' : [cv, cv, cv, 100]}

    breakVal +=50
    cv += 40

 I just found this documentation recently. Hope it helps to address your issue. 🙂

0 Kudos
-_-
by
Occasional Contributor

The current script follows the ClassBreak documentation for GraduatedColorsRenderer. (Very similar to the document you provided)

https://pro.arcgis.com/ja/pro-app/latest/arcpy/mapping/graduatedcolorsrenderer-class.htm

https://pro.arcgis.com/ja/pro-app/latest/arcpy/mapping/classbreak-class.htm

 

The upperBound property can only be rewritten to the upper limit of the range. Therefore, in the range "0-10", if ClassBreak.upperBound is rewritten to "20", it becomes "0-20", so I am looking for a way to rewrite "0".
thank you.

0 Kudos
-_-
by
Occasional Contributor

https://community.esri.com/t5/arcgis-pro-ideas/setting-the-lower-limit-of-graduated-color-symbols/id...

In this article, I learned how to use python CIM access, so I would like to share it with you.
I hope this helps someone who is struggling with the same issue.

0 Kudos