<?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: Find and fix images ith Spatial Reference Undefined. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469802#M36673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do refresh ArcCatalog between runs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Feb 2016 02:54:12 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-02-26T02:54:12Z</dc:date>
    <item>
      <title>Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469786#M36657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a directory with 370 tifs.&amp;nbsp; I just found out that a few, an unknown number, have the projection undefined, but they draw aligned with the know projection tifs, so no mystery there.&amp;nbsp; I thought I could loop through a list of tifs in the folder and set the definition on the files missing, similar to &lt;A _jive_internal="true" href="https://community.esri.com/thread/13078"&gt;https://community.esri.com/thread/13078&lt;/A&gt;&amp;nbsp; but wondered if I should add an "if" to check if the image is one of the ones with projection undefined. But what would be that test?&amp;nbsp; Do you think the test would speed up execution or not?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 22:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469786#M36657</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-01-14T22:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469787#M36658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;since you don't appear to be afraid of scripting, I will refer you to &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/spatialreference.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/spatialreference.htm"&gt;SpatialReference—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which contains all the appropriate information of coordinate systems and their associated properties.&amp;nbsp; The code sample at the bottom will be of use to you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 22:06:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469787#M36658</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-14T22:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469788#M36659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figure the code would be something like this, revised slightly from something I had laying around for fixing shapefiles, trying to remove the old style gp stuff. I'm still trying to figure out how I might test for projection undefined. but it might run just as fast without the test. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting, sys, os, arcpy
from arcpy import env
# Load required toolboxes...&amp;nbsp; 
#gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#workspace&amp;nbsp; 
env.Workspace = "G:\\usgs_quads\\test"&amp;nbsp; 
#coordsys = "C:\\Program Files\\ArcGISCoordinate Systems\\Projected Coordinate Systems\\National Grids\\British National Grid.prj"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#List all features in&amp;nbsp; gp.workspace&amp;nbsp; 
rasters = arcpy.ListRasters("*", "TIF")&amp;nbsp; 
#raster = rasters.Next()


# get the coordinate system by describing a feature class
dsc = arcpy.Describe("YESMOWIT CANYON.tif")
coord_sys = dsc.spatialReference

&amp;nbsp; 
for raster in rasters:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.defineprojection(raster, coord_sys)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc + " is defined."&amp;nbsp; 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469788#M36659</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T20:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469789#M36660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you did check the code sample in my previous post from the help file?.&amp;nbsp;&amp;nbsp; You want to get a list of them first ... before ... you define them.&amp;nbsp; Just to make sure we are on the same page &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps you don't need arcgisscripting and check to see whether workspace is capitalized in env.w...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 22:45:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469789#M36660</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-14T22:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469790#M36661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&amp;nbsp; the sample code was very helpful. Spent too much time looking through the Syntax and Properties section, when the sample had a clear example of the test.&amp;nbsp; And yes lower case w on workspace was also needed. I couldn't figure out why my raster list seemed to be empty when it hit line 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code worked on a sample data folder.&amp;nbsp; Now I'll run it on the rest.&amp;nbsp; I'm not sure if this testing if the coordinate system is undefined decreased run time or if I could even notice a difference&amp;nbsp; with 370 files. Maybe 3000 files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys, os, arcpy
from arcpy import env
# Load required toolboxes...&amp;nbsp; 
#gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#workspace&amp;nbsp; 
env.workspace = "G:\\usgs_quads\\test"&amp;nbsp; 
#coordsys = "C:\\Program Files\\ArcGISCoordinate Systems\\Projected Coordinate Systems\\National Grids\\British National Grid.prj"&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#List all features in&amp;nbsp; gp.workspace&amp;nbsp; 
rasters = arcpy.ListRasters("*", "TIF")&amp;nbsp; 
#raster = rasters.Next()


# get the coordinate system by describing a feature class
dsc = arcpy.Describe("YESMOWIT CANYON.tif")
coord_sys = dsc.spatialReference

&amp;nbsp; 
for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the spatial reference object
&amp;nbsp;&amp;nbsp;&amp;nbsp; spatial_ref = arcpy.Describe(raster).spatialReference

