<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get ClassBreaks in ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1332170#M10472</link>
    <description>&lt;P&gt;In ArcGIS Pro you don't have to define the class breaks manually anymore.&amp;nbsp; Instead, you simply specify the Classification Method.&amp;nbsp; &amp;nbsp;In the snippet below ClassificationMethod.NaturalBreaks is used.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;The Geodatabase API provides some functionality to get table statistics like standard deviation.&amp;nbsp; You can find some information here:&amp;nbsp; &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#calculating-statistics" target="_blank"&gt;ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal static Task CBRendererGraduatedSymbols()
{
  //Check feature layer name
  //Code works with the USDemographics feature layer available with the ArcGIS Pro SDK Sample data
  var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(f =&amp;gt; f.Name == "USDemographics");
  if (featureLayer == null)
  {
    MessageBox.Show("This renderer works with the USDemographics feature layer available with the ArcGIS Pro SDK Sample data", "Data missing");
    return Task.FromResult(0);
  }
  return QueuedTask.Run(() =&amp;gt;
    {
        GraduatedSymbolsRendererDefinition gsDef = new GraduatedSymbolsRendererDefinition()
        {                   
            ClassificationField = SDKHelpers.GetNumericField(featureLayer), //getting the first numeric field
            ClassificationMethod = ClassificationMethod.NaturalBreaks,
            SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol(CIMColor.CreateRGBColor(76,230,0)).MakeSymbolReference(),
            MinimumSymbolSize = 4,
            MaximumSymbolSize = 50,
            BreakCount = 5,
            ColorRamp = SDKHelpers.GetColorRamp(), //getting a color ramp
        };
        CIMClassBreaksRenderer renderer = (CIMClassBreaksRenderer)featureLayer.CreateRenderer(gsDef);
        featureLayer?.SetRenderer(renderer);
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find more about Renderers here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/Renderer" target="_blank" rel="noopener"&gt;arcgis-pro-sdk-community-samples/Map-Authoring/Renderer at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 21:39:09 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2023-09-25T21:39:09Z</dc:date>
    <item>
      <title>Get ClassBreaks in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1330215#M10421</link>
      <description>&lt;P&gt;I am working on migrating some ArcObjects code to ArcGIS Pro SDK .NET where we are extracting the natural class breaks using class break renderer sampling with a table histogram.&lt;/P&gt;&lt;P&gt;I could not find any references which I can use to convert/migrate the below mentioned code. Any help on this much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public double[] GetClassBreaks(string tableName, string fieldName, int noOfClasses) {
  object values;
  object frequencies;

  ITable table = getTable(strTable, false);
  ITableHistogram tableHistogram = new TableHistogramClass();
  IClassBreaksRenderer classBreakRenderer = new ClassBreaksRendererClass();
  IDataSampling rendererSampling = classBreakRenderer as IDataSampling;
  rendererSampling.MaxSampleSize = 10000000;
  tableHistogram.Table = table;
  tableHistogram.Field = fieldName;
  tableHistogram.Sampling = rendererSampling;
  IHistogram histogram = (IHistogram) tableHistogram;
  histogram.GetHistogram(out values, out frequencies);
  IClassifyGEN classify = new NaturalBreaksClass();
  classify.Classify(values, frequencies, ref noOfClasses);
  //return the breaks in an array of type double
  return (double[]) classify.ClassBreaks;

  return breaks;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 16:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1330215#M10421</guid>
      <dc:creator>sai_phaneendra</dc:creator>
      <dc:date>2023-09-19T16:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get ClassBreaks in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1332170#M10472</link>
      <description>&lt;P&gt;In ArcGIS Pro you don't have to define the class breaks manually anymore.&amp;nbsp; Instead, you simply specify the Classification Method.&amp;nbsp; &amp;nbsp;In the snippet below ClassificationMethod.NaturalBreaks is used.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;The Geodatabase API provides some functionality to get table statistics like standard deviation.&amp;nbsp; You can find some information here:&amp;nbsp; &lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geodatabase#calculating-statistics" target="_blank"&gt;ProConcepts Geodatabase · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal static Task CBRendererGraduatedSymbols()
{
  //Check feature layer name
  //Code works with the USDemographics feature layer available with the ArcGIS Pro SDK Sample data
  var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(f =&amp;gt; f.Name == "USDemographics");
  if (featureLayer == null)
  {
    MessageBox.Show("This renderer works with the USDemographics feature layer available with the ArcGIS Pro SDK Sample data", "Data missing");
    return Task.FromResult(0);
  }
  return QueuedTask.Run(() =&amp;gt;
    {
        GraduatedSymbolsRendererDefinition gsDef = new GraduatedSymbolsRendererDefinition()
        {                   
            ClassificationField = SDKHelpers.GetNumericField(featureLayer), //getting the first numeric field
            ClassificationMethod = ClassificationMethod.NaturalBreaks,
            SymbolTemplate = SymbolFactory.Instance.ConstructPointSymbol(CIMColor.CreateRGBColor(76,230,0)).MakeSymbolReference(),
            MinimumSymbolSize = 4,
            MaximumSymbolSize = 50,
            BreakCount = 5,
            ColorRamp = SDKHelpers.GetColorRamp(), //getting a color ramp
        };
        CIMClassBreaksRenderer renderer = (CIMClassBreaksRenderer)featureLayer.CreateRenderer(gsDef);
        featureLayer?.SetRenderer(renderer);
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can find more about Renderers here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/Renderer" target="_blank" rel="noopener"&gt;arcgis-pro-sdk-community-samples/Map-Authoring/Renderer at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 21:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1332170#M10472</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-09-25T21:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get ClassBreaks in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1413455#M11397</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;The suggested method worked for a featurelayer for getting the class breaks, is there a way we can determine the class breaks for a table ?&lt;BR /&gt;&lt;BR /&gt;The arcobjects code I shared used to work for both featureclass and table.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 12:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/get-classbreaks-in-arcgis-pro-sdk/m-p/1413455#M11397</guid>
      <dc:creator>sai_phaneendra</dc:creator>
      <dc:date>2024-04-22T12:08:29Z</dc:date>
    </item>
  </channel>
</rss>

