<?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 convert buffer Circle to polygon to use as Query.geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726740#M67432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a series of points that I have buffered and generated as Circles.&amp;nbsp; I now want those circles to be used to select features from my featureLayer.&amp;nbsp; I'm getting stuck on the input geometry, because Circle is not in the list of acceptable geometry types for Query.&amp;nbsp; It lists &lt;A href="https://developers.arcgis.com/javascript/jsapi/extent-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Extent&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/point-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Point&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/multipoint-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Multipoint&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/polyline-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Polyline&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, or &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/polygon-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Polygon&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be precise, so I don't want to just use the extent of the circle as my input.&amp;nbsp; I assume there is a way to convert my circles to polygons, but I haven't figured out how to do it yet.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Dec 2014 16:00:15 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2014-12-12T16:00:15Z</dc:date>
    <item>
      <title>convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726740#M67432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a series of points that I have buffered and generated as Circles.&amp;nbsp; I now want those circles to be used to select features from my featureLayer.&amp;nbsp; I'm getting stuck on the input geometry, because Circle is not in the list of acceptable geometry types for Query.&amp;nbsp; It lists &lt;A href="https://developers.arcgis.com/javascript/jsapi/extent-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Extent&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/point-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Point&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/multipoint-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Multipoint&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/polyline-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Polyline&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;, or &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/polygon-amd.html" style="color: #00629b; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Polygon&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be precise, so I don't want to just use the extent of the circle as my input.&amp;nbsp; I assume there is a way to convert my circles to polygons, but I haven't figured out how to do it yet.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 16:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726740#M67432</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-12-12T16:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726741#M67433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the &lt;A href="https://developers.arcgis.com/javascript/jsapi/polygon-amd.html"&gt;documentation&lt;/A&gt;, a Circle is a subclass of a Polygon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 16:07:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726741#M67433</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-12-12T16:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726742#M67434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I thought to, but my featureLayer query keeps failing.&amp;nbsp; I put my buffered points into a graphicsLayer (the one you just helped me with the attributes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to know if any features in my featureLayer as within a set distance to other features in that same layer.&amp;nbsp; Plus I have a 2nd layer that I need to query as well, which I'll get to next.&amp;nbsp;&amp;nbsp; I figured using a separate graphicLayer would help with this, plus I needed the graphics to display anyway.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function selectAllInBuffer(){&lt;/P&gt;&lt;P&gt;&amp;nbsp; primaryLayer.clearSelection();//my featureLayer&lt;/P&gt;&lt;P&gt;&amp;nbsp; arrayUtils.forEach(bufferLayer.graphics, function (graphic){//my graphics layer full of circles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = graphic.geometry;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; primaryLayer.queryFeatures(query, FeatureLayer.SELECTION_ADD, function (result){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('queryResult');//just so I had a place to put a breakpoint&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I not accessing the graphics of my graphicsLayers correctly?&amp;nbsp; It seems pretty straight forward.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever gotten a clear idea of the different between queryFeatures and selectFeatures?&amp;nbsp; It seems like I read something a while ago, but the explanation was too obscure to make much sense.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 16:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726742#M67434</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-12-12T16:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726743#M67435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your queryFeatures method call is incorrect.&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14184193072129609 jive_text_macro" jivemacro_uid="_14184193072129609" modifiedtitle="true"&gt;&lt;P&gt;primaryLayer.queryFeatures(query, FeatureLayer.SELECTION_ADD, function (result){&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;It should just be:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14184193308169255 jive_text_macro" jivemacro_uid="_14184193308169255"&gt;&lt;P&gt;primaryLayer.queryFeatures(query,&amp;nbsp; function (result){&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;You only do the FeatureLayer.SELECTION_ADD if you are using the &lt;/P&gt;&lt;P&gt;selectFeatures(query, selectionMethod?, callback?, errback?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference between queryFeatures and selectFeatures is pretty big.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;queryFeatures will return geometry and attributes that meet you query criteria where as selectFeatures will do the same and actually change the symbology of the selected features in your FeatureLayer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 21:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726743#M67435</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-12-12T21:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726744#M67436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could only get this to work with the extent of the graphic, not the actual geometry of the circle, which was my original question.&amp;nbsp; I guess the answer is, Circle isn't interpreted as a Polygon in this situation.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 22:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726744#M67436</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-12-12T22:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726745#M67437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I will do some testing on my end to confirm this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 22:54:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726745#M67437</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-12-12T22:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726746#M67438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I can confirm that a circle does working in a query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is a sample app:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;
