<?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 controlling feature class extent in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/controlling-feature-class-extent/m-p/243372#M18914</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature class, that I call into a Python script, that I then convert to a raster, and perform a conditional statement with, with another raster.&amp;nbsp; The input feature class - and the derived raster from it - has a different, smaller, extent than the other raster I perform the conditional with.&amp;nbsp; Within the conditional statement, the feature class derived raster is part of the conditional statement; ie: basically I say 'where the feature class derived raster is null, use the other raster's value; else, use the feature class raster value".&amp;nbsp; The output result is of the extent of the feature class raster, and I need the extent to be of the other raster that is input in the statement. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me make that easier to follow &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;outCon = Con( IsNull(Raster("OutRaster")), Raster(gR), (Raster(gR) + 1.0))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OutRaster is the raster derived from the feature class. gR is a random raster. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need outCon to have the extent of gR.&amp;nbsp; I cannot seem to do this for love of chocolate!&amp;nbsp; I tried to set the environment extent to what I need, but that appears to have no effect.&amp;nbsp; How can I make this work?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if I need to clarify my problem.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cyndy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2013 17:16:19 GMT</pubDate>
    <dc:creator>CyndyBresloff</dc:creator>
    <dc:date>2013-05-30T17:16:19Z</dc:date>
    <item>
      <title>controlling feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/controlling-feature-class-extent/m-p/243372#M18914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature class, that I call into a Python script, that I then convert to a raster, and perform a conditional statement with, with another raster.&amp;nbsp; The input feature class - and the derived raster from it - has a different, smaller, extent than the other raster I perform the conditional with.&amp;nbsp; Within the conditional statement, the feature class derived raster is part of the conditional statement; ie: basically I say 'where the feature class derived raster is null, use the other raster's value; else, use the feature class raster value".&amp;nbsp; The output result is of the extent of the feature class raster, and I need the extent to be of the other raster that is input in the statement. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me make that easier to follow &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;outCon = Con( IsNull(Raster("OutRaster")), Raster(gR), (Raster(gR) + 1.0))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OutRaster is the raster derived from the feature class. gR is a random raster. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need outCon to have the extent of gR.&amp;nbsp; I cannot seem to do this for love of chocolate!&amp;nbsp; I tried to set the environment extent to what I need, but that appears to have no effect.&amp;nbsp; How can I make this work?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if I need to clarify my problem.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cyndy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 17:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/controlling-feature-class-extent/m-p/243372#M18914</guid>
      <dc:creator>CyndyBresloff</dc:creator>
      <dc:date>2013-05-30T17:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: controlling feature class extent</title>
      <link>https://community.esri.com/t5/python-questions/controlling-feature-class-extent/m-p/243373#M18915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Basically you are telling it to create a "copy" of the OutRaster file named outCon and changing the values in it depending on your where clause (looks at each cell of conditional raster and assigns a value based on clause).&amp;nbsp; So, it will create a raster the same size/extent of the OutRaster as it evaluates all cells in the conditional raster layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To match the extent of the gR raster, you could try the arcpy.env.mask = gR setting before the con statement as SA tools are all supposed to honor masks:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001t000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001t000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have problems with mask, another way would be to clip the OutRaster to the extend of the gR raster before the con statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:41:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/controlling-feature-class-extent/m-p/243373#M18915</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-05-30T21:41:36Z</dc:date>
    </item>
  </channel>
</rss>

