<?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 Trying to set output Extent for Topo To Raster in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637832#M49701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, So the code is below.&amp;nbsp; It works except the way its written it uses the default output extent.&amp;nbsp; I need to be able to add a shapefile as the output extent, or a variable (which is a shapefile declared at the top of the code).&amp;nbsp; It seems there are a few different ways to do the topo to raster syntax.&amp;nbsp; This one works, I just need to add the output extent and I dont know where exactlly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My variable for my output extent is: MEG_counties_shp__2_&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Topo to Raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy.sa import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR = TopoToRaster([TopoPointElevation([['R:\\PrecipMap\\DailyPrecip.shp', 'pcpn']])], "0.003", "", "20", "", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR.save("R:\\ArcGIS\\Default.gdb\\TopoToR_shp2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Topo To Raster Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried this but it does not work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR = TopoToRaster([TopoPointElevation([['R:\\PrecipMap\\DailyPrecip.shp', 'pcpn']])], "0.003", MEG_counties_shp__2_,"", "20", "", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR.save("R:\\ArcGIS\\Default.gdb\\TopoToR_shp2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Topo To Raster Done'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Feb 2011 14:27:27 GMT</pubDate>
    <dc:creator>CharlesGant</dc:creator>
    <dc:date>2011-02-26T14:27:27Z</dc:date>
    <item>
      <title>Trying to set output Extent for Topo To Raster in Python</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637832#M49701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, So the code is below.&amp;nbsp; It works except the way its written it uses the default output extent.&amp;nbsp; I need to be able to add a shapefile as the output extent, or a variable (which is a shapefile declared at the top of the code).&amp;nbsp; It seems there are a few different ways to do the topo to raster syntax.&amp;nbsp; This one works, I just need to add the output extent and I dont know where exactlly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My variable for my output extent is: MEG_counties_shp__2_&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Topo to Raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy.sa import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR = TopoToRaster([TopoPointElevation([['R:\\PrecipMap\\DailyPrecip.shp', 'pcpn']])], "0.003", "", "20", "", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR.save("R:\\ArcGIS\\Default.gdb\\TopoToR_shp2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Topo To Raster Done'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried this but it does not work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR = TopoToRaster([TopoPointElevation([['R:\\PrecipMap\\DailyPrecip.shp', 'pcpn']])], "0.003", MEG_counties_shp__2_,"", "20", "", "", "ENFORCE", "CONTOUR", "40", "", "1", "0", "", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outTTR.save("R:\\ArcGIS\\Default.gdb\\TopoToR_shp2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'Topo To Raster Done'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Feb 2011 14:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637832#M49701</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-26T14:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set output Extent for Topo To Raster in Python</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637833#M49702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anyone have any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Feb 2011 11:44:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637833#M49702</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2011-02-28T11:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set output Extent for Topo To Raster in Python</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637834#M49703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could try passing the extent from describe, and add those variables in the proper place in the TopoToRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dsc = arcpy.describe(&amp;lt;shapefile&amp;gt;)
X1 = dsc.Extent.XMin
Y1 = dsc.Extent.YMin
X2 = dsc.Extent.XMax
Y2 = dsc.Extent.YMax
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:06:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-set-output-extent-for-topo-to-raster-in/m-p/637834#M49703</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-12T03:06:59Z</dc:date>
    </item>
  </channel>
</rss>

