<?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: Query a feature layer against another feature layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599878#M56097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh ok I didn't know that. I'll see if I can figure this out. thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2015 15:19:37 GMT</pubDate>
    <dc:creator>TimWitt2</dc:creator>
    <dc:date>2015-07-06T15:19:37Z</dc:date>
    <item>
      <title>Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599870#M56089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to query a point feature layer against a polygon feature layer. In ArcGIS Desktop this is very easy, just go to select by location and then query the point feature layer to see when it intersects with the polygon feature layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best approach to do this via ArcGIS Javascript API? I am trying to find an example but the closest I can find is this &lt;A href="https://developers.arcgis.com/javascript/jssamples/query_buffer.html" title="https://developers.arcgis.com/javascript/jssamples/query_buffer.html"&gt;Select with Feature Layer | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an example that uses 2 feature layers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 13:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599870#M56089</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-07-06T13:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599871#M56090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use two Feature layers instead of one, similar to same example like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function selectInBuffer(response){&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var feature;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var features = response.features;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var inBuffer = [];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //filter out features that are not actually in buffer, since we got all points in the buffer's bounding box
&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var i = 0; i &amp;lt; features.length; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature = features&lt;I&gt;;&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(circle.contains(feature.geometry)){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TODO: if the feature.geometry is point then buffer the point here&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inBuffer.push(feature.geometry);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry =geometryEngine.union(inBuffer);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer2.selectFeatures(query, function(results){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TODO: do something with the second layer result&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
} &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:44:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599871#M56090</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2021-12-12T01:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599872#M56091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of the buffer I would like to use a polygon feature layer to select all the points from feature layer 1 that fall within the polygon feature layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 14:32:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599872#M56091</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-07-06T14:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599873#M56092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the sample is not buffering any geometry. it is union of all the geometries. you could use where clause "1=1" on the first layer. and then combine all the polygons and query on the second layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: You need to watch out for the map service limit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 14:49:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599873#M56092</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2015-07-06T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599874#M56093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before the code that you posted the actual query happens, which I have a problem with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; query &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #000000;"&gt;Query&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;();&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;geometry &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; circle&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;getExtent&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;();&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="com" style="color: #999988;"&gt;//use a fast bounding box query. will only go to the server if bounding box is outside of the visible map&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;queryFeatures&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt;query&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; selectInBuffer&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Instead of the Circle extent I want to use a polygon feature layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:44:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599874#M56093</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2021-12-12T01:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599875#M56094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My understanding is featureLayer is polygon feature layer and featureLayer2 is point feature layer. so when in query the 1st layer use query.where instead of circle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var query = &lt;SPAN class="keyword"&gt;new Query();&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;query.where= "1=1"; // or the condition of you polygon selection.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment"&gt;//use a fast bounding box query. will only go to the server if bounding box is outside of the visible map&amp;nbsp; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.queryFeatures(query, selectInBuffer); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and on the result, combine all the polygons and get the 2nd layers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 15:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599875#M56094</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2015-07-06T15:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599876#M56095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think we are talking about two different things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do a spatial query, like the "Select by Location" query in ArcGIS Desktop. I want all points that fall within another feature layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 15:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599876#M56095</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-07-06T15:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599877#M56096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; There is no equivalent to select by location for a whole layer in the JS API. The method of unioning all geometries of one layer and querying the second using this unioned geom as thejus kambi is suggesting is the only option I am aware of.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 15:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599877#M56096</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-07-06T15:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query a feature layer against another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599878#M56097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh ok I didn't know that. I'll see if I can figure this out. thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 15:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-a-feature-layer-against-another-feature/m-p/599878#M56097</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-07-06T15:19:37Z</dc:date>
    </item>
  </channel>
</rss>

