<?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: Optimization of GeoJSON layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308797#M81712</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;mentioned above you can use the GeoJSONLayer.customParameters if the &lt;STRONG&gt;CQL_FILTER&lt;/STRONG&gt;&amp;nbsp;is part of the url query. If it is then you can set the customParameters after the GeoJSONLayer is initialized. You also have to call the GeoJSONLayer.refresh() method once you set the customParameters.&lt;/P&gt;&lt;P&gt;Please take a look at this sample:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-geojson-refresh/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/layers-geojson-refresh/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 20:29:42 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2023-07-17T20:29:42Z</dc:date>
    <item>
      <title>Optimization of GeoJSON layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308539#M81704</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I hope all of you are fine and doing best in your domain. I need a suggestion regarding the mentioned subject.&lt;BR /&gt;&lt;SPAN&gt;I have a PostgreSQL database with the PostGIS spatial extension to store spatial records. Additionally, I am using GeoServer as a mapping server, which directly connects to the database and retrieves the data in GeoJSON format. On the client-side, I am utilizing the ArcGIS API. However, I am facing performance issues as the map takes a significant amount of time to render the &lt;FONT size="4"&gt;&lt;STRONG&gt;100k&lt;/STRONG&gt; &lt;/FONT&gt;records. Compounding the issue, I have a complex symbology setup, which I describe in code snippet.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With complex expression, I am facing challenges in reducing the response time of the &lt;EM&gt;GeoJSONLayer&lt;/EM&gt;. One possible solution is to use the &lt;STRONG&gt;CQL_FILTER&lt;/STRONG&gt; method provided by &lt;EM&gt;GeoServer&lt;/EM&gt;, which allows me to retrieve only the specified query records. However, the limitation of this approach is that I cannot update the &lt;STRONG&gt;CQL_FILTER&lt;/STRONG&gt; &lt;EM&gt;(Geojson&amp;nbsp;URL)&lt;/EM&gt; in an existing layer view without creating another instance of the &lt;EM&gt;GeoJSONLayer&lt;/EM&gt;. This can be time-consuming and inefficient when working with a large dataset like the 100k records I have.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Another approach I have tried is using the &lt;STRONG&gt;definitionExpression&lt;/STRONG&gt; method of the &lt;EM&gt;GeoJSONLayer&lt;/EM&gt;, but it fetches all the records from the server before applying the filter, resulting in longer load times for the 100k records&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please provide guidance on any possible solutions to resolve this issue. I am looking for ways to optimize the response time of the &lt;EM&gt;GeoJSONLayer&lt;/EM&gt;.I would appreciate any suggestions on how to address this challenge.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kawish&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const { customer } = this.context.view;
    const name = "$feature.alarmstate";
    const cat = "$feature.category";
    const week = "$feature.lastdowntime";
    const ticketStatus = "$feature.ticketstatus";

    let valueExpression = `When( 

                ${name} == 0 &amp;amp;&amp;amp; ${cat} == 'VIP', 'zero',
    
                ${name} == 1 &amp;amp;&amp;amp; ${cat} == 'VIP', 'one',
    
                ${name} == 2 &amp;amp;&amp;amp; ${cat} == 'VIP' &amp;amp;&amp;amp; ${week} &amp;gt;= '${complete_date}', 'two',
    
                ${name} == 2 &amp;amp;&amp;amp; ${cat} == 'VIP' &amp;amp;&amp;amp; ${week} &amp;lt;= '${complete_date}', 'two_1',
    
                ${name} == 3 &amp;amp;&amp;amp; ${cat} == 'VIP', 'three',
        
                ${name} == 4 &amp;amp;&amp;amp; ${cat} == 'VIP', 'four',
                
                ${name} == 2 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${week} &amp;lt;= '${complete_date}' &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 'two_1_not_vip',
                ${name} == 2 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${week} &amp;lt;= '${complete_date}' &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-two_1',
                
                ${name} == 2 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${week} &amp;gt;= '${complete_date}' &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 2,
                ${name} == 2 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${week} &amp;gt;= '${complete_date}' &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-two',
               
                
                ${name} == 0 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 0,
                ${name} == 0 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-0',
    
                ${name} == 1 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 1,
                ${name} == 1 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-1',
    
                ${name} == 3 &amp;amp;&amp;amp; ${cat} != 'VIP'  &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 3,
                ${name} == 3 &amp;amp;&amp;amp; ${cat} != 'VIP'  &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-3',
    
                ${name} == 4 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} != 'In-process', 4,
                ${name} == 4 &amp;amp;&amp;amp; ${cat} != 'VIP' &amp;amp;&amp;amp; ${ticketStatus} == 'In-process', 'c-4',
                5
                )`;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 08:59:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308539#M81704</guid>
      <dc:creator>kawishabbas</dc:creator>
      <dc:date>2023-07-17T08:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization of GeoJSON layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308704#M81707</link>
      <description>&lt;P&gt;Are you using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#customParameters" target="_self"&gt;customParameters&lt;/A&gt; object to specify your CQL_FILTER value?&amp;nbsp; My understanding is that you should be able to update this value without having to create a whole new layer object.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 17:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308704#M81707</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-07-17T17:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization of GeoJSON layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308797#M81712</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;mentioned above you can use the GeoJSONLayer.customParameters if the &lt;STRONG&gt;CQL_FILTER&lt;/STRONG&gt;&amp;nbsp;is part of the url query. If it is then you can set the customParameters after the GeoJSONLayer is initialized. You also have to call the GeoJSONLayer.refresh() method once you set the customParameters.&lt;/P&gt;&lt;P&gt;Please take a look at this sample:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-geojson-refresh/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/layers-geojson-refresh/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 20:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/optimization-of-geojson-layer/m-p/1308797#M81712</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-07-17T20:29:42Z</dc:date>
    </item>
  </channel>
</rss>

