<?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 Buffer query not working in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buffer-query-not-working/m-p/290402#M26709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone figure out why my buffer query is not working? There are basically 3 parts to it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. find the piece of land with buffer distance (in some sample codes this is called the hazardous parcel), &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. find buffer geometry, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. find pieces of lands within the buffer geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Part 3 is not working. The code below is the callback for part 1 (i.e. the QueryTask has found the hazardous parcel and is returning it in a featureSet).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;callback: function(featureSet) {
// display the features inside the featureSet on the map
// ....
//

/* Buffer search */

var params = new esri.tasks.BufferParameters();
params.features = featureSet.features;
params.distances = ["500"];
params.unit = esri.tasks.BufferParameters.UNIT_FOOT;
//params.unionResults = true;
params.bufferSpatialReference = new esri.SpatialReference({
 wkid: this.configData.search.projectedSpatialRef
});

var geoServer = "http://pathToGeometryServe";
var gsvc = new esri.tasks.GeometryService(geoServer);

// Perform buffer search
gsvc.buffer(params, dojo.hitch(this, function(graphics) {
 // Add the buffer to the screen
 var symbol = new esri.symbol.SimpleFillSymbol("solid", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_NULL), new dojo.Color([255, 255, 0, 0.5]));
 var gBuffer = new esri.Graphic(graphics[0].geometry, symbol);
 
 this.map.graphics.add(gBuffer);
 
 // Set up query for surrounding parcels
&amp;nbsp;&amp;nbsp;&amp;nbsp; var qSurroundingParcels = new esri.tasks.Query();
 var taskSurroundingParcels = new esri.tasks.QueryTask("http://mapServerUrl");
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.outFields = ["field1", "field2", "field3"];
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
 qSurroundingParcels.geometry = gBuffer.geometry;
&amp;nbsp; 
 // Query for parcels within the buffer
 taskSurroundingParcels.execute(qSurroundingParcels, dojo.hitch(this, function(fset) {
&amp;nbsp; console.debug("taskSurroundingParcels completed");
 }));

 /* 2nd attemp at getting it to work but no luck */
 /*taskSurroundingParcels.execute(qSurroundingParcels);
 this.setMessage("FINDING...");
 
 dojo.connect(taskSurroundingParcels, "onComplete", function(fset) {
&amp;nbsp; this.setMessage("DONE.");
 });*/
}));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I never see "taskSurroundingParcels completed" in Firebug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:18:01 GMT</pubDate>
    <dc:creator>MostafaAsadi</dc:creator>
    <dc:date>2021-12-12T16:18:01Z</dc:date>
    <item>
      <title>Buffer query not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buffer-query-not-working/m-p/290402#M26709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone figure out why my buffer query is not working? There are basically 3 parts to it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. find the piece of land with buffer distance (in some sample codes this is called the hazardous parcel), &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. find buffer geometry, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. find pieces of lands within the buffer geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Part 3 is not working. The code below is the callback for part 1 (i.e. the QueryTask has found the hazardous parcel and is returning it in a featureSet).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;callback: function(featureSet) {
// display the features inside the featureSet on the map
// ....
//

/* Buffer search */

var params = new esri.tasks.BufferParameters();
params.features = featureSet.features;
params.distances = ["500"];
params.unit = esri.tasks.BufferParameters.UNIT_FOOT;
//params.unionResults = true;
params.bufferSpatialReference = new esri.SpatialReference({
 wkid: this.configData.search.projectedSpatialRef
});

var geoServer = "http://pathToGeometryServe";
var gsvc = new esri.tasks.GeometryService(geoServer);

// Perform buffer search
gsvc.buffer(params, dojo.hitch(this, function(graphics) {
 // Add the buffer to the screen
 var symbol = new esri.symbol.SimpleFillSymbol("solid", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_NULL), new dojo.Color([255, 255, 0, 0.5]));
 var gBuffer = new esri.Graphic(graphics[0].geometry, symbol);
 
 this.map.graphics.add(gBuffer);
 
 // Set up query for surrounding parcels
&amp;nbsp;&amp;nbsp;&amp;nbsp; var qSurroundingParcels = new esri.tasks.Query();
 var taskSurroundingParcels = new esri.tasks.QueryTask("http://mapServerUrl");
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.outFields = ["field1", "field2", "field3"];
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.returnGeometry = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; qSurroundingParcels.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
 qSurroundingParcels.geometry = gBuffer.geometry;
&amp;nbsp; 
 // Query for parcels within the buffer
 taskSurroundingParcels.execute(qSurroundingParcels, dojo.hitch(this, function(fset) {
&amp;nbsp; console.debug("taskSurroundingParcels completed");
 }));

 /* 2nd attemp at getting it to work but no luck */
 /*taskSurroundingParcels.execute(qSurroundingParcels);
 this.setMessage("FINDING...");
 
 dojo.connect(taskSurroundingParcels, "onComplete", function(fset) {
&amp;nbsp; this.setMessage("DONE.");
 });*/
}));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I never see "taskSurroundingParcels completed" in Firebug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:18:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/buffer-query-not-working/m-p/290402#M26709</guid>
      <dc:creator>MostafaAsadi</dc:creator>
      <dc:date>2021-12-12T16:18:01Z</dc:date>
    </item>
  </channel>
</rss>

