<?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 Query geometry issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-geometry-issue/m-p/579902#M54106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get the results from a FeatureLayer when the user clicks on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My geometry is an map.MapPoint that i pass to the following function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to make a rectangle for making a polygon to add more range to the results but for some reasonim getting an error performing the query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function factigis_findDireccion(geometry,callback){
&amp;nbsp; var rectangulo = new esri.geometry.Polygon;
&amp;nbsp; rectangulo.addRing(crearRectangulo(geometry,1));

&amp;nbsp; console.log("my point",rectangulo);
&amp;nbsp; var qTaskInterruptions = new esri.tasks.QueryTask(layers.read_direcciones());
&amp;nbsp; var qInterruptions = new esri.tasks.Query();


&amp;nbsp; qInterruptions.returnGeometry = true;
&amp;nbsp; qInterruptions.outFields=["id_direccion","nombre_calle","numero"];
&amp;nbsp; qInterruptions.geometry = rectangulo ;
&amp;nbsp; qInterruptions.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;


&amp;nbsp; qTaskInterruptions.execute(qInterruptions, (featureSet)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Find",featureSet);
&amp;nbsp;&amp;nbsp;&amp;nbsp; callback(featureSet.features);
&amp;nbsp; }, (Errorq)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(Errorq,"Error doing interruptions nis by extent");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
&amp;nbsp; });
}


function crearRectangulo(mapPoint,delta){
&amp;nbsp; var arrayOfPoints = new Array();


&amp;nbsp; arrayOfPoints[0] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y-delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[1] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y+delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[2] = new esri.geometry.Point(mapPoint.x+delta,mapPoint.y+delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[3] = new esri.geometry.Point(mapPoint.x+delta,mapPoint.y-delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[4] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y-delta,mapPoint.spatialReference);


&amp;nbsp; return arrayOfPoints;
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What im missing? thanks for ur help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:56:01 GMT</pubDate>
    <dc:creator>EvelynHernandez</dc:creator>
    <dc:date>2021-12-12T00:56:01Z</dc:date>
    <item>
      <title>Query geometry issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-geometry-issue/m-p/579902#M54106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get the results from a FeatureLayer when the user clicks on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My geometry is an map.MapPoint that i pass to the following function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to make a rectangle for making a polygon to add more range to the results but for some reasonim getting an error performing the query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function factigis_findDireccion(geometry,callback){
&amp;nbsp; var rectangulo = new esri.geometry.Polygon;
&amp;nbsp; rectangulo.addRing(crearRectangulo(geometry,1));

&amp;nbsp; console.log("my point",rectangulo);
&amp;nbsp; var qTaskInterruptions = new esri.tasks.QueryTask(layers.read_direcciones());
&amp;nbsp; var qInterruptions = new esri.tasks.Query();


&amp;nbsp; qInterruptions.returnGeometry = true;
&amp;nbsp; qInterruptions.outFields=["id_direccion","nombre_calle","numero"];
&amp;nbsp; qInterruptions.geometry = rectangulo ;
&amp;nbsp; qInterruptions.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;


&amp;nbsp; qTaskInterruptions.execute(qInterruptions, (featureSet)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Find",featureSet);
&amp;nbsp;&amp;nbsp;&amp;nbsp; callback(featureSet.features);
&amp;nbsp; }, (Errorq)=&amp;gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(Errorq,"Error doing interruptions nis by extent");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
&amp;nbsp; });
}


function crearRectangulo(mapPoint,delta){
&amp;nbsp; var arrayOfPoints = new Array();


&amp;nbsp; arrayOfPoints[0] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y-delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[1] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y+delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[2] = new esri.geometry.Point(mapPoint.x+delta,mapPoint.y+delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[3] = new esri.geometry.Point(mapPoint.x+delta,mapPoint.y-delta,mapPoint.spatialReference);
&amp;nbsp; arrayOfPoints[4] = new esri.geometry.Point(mapPoint.x-delta,mapPoint.y-delta,mapPoint.spatialReference);


&amp;nbsp; return arrayOfPoints;
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What im missing? thanks for ur help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-geometry-issue/m-p/579902#M54106</guid>
      <dc:creator>EvelynHernandez</dc:creator>
      <dc:date>2021-12-12T00:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Query geometry issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-geometry-issue/m-p/579903#M54107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found my issue, i had to make a polygon like this&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; var rectangle = new esri.geometry.Polygon(new esri.SpatialReference(geometry.spatialReference));
&amp;nbsp; rectangulo.addRing([ [geometry.x-1,geometry.y-1],[geometry.x-1,geometry.y+1],[geometry.x+1,geometry.y+1],[geometry.x+1,geometry.y-1],[geometry.x-1,geometry.y-1] ]);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-geometry-issue/m-p/579903#M54107</guid>
      <dc:creator>EvelynHernandez</dc:creator>
      <dc:date>2021-12-12T00:56:04Z</dc:date>
    </item>
  </channel>
</rss>

