<?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 Does extent.intersect check the extent of a polygon before it's geometry? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/does-extent-intersect-check-the-extent-of-a/m-p/432569#M39887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;More of a best practice question.&amp;nbsp; If I am testing to see whether a polygon is intersecting with an extent, should I first test if the polygon's extent intersects and then test the geometry?&amp;nbsp; Or is it just as efficient to simply test the polygon's geometry?&amp;nbsp; Here is some code to illustrate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is better? This:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var userExtent; //an extent the user has selected
var featExtent = new Extent(feature.geometry._extent); //an extent from a Feature Layer graphic
if (userExtent.intersects(featExtent){
&amp;nbsp;&amp;nbsp; console.log("The two Extents Intersect");
&amp;nbsp;&amp;nbsp; var polygon = new Polygon(feature.geometry);
&amp;nbsp;&amp;nbsp; if (userExtent.intersects(polygon){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Polygon intersects with user defined Extent");
&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var userExtent; //an extent the user has selected
var polygon = new Polygon(feature.geometry); //geometry from a Feature Layer graphic
if (userExtent.intersects(polygon){
&amp;nbsp;&amp;nbsp; console.log("Polygon intersects with user defined Extent");
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2014 03:17:33 GMT</pubDate>
    <dc:creator>DanikBourdeau2</dc:creator>
    <dc:date>2014-06-10T03:17:33Z</dc:date>
    <item>
      <title>Does extent.intersect check the extent of a polygon before it's geometry?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/does-extent-intersect-check-the-extent-of-a/m-p/432569#M39887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;More of a best practice question.&amp;nbsp; If I am testing to see whether a polygon is intersecting with an extent, should I first test if the polygon's extent intersects and then test the geometry?&amp;nbsp; Or is it just as efficient to simply test the polygon's geometry?&amp;nbsp; Here is some code to illustrate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is better? This:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var userExtent; //an extent the user has selected
var featExtent = new Extent(feature.geometry._extent); //an extent from a Feature Layer graphic
if (userExtent.intersects(featExtent){
&amp;nbsp;&amp;nbsp; console.log("The two Extents Intersect");
&amp;nbsp;&amp;nbsp; var polygon = new Polygon(feature.geometry);
&amp;nbsp;&amp;nbsp; if (userExtent.intersects(polygon){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Polygon intersects with user defined Extent");
&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var userExtent; //an extent the user has selected
var polygon = new Polygon(feature.geometry); //geometry from a Feature Layer graphic
if (userExtent.intersects(polygon){
&amp;nbsp;&amp;nbsp; console.log("Polygon intersects with user defined Extent");
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 03:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/does-extent-intersect-check-the-extent-of-a/m-p/432569#M39887</guid>
      <dc:creator>DanikBourdeau2</dc:creator>
      <dc:date>2014-06-10T03:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Does extent.intersect check the extent of a polygon before it's geometry?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/does-extent-intersect-check-the-extent-of-a/m-p/432570#M39888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To keep on the topic of extents.&amp;nbsp; Feature Layers automatically generalize features to minimize throughput data, removing unnecessary vertices.&amp;nbsp; This could influence the extent of a feature.&amp;nbsp; Does anybody know whether the extent held in a graphic's geometry is the true extent of that feature or is it the extent of the generalized feature?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 06:13:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/does-extent-intersect-check-the-extent-of-a/m-p/432570#M39888</guid>
      <dc:creator>DanikBourdeau2</dc:creator>
      <dc:date>2014-06-16T06:13:13Z</dc:date>
    </item>
  </channel>
</rss>

