<?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 Re: Query Extents does not work - ArcGIS Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-extents-does-not-work-arcgis-python-api/m-p/862818#M4252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code as posted doesn't work:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;stdin&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
NameError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; name &lt;SPAN class="string token"&gt;'GIS'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; defined
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
 ‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I know how to fix that error, but then I simply run into the next NameError with FeatureLayer.&amp;nbsp; Please post functioning code that generates the empty results you are speaking of.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:42:03 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2021-12-12T10:42:03Z</dc:date>
    <item>
      <title>Query Extents does not work - ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-extents-does-not-work-arcgis-python-api/m-p/862817#M4251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px 1em;"&gt;Im trying to use the ArcGIS Python API to query a few results and gather the extent, I can query the results fine but as soon as I try to extract the extent I retrieve empty results.&lt;/P&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px 1em;"&gt;Using one of the samples servers, heres my code:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;import arcgis.gis gis = GIS()&amp;nbsp; t = 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0' layer = FeatureLayer(t, gis)&amp;nbsp; results = layer.query(where='1=1', return_extent_only=True) &lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px 1em;"&gt;After I print results I get the following&lt;/P&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;{"features": [], "fields": []}&amp;nbsp; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: #f9f8f6; border: 0px; margin: 0px 0px 1em;"&gt;Am I missing something? Seems all to easy up until this point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 00:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-extents-does-not-work-arcgis-python-api/m-p/862817#M4251</guid>
      <dc:creator>FMGLGIS</dc:creator>
      <dc:date>2019-01-08T00:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query Extents does not work - ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/query-extents-does-not-work-arcgis-python-api/m-p/862818#M4252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code as posted doesn't work:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;stdin&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
NameError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; name &lt;SPAN class="string token"&gt;'GIS'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; defined
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
 ‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I know how to fix that error, but then I simply run into the next NameError with FeatureLayer.&amp;nbsp; Please post functioning code that generates the empty results you are speaking of.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/query-extents-does-not-work-arcgis-python-api/m-p/862818#M4252</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T10:42:03Z</dc:date>
    </item>
  </channel>
</rss>