&amp;nbsp; &amp;lt;!--The viewport meta tag is used to improve the presentation and behavior of the samples 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on iOS devices--&amp;gt;
&amp;nbsp; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;Buffer&amp;lt;/title&amp;gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.11/dijit/themes/tundra/tundra.css" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.11/dijit/themes/tundra/tundra.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.11/esri/css/esri.css" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.11/esri/css/esri.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; &amp;lt;style&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; html,
&amp;nbsp;&amp;nbsp;&amp;nbsp; body,
&amp;nbsp;&amp;nbsp;&amp;nbsp; #mapDiv {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; margin: 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 100%;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; #messages {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background-color: #fff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box-shadow: 0 0 5px #888;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 1.1em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max-width: 15em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0.5em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right: 20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; top: 20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 40;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; #drop {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background-color: #fff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; box-shadow: 0 0 5px #888;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 1.1em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max-width: 15em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding: 0.5em;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right: 20px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; top: 105px;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 40;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; &amp;lt;/style&amp;gt;
&lt;SPAN&gt;&amp;nbsp; &amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://js.arcgis.com/3.11/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://js.arcgis.com/3.11/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;nbsp; &amp;lt;script&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var map;


&amp;nbsp;&amp;nbsp;&amp;nbsp; require([
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/map", "esri/layers/FeatureLayer",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/tasks/query", "esri/geometry/Circle", "esri/units",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/graphic", "esri/InfoTemplate", "esri/symbols/SimpleMarkerSymbol",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/renderers/SimpleRenderer",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/config", "esri/Color", "dojo/dom", "dijit/form/ComboBox", "dojo/domReady!"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ], function (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map, FeatureLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Query, Circle, Units,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic, InfoTemplate, SimpleMarkerSymbol,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleLineSymbol, SimpleFillSymbol, SimpleRenderer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriConfig, Color, dom
&amp;nbsp;&amp;nbsp;&amp;nbsp; ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use a proxy page if a URL generated by this page is greater than 2000 characters
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this should not be needed as nearly all query &amp;amp; select functions are performed on the client
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esriConfig.defaults.io.proxyUrl = "/proxy/";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new Map("mapDiv", {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; basemap: "streets",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: [-81.00, 34.000],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zoom: 14,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slider: false
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add the census block points in on demand mode. Note that an info template has been defined so when 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //selected features are clicked a popup window will appear displaying the content defined in the info template.
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var featureLayer = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0" rel="nofollow noopener noreferrer" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["POP2000", "HOUSEHOLDS", "HSE_UNITS", "TRACT", "BLOCK"]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // selection symbol used to draw the selected census block points within the buffer polygon
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var symbol = new SimpleMarkerSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleMarkerSymbol.STYLE_CIRCLE,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new SimpleLineSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleLineSymbol.STYLE_NULL, new Color([200, 120, 101, 0.9]), 1),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([200, 0, 0, 1])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.setSelectionSymbol(symbol);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //make unselected features invisible
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var nullSymbol = new SimpleMarkerSymbol().setSize(0);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.setRenderer(new SimpleRenderer(nullSymbol));

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(featureLayer);


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var circleSymb = new SimpleFillSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleFillSymbol.STYLE_NULL,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new SimpleLineSymbol(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SimpleLineSymbol.STYLE_SHORTDASHDOTDOT,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([105, 105, 105]),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ), new Color([255, 255, 0, 0.25])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var circle;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //when the map is clicked create a buffer around the click point of the specified distance.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.on("click", function (evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selbuf = document.FormSelection.BufferSelection.selectedIndex;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var BufferSelection = document.FormSelection.BufferSelection.options[selbuf].value;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle = new Circle({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: evt.mapPoint,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geodesic: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radius: BufferSelection,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radiusUnit: Units.MILES
&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; map.graphics.clear();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = new Graphic(circle, circleSymb);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);

&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; query.geometry = circle;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (results) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var totalPopulation = sumPopulation(results);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var r = "";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = "&amp;lt;b&amp;gt;The total Census Block population within the buffer is &amp;lt;i&amp;gt;" + totalPopulation + "&amp;lt;/i&amp;gt;.&amp;lt;/b&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dom.byId("messages").innerHTML = r;
&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; function sumPopulation(features) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var popTotal = 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var x = 0; x &amp;lt; features.length; x++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popTotal = popTotal + features&lt;X&gt;.attributes["POP2000"];&lt;/X&gt;
&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; return popTotal;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;nbsp; &amp;lt;span id="messages"&amp;gt;Click on the map to select census block points within mile.&amp;lt;/span&amp;gt;
&amp;nbsp; &amp;lt;span id="drop"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form name="FormSelection"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;select name="BufferSelection"&amp;gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option&amp;gt;1&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option&amp;gt;2&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option&amp;gt;10&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/select&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;
&amp;nbsp; &amp;lt;/span&amp;gt;
&amp;nbsp; &amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:05:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726746#M67438</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T07:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: convert buffer Circle to polygon to use as Query.geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726747#M67439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I got it working.&amp;nbsp; Now I need to take it further.&amp;nbsp; I need to step through all circles and build a composite list of all nearby features.&amp;nbsp; The output needs to include both some of the attributes of the the input (objectid, name) followed by all the features in the comparison layer that are within it's buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I came up with seems right, but since I have multiple features now, not one,it seems like it needs to be changed to something with a deferred.&amp;nbsp; It doesn't seem to execute in the right sequence.&lt;/P&gt;&lt;P&gt;Here's the sequence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select a county name from a pick list.&amp;nbsp; Use that name to run a query task against the input layer.&amp;nbsp; The result is selected points&lt;/P&gt;&lt;P&gt;//zooms to county selected in the dropdown list&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; function zoomCounty () {
&amp;nbsp;&amp;nbsp;&amp;nbsp; findTask = new FindTask((countyLayer.url));
&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams = new FindParameters();
&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.layerIds = [0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.searchFields = ["COUNTYNAME"]; //Fields are CASE SENSITIVE
&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.outSpatialReference = spatialReference; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var countyName = registry.byId("countySelect").value;//Set the search text to the value selected in the list
//&amp;nbsp; var countyName = "Boone";
&amp;nbsp;&amp;nbsp;&amp;nbsp; currentCounty = countyName;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (countyName.length &amp;gt; 1){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.searchText = countyName;
/*
&amp;nbsp;&amp;nbsp;&amp;nbsp; findTask.execute(findParams, function (results) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(results[0].feature.geometry.getExtent().expand(1.5));
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
*/
&amp;nbsp; updateLcarsGrid();
&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('no county selected');
&amp;nbsp; }
&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;These are placed into a formatted grid&lt;/P&gt;&lt;P&gt;//Populates a list of LCARS for that county&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function updateLcarsGrid(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryParams = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.geometry = currentExtent;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.outFields = ["*"];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.outSpatialReference = spatialReference;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryParams.where = "County = '" + currentCounty + "'";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask(lcarsLayer.url);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.on ('error', queryErrorHandler);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(queryParams, updateLGridHandler);
&amp;nbsp; }
&amp;nbsp; function queryErrorHandler(err) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log ("error in queryTask is " + err.error);
&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 


&amp;nbsp; function updateLGridHandler(results){
&amp;nbsp;&amp;nbsp;&amp;nbsp; domClass.remove("dataDiv", "dataDivBlank");
&amp;nbsp;&amp;nbsp;&amp;nbsp; domClass.add("dataDiv", "dataDivOpen");
&amp;nbsp;&amp;nbsp;&amp;nbsp; // dom.byId("messages").innerHTML = "";
&amp;nbsp;&amp;nbsp;&amp;nbsp; var data = [];
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lgrid) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lgrid.refresh();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (results.features.length &amp;gt; 0) {&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = arrayUtils.map(results.features, function(feature){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'id': feature.attributes.OBJECTID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility_type': feature.attributes.Facility_Type,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'regulatory_type': feature.attributes.Regulatory_Type,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'facility': feature.attributes.Provider_Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address': feature.attributes.Address,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city': feature.attributes.City
&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; lgrid = new Grid({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderRow: renderRowFunction,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showHeader: false
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, "lcarsGridDiv");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lgrid.renderArray(data);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lgrid.sort('facility');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lgrid.on('.dgrid-row:click', function(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridClick = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = lgrid.row(evt);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rowid = [row.data.id];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridAddr = row.data.address;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gridClickHandler(rowid);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; generateBufferGraphic(results.features);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var compArray = selectAllInBuffer();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("end of selectAllInBuffer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var countyName = registry.byId("countySelect").value;//Set the search text to the value selected in the list 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; var countyName = "Boone";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (countyName.length &amp;gt; 1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; findParams.searchText = countyName;&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; findTask.execute(findParams, function(results){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(results[0].feature.geometry.getExtent().expand(1.5));
&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; alert("No LCARS in this county. Select another from the list.");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;There is a pick list of distances.&amp;nbsp; This is input for generating circle buffers, which go into a graphicsLayer.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//create a buffer graphic for every LCARS
function generateBufferGraphic(features){
&amp;nbsp;&amp;nbsp;&amp;nbsp; bufferLayer.clear();&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var radius = registry.byId("bufferSelect").value;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var idPoint,circle; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; compareSel.length = 0;&amp;nbsp; 
&amp;nbsp; //added ts 12/30
&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arrayUtils.forEach(features, function (feature){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idPoint = feature.geometry;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle = new Circle({&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: idPoint,&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geodesic: true,&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radius: radius,&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radiusUnit: "esriMiles"&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 graphic = new Graphic(circle, bufferSymbol,feature.attributes);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.attributes.Source = 'LCARS';
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bufferLayer.add(graphic); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Added "if" so the zoom wouldn't happen if the buffer alone changes.
&amp;nbsp; if (justBuffer == false) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var ext = graphicsUtils.graphicsExtent(bufferLayer.graphics).expand(2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(ext); 
}
justBuffer = false;
}&lt;/PRE&gt;&lt;P&gt;Then these graphics are used one at a time as the geometry for a comparison layer using a selectFeatures. The output from that selection might be zero, or multiple.&amp;nbsp; This seems to be where I'm failing. With breakpoints, I can see there are features within an individual circle.&amp;nbsp; By the time I finish all the looping, I always end up with zero!&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function selectAllInBuffer(){
&amp;nbsp; lcarsLayer.clearSelection();
&amp;nbsp; compareLayer.clearSelection();
&amp;nbsp; compareSel.length = 0;
 // var graphics = bufferLayer.graphics;
&amp;nbsp; compareLayer.on('selection-complete',function (results){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var len = results.features.length;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (len &amp;gt; 0) {&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; arrayUtils.forEach(results.features, function(feature){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compareSel.push({"lcars":lcarsProv,"results":feature.attributes});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("compareSel length = " + compareSel.length);
&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; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(" no nearby facilities");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; });&amp;nbsp; 
&amp;nbsp; arrayUtils.forEach(bufferLayer.graphics, function (graphic){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = graphic.geometry; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic_oid = graphic.attributes.OBJECTID;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lcarsProv = graphic.attributes;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; compareLayer.selectFeatures(query);
&amp;nbsp; });
&amp;nbsp; return compareSel;
}&lt;/PRE&gt;&lt;P&gt;This is sensitive data, or I'd post a link.&amp;nbsp; I'm hampered by a broken wrist, so I'm not quite up to making a jsfiddle.&amp;nbsp; Hopefully someone will spot something.&amp;nbsp; There are no errors generated from this code, I'm just not getting the results I expect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:05:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/convert-buffer-circle-to-polygon-to-use-as-query/m-p/726747#M67439</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-12T07:05:03Z</dc:date>
    </item>
  </channel>
</rss>

