<?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: Help: Batch Repjection of Landsat 8 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189613#M14554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use following got, it saved all files in BUTM&amp;nbsp; directory, but&amp;nbsp; not in respective sub-directories.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;import arcpy&lt;BR /&gt;arcpy.env.workspace =&amp;nbsp; r"G:/RemoteSensing_Data/Landsat/Landsat_05/Year_1989/Row_138/UTM"&lt;BR /&gt;folders = arcpy.ListWorkspaces()&lt;BR /&gt;&lt;BR /&gt;inPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\UTM_zone_45_N.prj"&lt;BR /&gt;outPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\BUTM.prj"&lt;BR /&gt;&lt;BR /&gt;for folder in folders:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = folder&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(folder)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rastersList = arcpy.ListRasters("*_sr_*","TIF")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rastersList:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(raster)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; projOutA="G:\\RemoteSensing_Data\\Landsat\\Landsat_05\\Year_1989\\Row_138\\BUTM\\"+raster&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ProjectRaster_management(raster, projOutA, outPut_cs,"BILINEAR", inPut_cs)&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Dec 2016 16:35:40 GMT</pubDate>
    <dc:creator>ZiaAhmed</dc:creator>
    <dc:date>2016-12-04T16:35:40Z</dc:date>
    <item>
      <title>Help: Batch Repjection of Landsat 8</title>
      <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189609#M14550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to reproject&amp;nbsp; all surface bands of several &amp;nbsp;Landsat 8 image to a local coordinate system. Following script works fine for all bands of a single sheet&amp;nbsp; of image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I would like to &amp;nbsp;reproject all sheets&amp;nbsp; by batch processing&amp;nbsp; and saved them in a another folder with similar sub-folders&amp;nbsp; name of input &amp;nbsp;folder. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My input folder structure &amp;nbsp;like this: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;UTM&lt;/STRONG&gt;\LC81360432014002&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;UTM\&lt;/STRONG&gt;LC81360432014082&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;UTM&lt;/STRONG&gt;\LC81360442014002&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;UTM&lt;/STRONG&gt;\LC81360442014082&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output folder will be like this&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;BUTM&lt;/STRONG&gt;\LC81360432014002&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;BUTM&lt;/STRONG&gt;\LC81360432014082&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;BUTM&lt;/STRONG&gt;\LC81360442014002&lt;/P&gt;&lt;P&gt;G:\RemoteSensing_Data\Landsat\Landsat_08\Year_2014\Path_136\&lt;STRONG&gt;BUTM&lt;/STRONG&gt;\LC81360442014082&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;try:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace =&amp;nbsp; r"G:/RemoteSensing_Data/Landsat/Landsat_08/Year_2014/Path_136/UTM/LC81360432014002"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterListA = arcpy.ListRasters("*_sr_*","TIF")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(rasterListA)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Projection files (.prj)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\UTM_zone_46_N.prj"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\BUTM.prj"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Projection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rasterListA:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; projOutA="G:\\RemoteSensing_Data\\Landsat\\Landsat_08\\Year_2014\\Path_136\\BUTM\\Full\\LC81360432014002\\"+raster&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ProjectRaster_management(raster, projOutA, outPut_cs,"BILINEAR", inPut_cs)&lt;BR /&gt;except:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Projection failed."&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I appreciated if some one help me out.&lt;/P&gt;&lt;P&gt;Zia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2016 08:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189609#M14550</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2016-12-04T08:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Batch Repjection of Landsat 8</title>
      <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189610#M14551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does the BUTM folder exist?&lt;/P&gt;&lt;P&gt;throw in some print statements to see if the origin file exists and the destination file path looks right.&lt;/P&gt;&lt;P&gt;And format your code using syntax highlighting with the python parser&lt;/P&gt;&lt;P&gt;finally, the error message would be nice... best to take everything out of a try-except block since if not properly done will actually hide the error and be less than helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2016 12:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189610#M14551</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-12-04T12:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Batch Repjection of Landsat 8</title>
      <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189611#M14552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Yes, it does not contain sub-folders similar to UTM folders.&amp;nbsp; I will try accordingly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2016 13:24:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189611#M14552</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2016-12-04T13:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Batch Repjection of Landsat 8</title>
      <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189612#M14553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try following code it can all rasters from 4 sub-folders UTM folder. I can re-project all files but I need save they in perspective sub-folders in the&amp;nbsp; BUTM folder &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;import arcpy&lt;BR /&gt;arcpy.env.workspace =&amp;nbsp; r"G:/RemoteSensing_Data/Landsat/Landsat_08/Year_2014/Path_136/UTM/"&lt;BR /&gt;folders = arcpy.ListWorkspaces()&lt;BR /&gt;for folder in folders:&lt;BR /&gt;&amp;nbsp;arcpy.env.workspace = folder&lt;BR /&gt;&amp;nbsp;rasters = arcpy.ListRasters("*_sr_*","TIF")&lt;BR /&gt;&amp;nbsp;print (rasters)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;[u'LC81360432014002LGN00_sr_band1.tif', u'LC81360432014002LGN00_sr_band2.tif', u'LC81360432014002LGN00_sr_band3.tif', u'LC81360432014002LGN00_sr_band4.tif', u'LC81360432014002LGN00_sr_band5.tif', u'LC81360432014002LGN00_sr_band6.tif', u'LC81360432014002LGN00_sr_band7.tif', u'LC81360432014002LGN00_sr_cloud.tif', u'LC81360432014002LGN00_sr_evi.tif', u'LC81360432014002LGN00_sr_ipflag.tif', u'LC81360432014002LGN00_sr_msavi.tif', u'LC81360432014002LGN00_sr_ndvi.tif', u'LC81360432014002LGN00_sr_savi.tif']&lt;BR /&gt;[u'LC81360432014082LGN00_sr_band1.tif', u'LC81360432014082LGN00_sr_band2.tif', u'LC81360432014082LGN00_sr_band3.tif', u'LC81360432014082LGN00_sr_band4.tif', u'LC81360432014082LGN00_sr_band5.tif', u'LC81360432014082LGN00_sr_band6.tif', u'LC81360432014082LGN00_sr_band7.tif', u'LC81360432014082LGN00_sr_cloud.tif', u'LC81360432014082LGN00_sr_evi.tif', u'LC81360432014082LGN00_sr_ipflag.tif', u'LC81360432014082LGN00_sr_msavi.tif', u'LC81360432014082LGN00_sr_ndvi.tif', u'LC81360432014082LGN00_sr_savi.tif']&lt;BR /&gt;[u'LC81360442014002LGN00_sr_band1.tif', u'LC81360442014002LGN00_sr_band2.tif', u'LC81360442014002LGN00_sr_band3.tif', u'LC81360442014002LGN00_sr_band4.tif', u'LC81360442014002LGN00_sr_band5.tif', u'LC81360442014002LGN00_sr_band6.tif', u'LC81360442014002LGN00_sr_band7.tif', u'LC81360442014002LGN00_sr_cloud.tif', u'LC81360442014002LGN00_sr_evi.tif', u'LC81360442014002LGN00_sr_ipflag.tif', u'LC81360442014002LGN00_sr_msavi.tif', u'LC81360442014002LGN00_sr_ndvi.tif', u'LC81360442014002LGN00_sr_savi.tif']&lt;BR /&gt;[u'LC81360442014082LGN00_sr_band1.tif', u'LC81360442014082LGN00_sr_band2.tif', u'LC81360442014082LGN00_sr_band3.tif', u'LC81360442014082LGN00_sr_band4.tif', u'LC81360442014082LGN00_sr_band5.tif', u'LC81360442014082LGN00_sr_band6.tif', u'LC81360442014082LGN00_sr_band7.tif', u'LC81360442014082LGN00_sr_cloud.tif', u'LC81360442014082LGN00_sr_evi.tif', u'LC81360442014082LGN00_sr_ipflag.tif', u'LC81360442014082LGN00_sr_msavi.tif', u'LC81360442014082LGN00_sr_ndvi.tif', u'LC81360442014082LGN00_sr_savi.tif']&lt;BR /&gt;[u'LC81360452014002LGN00_sr_band1.tif', u'LC81360452014002LGN00_sr_band2.tif', u'LC81360452014002LGN00_sr_band3.tif', u'LC81360452014002LGN00_sr_band4.tif', u'LC81360452014002LGN00_sr_band5.tif', u'LC81360452014002LGN00_sr_band6.tif', u'LC81360452014002LGN00_sr_band7.tif', u'LC81360452014002LGN00_sr_cloud.tif', u'LC81360452014002LGN00_sr_evi.tif', u'LC81360452014002LGN00_sr_ipflag.tif', u'LC81360452014002LGN00_sr_msavi.tif', u'LC81360452014002LGN00_sr_ndvi.tif', u'LC81360452014002LGN00_sr_savi.tif']&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2016 13:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189612#M14553</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2016-12-04T13:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help: Batch Repjection of Landsat 8</title>
      <link>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189613#M14554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use following got, it saved all files in BUTM&amp;nbsp; directory, but&amp;nbsp; not in respective sub-directories.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;import arcpy&lt;BR /&gt;arcpy.env.workspace =&amp;nbsp; r"G:/RemoteSensing_Data/Landsat/Landsat_05/Year_1989/Row_138/UTM"&lt;BR /&gt;folders = arcpy.ListWorkspaces()&lt;BR /&gt;&lt;BR /&gt;inPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\UTM_zone_45_N.prj"&lt;BR /&gt;outPut_cs = "G:\\RemoteSensing_Data\\Landsat\\Projection_File\\BUTM.prj"&lt;BR /&gt;&lt;BR /&gt;for folder in folders:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = folder&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(folder)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rastersList = arcpy.ListRasters("*_sr_*","TIF")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rastersList:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(raster)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; projOutA="G:\\RemoteSensing_Data\\Landsat\\Landsat_05\\Year_1989\\Row_138\\BUTM\\"+raster&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ProjectRaster_management(raster, projOutA, outPut_cs,"BILINEAR", inPut_cs)&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2016 16:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-batch-repjection-of-landsat-8/m-p/189613#M14554</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2016-12-04T16:35:40Z</dc:date>
    </item>
  </channel>
</rss>

