<?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 simplify polygon for input as queryTask geometry in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simplify-polygon-for-input-as-querytask-geometry/m-p/640047#M59744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using a findTask to search for a district by it's ID number.&amp;nbsp; I need the geometry of this polygon as the input to a queryTask.&amp;nbsp; I figured this would be simple, but I'm having trouble with the syntax on the geometryservice.simplify.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the reference to my geometryService defined and I have this code set up with proxy pages, in case the number of coordinates from the geometry was somehow the problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the result handler function from my findTask:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function findDistResults(results) {
&amp;nbsp;&amp;nbsp; var result = results[0];&amp;nbsp; //there should only be unique district numbers found in each layer&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; // var distExtent = districtGeometry.getExtent();
&amp;nbsp; var resultGeometry = result.feature.geometry;

geometryService.simplify([resultGeometry], function (simplifiedGeometries) {
districtGeometry = simplifiedGeometries[0];
});

&amp;nbsp;&amp;nbsp;&amp;nbsp; runQueries(districtGeometry);
}&amp;nbsp; 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first thing the function runQueries does is set districtGeometry as the geometry for my Query I've defined previously.&amp;nbsp;&amp;nbsp; The querytask looks to failing because it doesn't like the geometry I'm using as input.&amp;nbsp; For grins, I captured the extent of my polygon instead and it uses that&amp;nbsp; just fine as the query geometry input.&amp;nbsp; I tried the polygon first without simplifying it and it didn't work, which is why I'm going through the extra step of trying to simplify it first.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this is a very basic syntax problem I'm just not seeing.&amp;nbsp; Putting a breakpoint within the function of the geometryService, it doesn't look like it every goes into it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Aug 2013 19:53:14 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2013-08-07T19:53:14Z</dc:date>
    <item>
      <title>simplify polygon for input as queryTask geometry</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simplify-polygon-for-input-as-querytask-geometry/m-p/640047#M59744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using a findTask to search for a district by it's ID number.&amp;nbsp; I need the geometry of this polygon as the input to a queryTask.&amp;nbsp; I figured this would be simple, but I'm having trouble with the syntax on the geometryservice.simplify.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the reference to my geometryService defined and I have this code set up with proxy pages, in case the number of coordinates from the geometry was somehow the problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the result handler function from my findTask:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function findDistResults(results) {
&amp;nbsp;&amp;nbsp; var result = results[0];&amp;nbsp; //there should only be unique district numbers found in each layer&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
&amp;nbsp; // var distExtent = districtGeometry.getExtent();
&amp;nbsp; var resultGeometry = result.feature.geometry;

geometryService.simplify([resultGeometry], function (simplifiedGeometries) {
districtGeometry = simplifiedGeometries[0];
});

&amp;nbsp;&amp;nbsp;&amp;nbsp; runQueries(districtGeometry);
}&amp;nbsp; 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first thing the function runQueries does is set districtGeometry as the geometry for my Query I've defined previously.&amp;nbsp;&amp;nbsp; The querytask looks to failing because it doesn't like the geometry I'm using as input.&amp;nbsp; For grins, I captured the extent of my polygon instead and it uses that&amp;nbsp; just fine as the query geometry input.&amp;nbsp; I tried the polygon first without simplifying it and it didn't work, which is why I'm going through the extra step of trying to simplify it first.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this is a very basic syntax problem I'm just not seeing.&amp;nbsp; Putting a breakpoint within the function of the geometryService, it doesn't look like it every goes into it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 19:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simplify-polygon-for-input-as-querytask-geometry/m-p/640047#M59744</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2013-08-07T19:53:14Z</dc:date>
    </item>
  </channel>
</rss>

