<?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: Batch reproject in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653211#M50876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Instances of ".upper ==" should be changed to "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;.upper() ==" - you need to call the upper method that belongs to the string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2015 16:59:10 GMT</pubDate>
    <dc:creator>PeteCrosier</dc:creator>
    <dc:date>2015-03-23T16:59:10Z</dc:date>
    <item>
      <title>Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653206#M50871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to get this script to find all .tif and .shp files and reproject them as shown.&amp;nbsp; Having trouble getting it to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import sys, arcpy, os&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mypath = &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;r'C:\input '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Images = []&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = mypath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ThisFile in os.listdir(mypath):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisName,thisExt = os.path.splitext(ThisFile)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if thisExt.upper == ".TIF":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Images.append(ThisFile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;out_workspace = r'C:\output'&lt;/P&gt;&lt;P&gt;OutSR = arcpy.SpatialReference(26916)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ThisFile in Images:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(ThisFile)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SR = desc.spatialReference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SR.factoryCode != 26916:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ProjectRaster_management(ThisFile,out_workspace + "\\" + ThisFile,OutSR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ShapeFiles = []&lt;/P&gt;&lt;P&gt;for ThisFile in os.listdir(mypath):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisName,thisExt = os.path.splitext(ThisFile)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if thisExt.upper == ".SHP":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShapeFiles.append(ThisFile)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ThisFile in ShapeFiles:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(ThisFile)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SR = desc.spatialReference&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if SR.factoryCode != 26916:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Project_management(ThisFile,out_workspace + "\\" + ThisFile,OutSR)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653206#M50871</guid>
      <dc:creator>RobertRossell1</dc:creator>
      <dc:date>2015-03-23T15:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653207#M50872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the error message?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653207#M50872</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-03-23T15:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653208#M50873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May have trouble with mypath backslash. Try mypath = r'C:\input '&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653208#M50873</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-03-23T15:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653209#M50874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After hitting "Enter", it simply returns to &amp;gt;&amp;gt;&amp;gt; without doing anything.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653209#M50874</guid>
      <dc:creator>RobertRossell1</dc:creator>
      <dc:date>2015-03-23T15:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653210#M50875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the input as shown.&amp;nbsp; Still nothing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653210#M50875</guid>
      <dc:creator>RobertRossell1</dc:creator>
      <dc:date>2015-03-23T15:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Batch reproject</title>
      <link>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653211#M50876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Instances of ".upper ==" should be changed to "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;.upper() ==" - you need to call the upper method that belongs to the string.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 16:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-reproject/m-p/653211#M50876</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2015-03-23T16:59:10Z</dc:date>
    </item>
  </channel>
</rss>

