<?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: Grouping Large Quantity of Unique Values in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1201093#M78233</link>
    <description>&lt;P&gt;I tried a lot of different things, but I finally ended up creating a layer with a definitionExpression and its own simpleRenderer for each territory. It's less ideal than I'd like, but all territories do load on the map now, and I tried to somewhat encapsulate the repetition of making a layer and renderer and adding it to the map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 21:51:45 GMT</pubDate>
    <dc:creator>MollyWhitener</dc:creator>
    <dc:date>2022-08-09T21:51:45Z</dc:date>
    <item>
      <title>Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200556#M78217</link>
      <description>&lt;P&gt;I'm trying to create a map of our company's sales territories. The territories are organized by zip codes, so I'm using a feature layer that shows all zip codes, but I'm trying to use unique values to color each zip code according to which territory it belongs to. We have some 27K zip codes that we cover. Just sending in the whole array of all 27K zip codes seems to crash it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've had some luck if I create a separate renderer and feature layer for each territory, but I've only tried it with 3 of the 15 territories (attached pic). When I tried to create a renderer and feature layer for each territory using a forEach loop, this also crashed the map.&lt;/P&gt;&lt;P&gt;Does anyone have any idea of how I could accomplish this client-side? I considered making my own hosted layer, but since we use Azure SQL to manage our data, this is not ideal, nor do we have the zip code polygon coordinates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;symbolList: [
{
   symbol: {
      color:"crimson",
      type:"simple-fill"
   },
   value: "65564"
},
{
   symbol: {
      color:"crimson",
      type:"simple-fill"
   },
   value:"72644"
},
etc x 27,000...
]

 const zipRenderer = {
            type: "unique-value",
            field: "ZIP_CODE",
            uniqueValueInfos: this.symbolList
        }

const featureLayer = new FeatureLayer({
          url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Boundaries_2021/FeatureServer/3",
          renderer: zipRenderer,
          opacity: 0.4,
        });

map.add(featureLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200556#M78217</guid>
      <dc:creator>MollyWhitener</dc:creator>
      <dc:date>2022-08-08T20:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200571#M78218</link>
      <description>&lt;P&gt;It seems to me that if you broke the territories out into individual layers (like you already mentioned), but used a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html" target="_self"&gt;SimpleRenderer&lt;/A&gt; instead, you would get much better performance, since that would result in 15 symbols rather than 27,000.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200571#M78218</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-08-08T20:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200602#M78219</link>
      <description>&lt;P&gt;I'm not sure that will work since the zip codes don't always go in order&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":worried_face:"&gt;😟&lt;/span&gt; but it does load much more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 21:18:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200602#M78219</guid>
      <dc:creator>MollyWhitener</dc:creator>
      <dc:date>2022-08-08T21:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200611#M78220</link>
      <description>&lt;P&gt;Ok...I was assuming you already had it set up with each territory layer only having the expected features.&amp;nbsp; In this case, for each layer, you'd also need to filter only the features you want.&amp;nbsp; You can accomplish this by setting the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression" target="_self"&gt;definitionExpression&lt;/A&gt; and (possibly) the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fullExtent" target="_self"&gt;fullExtent&lt;/A&gt; properties.&amp;nbsp; If using only the definitionExpression, the smallest possible value could still become quite large.&amp;nbsp; Therefore, a possible alternative would be using the fullExtent to define the MBR for the features you want, and then using definitionExpression to remove the "extras", which could dramatically reduce the size of the definitionExpression.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 22:01:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200611#M78220</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-08-08T22:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200648#M78221</link>
      <description>&lt;P&gt;Are you able to add a new field to the table to indicate which sales area the zip code belongs to? How are you managing the data for which zip codes belong to each sales area? If you had a separate field for the area, you would only need to define 3 unique value infos and I would expect performance to work just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are unable to add a new field to the underlying data, you can also write an Arcade expression to return the sales area name/id based on the zip code value. This would be a large expression, but I imagine you could use the same logic you're currently using in JavaScript to set the colors as you do in the Arcade... This would also only require you setting up one symbol per sales area. This sample demonstrates how you could set up the classification with Arcade:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/visualization-arcade/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/visualization-arcade/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 00:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200648#M78221</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2022-08-09T00:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200649#M78222</link>
      <description>&lt;P&gt;I just re-read your post and now see how the data is managed &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;. You should be able to use Arcade in this scenario.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 00:25:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1200649#M78222</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2022-08-09T00:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1201093#M78233</link>
      <description>&lt;P&gt;I tried a lot of different things, but I finally ended up creating a layer with a definitionExpression and its own simpleRenderer for each territory. It's less ideal than I'd like, but all territories do load on the map now, and I tried to somewhat encapsulate the repetition of making a layer and renderer and adding it to the map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 21:51:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1201093#M78233</guid>
      <dc:creator>MollyWhitener</dc:creator>
      <dc:date>2022-08-09T21:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping Large Quantity of Unique Values</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1201094#M78234</link>
      <description>&lt;P&gt;I tried to use Arcade expressions, but since some of the territories cover 1,000+ zip codes, it was too difficult to use those. I also tried to host my territory info so I could do a dynamic layer, but I could not figure out how to upload a table with no geometry in it. Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 21:53:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/grouping-large-quantity-of-unique-values/m-p/1201094#M78234</guid>
      <dc:creator>MollyWhitener</dc:creator>
      <dc:date>2022-08-09T21:53:44Z</dc:date>
    </item>
  </channel>
</rss>

