<?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: featureLayer.queryFeatures(query) not working with spatialRelationship in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-queryfeatures-query-not-working-with/m-p/139761#M12994</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The draw-complete event returns a Geometry so I am not sure where you saw in the documentation that a geometry has a&amp;nbsp;vertices property. A Polygon geometry has Rings property:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2018 16:43:42 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-05-22T16:43:42Z</dc:date>
    <item>
      <title>featureLayer.queryFeatures(query) not working with spatialRelationship</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-queryfeatures-query-not-working-with/m-p/139760#M12993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JSAPI 4.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user workflow is to have a user draw a polygon over some linear features. At "draw-complete" the polygon is coerced to a polyline and I want to find the line features that intersect the drawn polyline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the query informs me:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;{"error":{"code":400,"message":"Unable to complete operation.","details":["Unable to perform query operation."]}}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The code appears simple enough:&lt;/P&gt;&lt;DIV style="color: #d4d4d4;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;action&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"draw-complete"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;evt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// create a polyline from the drawn polygon evt.verticies&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; selectionPolyline &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Polyline&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;vertices&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// get the gas line layer from the layers in the map using the title&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; gasLineLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;allLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;find&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; GAS_LINE_LAYER_TITLE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Query&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; selectionPolyline&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spatialRelationship&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"intersects"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; gasLineLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;queryFeatures&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;evt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;alert&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SUCCESS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;If I do a simple query with just a where:'1=1', all features are selected, so it must be something in the query definition about the spatialRelationship. Are spatial references this issue perhaps?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help please. TIA!&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-queryfeatures-query-not-working-with/m-p/139760#M12993</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2021-12-11T07:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: featureLayer.queryFeatures(query) not working with spatialRelationship</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-queryfeatures-query-not-working-with/m-p/139761#M12994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dirk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The draw-complete event returns a Geometry so I am not sure where you saw in the documentation that a geometry has a&amp;nbsp;vertices property. A Polygon geometry has Rings property:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2018 16:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-queryfeatures-query-not-working-with/m-p/139761#M12994</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-22T16:43:42Z</dc:date>
    </item>
  </channel>
</rss>

