<?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: Is it possible to filter based on an extent? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018320#M71438</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;- I was able to only get the features I really need.&lt;BR /&gt;Though, the other features still show up. As far as I understand I already receive them in the "map image". How can I filter it before it even renders in the gis service?&lt;/P&gt;&lt;P&gt;As you might guess, I'm kind of a gis newbie - so it's possible that I'm missing a core concept.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2021 14:28:43 GMT</pubDate>
    <dc:creator>sandrooco</dc:creator>
    <dc:date>2021-01-20T14:28:43Z</dc:date>
    <item>
      <title>Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018281#M71436</link>
      <description>&lt;P&gt;After regularly using this forum as silent reader, I finally came to the point that I had to create my own post (thanks for all your help in the past! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;).&lt;/P&gt;&lt;P&gt;I'm trying to filter a layer based on an extent. Every feature that is in the extent should be loaded/displayed, the rest shouldn't.&lt;BR /&gt;Example from the screenshot below: Only the labels with the "origin" point inside the orange polygon should be displayed. "Richtung Pfäffikon SZ" and "Richtung Zürich / Meilen" should &lt;STRONG&gt;not&lt;/STRONG&gt; be displayed. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-01-20 at 13.26.26.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4136iCE9A6ED0D0FA83AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-01-20 at 13.26.26.png" alt="Screenshot 2021-01-20 at 13.26.26.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think this would be possible with adding an attribute on these items' table, right? My problem is that this should be dynamic and I don't really want to go add this attribute/add a value for around 1M items in total.&lt;/P&gt;&lt;P&gt;This is why I thought about a possibility to tell the layer "load only the stuff in the given geometry". I coulnd't find anything like this in the docs and reference - maybe I'm just looking for the wrong words.&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 12:27:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018281#M71436</guid>
      <dc:creator>sandrooco</dc:creator>
      <dc:date>2021-01-20T12:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018312#M71437</link>
      <description>&lt;P&gt;Welcome! When executing a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html" target="_self"&gt;query&lt;/A&gt;, you can specify&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry" target="_self"&gt;geometry&lt;/A&gt; to use as a spatial extent (intersect) for the results. &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query-geometry/index.html" target="_self"&gt;Here's a sample.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:18:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018312#M71437</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-01-20T14:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018320#M71438</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;- I was able to only get the features I really need.&lt;BR /&gt;Though, the other features still show up. As far as I understand I already receive them in the "map image". How can I filter it before it even renders in the gis service?&lt;/P&gt;&lt;P&gt;As you might guess, I'm kind of a gis newbie - so it's possible that I'm missing a core concept.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018320#M71438</guid>
      <dc:creator>sandrooco</dc:creator>
      <dc:date>2021-01-20T14:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018330#M71439</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/index.html" target="_self"&gt;Check out this sample&lt;/A&gt;. The quakesLayer FeatureLayer is defined with&amp;nbsp;visible: false so it doesn't display in the map. Then, the section at the end with the last three functions section of code is what queries the quakes and displays them.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// query for earthquakes with the specified magnitude
// within the buffer geometry when the query button
// is clicked
queryQuakes.addEventListener("click", function () {
  queryEarthquakes().then(displayResults);
});

function queryEarthquakes() {
  var query = quakesLayer.createQuery();
  query.where = "mag &amp;gt;= " + magSlider.values[0];
  query.geometry = wellBuffer;
  query.spatialRelationship = "intersects";

  return quakesLayer.queryFeatures(query);
}

// display the earthquake query results in the
// view and print the number of results to the DOM
function displayResults(results) {
  resultsLayer.removeAll();
  var features = results.features.map(function (graphic) {
    graphic.symbol = {
      type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
      style: "diamond",
      size: 6.5,
      color: "darkorange"
    };
    return graphic;
  });
  var numQuakes = features.length;
  document.getElementById("results").innerHTML =
    numQuakes + " earthquakes found";
  resultsLayer.addMany(features);
}&lt;/LI-CODE&gt;&lt;P&gt;Notice the results are added to a GraphicsLayer called resultsLayer. That is defined earlier as&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var resultsLayer = new GraphicsLayer();&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Jan 2021 14:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018330#M71439</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-01-20T14:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018361#M71440</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;- this works really nice.&lt;/P&gt;&lt;P&gt;Follow up question: Isn't it bad practice to let the GIS server render the features when they won't even be displayed? Or won't they be included anyways if they are on visible: false?&lt;/P&gt;&lt;P&gt;Do you have an idea how to style the simple marker (prefferably even with an icon)?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018361#M71440</guid>
      <dc:creator>sandrooco</dc:creator>
      <dc:date>2021-01-20T16:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018362#M71441</link>
      <description>&lt;P&gt;Do you have a very simple codpen showing what you've tried so far?&amp;nbsp; What type of layer are we dealing with?&amp;nbsp; If the points are in a FeatureLayer (or MapImageLayer Sublayer) you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression" target="_self"&gt;definitionExpression&lt;/A&gt; property to define which features to retrieve and display.&amp;nbsp; If the filtering extent is defined dynamically you can use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds" target="_self"&gt;queryObjectIds&lt;/A&gt; to help you find the relevant features to show/hide.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:08:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018362#M71441</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-01-20T16:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018418#M71445</link>
      <description>&lt;P&gt;I'm not really sure how visible: false works on the back end of the API. I just tested this with the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayer-query/index.html" target="_self"&gt;Query features from a FeatureLayer sample&lt;/A&gt; by taking out visible: false where the&amp;nbsp;quakesLayer FeatureLayer was defined and removing the&amp;nbsp;quakesLayer from the&amp;nbsp;layers property where the map was initialized. The app still seemed to function normally. Do some experiments with your own app to be sure.&lt;/P&gt;&lt;P&gt;As for creating a symbol, check out the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/playground/index.html" target="_self"&gt;Symbol Playground&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 18:41:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018418#M71445</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-01-20T18:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018628#M71451</link>
      <description>&lt;P&gt;I don't have a codepen, the project is already quite large - sorry.&lt;BR /&gt;It's a Sublayer of a MapImageLayer. You mentioned definitionExpression - this only works for the table attributes, but not geometries right?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1018628#M71451</guid>
      <dc:creator>sandrooco</dc:creator>
      <dc:date>2021-01-21T10:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1226640#M79162</link>
      <description>&lt;P&gt;Hi Sandrooco,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do the same as you - filter a massive data set to only load the features in the extent I'm interested in. Did you have any success with using a definitionExpression to define the extent?&lt;/P&gt;&lt;P&gt;Many thanks, Espin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 15:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1226640#M79162</guid>
      <dc:creator>EspinBowder</dc:creator>
      <dc:date>2022-10-28T15:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to filter based on an extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1281609#M80936</link>
      <description>&lt;P&gt;I've kind of "solved" this by making another map in another div, that takes the position of a "hidden" graphical rectangle created by a SketchViewModel create function, and then overlaying it on top of my "main" map.&lt;/P&gt;&lt;P&gt;It's not particularly pretty, but it works, untill we can query a featureservice for polygons only within an extent.&lt;/P&gt;&lt;P&gt;This works because "an app" by default only shows features within an "app extent", which is defined by the map container, as I understand it.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 08:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-based-on-an-extent/m-p/1281609#M80936</guid>
      <dc:creator>post4k_dev</dc:creator>
      <dc:date>2023-04-22T08:51:04Z</dc:date>
    </item>
  </channel>
</rss>