&amp;nbsp;&amp;nbsp;&amp;nbsp; # If the spatial reference is unknown
&amp;nbsp;&amp;nbsp;&amp;nbsp; if spatial_ref.name == "Unknown":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DefineProjection_management(raster, coord_sys)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster + " is defined."&amp;nbsp; 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469790#M36661</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T20:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469791#M36662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wouldnt worry about runtime... there are even clever shortcuts like making multiple copies of *.tfw world files to match *.tif files... and assuming you want the files to remain as separate entities initially at least... but lets not go there. Just let arcpy do its work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469791#M36662</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-14T23:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469792#M36663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I see where I picked up uppercase W on Workspace.&amp;nbsp; I was looking at some old code examples from wayyyyyy back in 2010, back when everything started with creating a gp object.&amp;nbsp; Then it was gp.Workspace.&amp;nbsp;&amp;nbsp; That's so six years ago.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469792#M36663</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-01-14T23:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469793#M36664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope you are ready for the transition to Python 3.x and arcgis pro ... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 23:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469793#M36664</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-14T23:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469794#M36665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A strange thing is happening today. I found another folder with a few undefined projection tifs in it.&amp;nbsp; I changed my script so env.workspace = this new folder.&amp;nbsp;&amp;nbsp; But the script never gets any hits on the if spatial_ref.name == "Unknown": line.&amp;nbsp; I stuck in a line around line 12 to print out my raster list and verified that I am getting the tifs into the list.&amp;nbsp; Then I moved some of the known undefined spatial reference tifs into a test folder, and ran the script on the test folder.&amp;nbsp; Same deal. Is there a kind of "undefined"&amp;nbsp; that the spatial_ref.name == "Unknown": can't detect?&amp;nbsp; In ArcCatalog, the properties of this tifs reveal that the Spatial Reference is &amp;lt;Undefined&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 00:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469794#M36665</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-02-20T00:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469795#M36666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your last two lines don't appear to be indented properly, correct and see what it does.&amp;nbsp; Also, add a print statement above the if statement and actually print out the the name.&amp;nbsp; make sure you str it so that it will catch None etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Feb 2016 00:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469795#M36666</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-20T00:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469796#M36667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://www.vidarholen.net/contents/interjections/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.vidarholen.net/contents/interjections/&lt;/A&gt; , indentation wasn't as important in VB, or Avenue, or AML, or CPL.&amp;nbsp; But here, changing the indentation of the last two lines from two to a tab of four spaces didn't change the result.&amp;nbsp; Still don't detect spatial reference == "unknown"&amp;nbsp; and hit the defineProjection and the print raster + " is defined".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a hard time figuring out the print statement, but finally discovered it was simpler than I thought.&amp;nbsp; Now I get a print out of spatial_ref string but I don't know what it means.&amp;nbsp; In this test folder,&amp;nbsp; ANDERSON LAKE.tif is defined as Washington State Plane S., while the rest are undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the spatial reference object
&amp;nbsp;&amp;nbsp;&amp;nbsp; spatial_ref = arcpy.Describe(raster).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print "\n".join(raster).join(str(spatial_ref))
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print "\n".join(raster),str(spatial_ref)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print "\n".join(raster)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print "\n".join(str(spatial_ref))
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print (str(spatial_ref))
&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster + " " + (str(spatial_ref))
&amp;nbsp;&amp;nbsp;&amp;nbsp; # If the spatial reference is unknown
&amp;nbsp;&amp;nbsp;&amp;nbsp; if spatial_ref.name == "Unknown":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DefineProjection_management(raster, coord_sys)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster + " is defined."&amp;nbsp; 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ANDERSON LAKE.tif &amp;lt;geoprocessing spatial reference object object at 0x113B3A88&amp;gt;
INDIAN ROCK.tif &amp;lt;geoprocessing spatial reference object object at 0x113B3AA0&amp;gt;
JENNIES BUTTE.tif &amp;lt;geoprocessing spatial reference object object at 0x113B3908&amp;gt;
JUNGLE BUTTE.tif &amp;lt;geoprocessing spatial reference object object at 0x113B3A88&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469796#M36667</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T20:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469797#M36668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interjection #4.&amp;nbsp; The result object in the print statement (line 9) is good, because it means that you obtained the spatial reference object.&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/spatialreference.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/spatialreference.htm"&gt;SpatialReference—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From there, you can now navigate through and get its properties, like whether it if a geographic or projected coordinate system, its POSC code, its name and the like.&lt;/P&gt;&lt;P&gt;PS&lt;/P&gt;&lt;P&gt;use spaces not tabs, 4 is generally the rule, but Guido says there are no rules, print has changed in python 3, get used to it justt put everything in brackets and learn the python mini-formatting language) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 21:20:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469797#M36668</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-22T21:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469798#M36669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I'm getting it. The print formatting stuff and the spatialReference object.&amp;nbsp; From spatialReference.name, I can see that the problem rasters are set to Lambert_Conformal_Conic_2SP,&amp;nbsp; but ArcDesktop thinks they are &amp;lt;Undefined&amp;gt;.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 21:58:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469798#M36669</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-02-22T21:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469799#M36670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now do those files have a separate world file or is the coordinate system built-in? (assuming you are still talking about tiffs.... unfortunately tiff's are under the t's in this link... &lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/supported-raster-dataset-file-formats.htm" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/supported-raster-dataset-file-formats.htm"&gt;Supported raster dataset file formats—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469799#M36670</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-22T22:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469800#M36671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Stateplane and the undefined ones all have tfw files that contain&amp;nbsp; 6 similar lines of numbers. The top and right numbers look like StatePlane,&amp;nbsp; and they draw exactly where they are supposed to on a Wash. State Plane Data Frame,&amp;nbsp; so I could just stop here and define the coordinate system of everything in the folder as State Plane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the trick in ArcCatalog to change the raster options to read the world file, but ArcCatalog still says they are undefined. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:37:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469800#M36671</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-02-22T22:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469801#M36672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Those Lambert_Conformal_Conic_2SP rasters stay stubbornly undefined.&amp;nbsp; I modified my script to skip the if test for spacial ref unknown, and tried to just define the projection for everything in the folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create the spatial reference object
&amp;nbsp;&amp;nbsp;&amp;nbsp; spatial_ref = arcpy.Describe(raster).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; print("{0} : {1}".format(raster, spatial_ref.name))
&amp;nbsp;&amp;nbsp;&amp;nbsp; # If the spatial reference is unknown
&amp;nbsp;&amp;nbsp;&amp;nbsp; #if spatial_ref.name == "Unknown":
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DefineProjection_management(raster, coord_sys)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print raster + " is defined."&amp;nbsp; 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This runs, hits both print statements, the first print statement says the spatial ref is State_Plane but ArcCatalog still says they are undefined.&amp;nbsp; In this test folder, only Anderson Lake is known to ArcCatalog as defined State Plane. &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ANDERSON LAKE.tif : NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet
ANDERSON LAKE.tif is defined.
INDIAN ROCK.tif : NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet
INDIAN ROCK.tif is defined.
JENNIES BUTTE.tif : NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet
JENNIES BUTTE.tif is defined.
JUNGLE BUTTE.tif : NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet
JUNGLE BUTTE.tif is defined.&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469801#M36672</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T20:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469802#M36673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do refresh ArcCatalog between runs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 02:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469802#M36673</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-26T02:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469803#M36674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried refreshing ArcCatalog, restarting ArcCatalog, restarting the PC, and changing the ArcCatalog options to "Use world file" and back.&amp;nbsp; State plane is a kind of Lambert_Conformal_Conic_2SP, so .spatialReference is getting part of the idea, but ArcCatalog is not. The bad tifs have a world file that is similar to the good tifs.&amp;nbsp; Maybe I can attach one here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 17:37:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469803#M36674</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-02-26T17:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469804#M36675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am going to flag the expert on projections to help with this &lt;A href="https://community.esri.com/migrated-users/3120"&gt;Melita Kennedy&lt;/A&gt;​ could you have a browse through this post and see if you can make any suggestions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 17:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469804#M36675</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-26T17:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find and fix images ith Spatial Reference Undefined.</title>
      <link>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469805#M36676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ANDERSON LAKE is a good tif,&amp;nbsp; INDIAN ROCK is a bad tif. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 19:32:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-and-fix-images-ith-spatial-reference/m-p/469805#M36676</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2016-02-26T19:32:09Z</dc:date>
    </item>
  </channel>
</rss>

