<?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: Check Projection/Coordinate tool or script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566731#M44383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Andrew and Dan. Success (plus, I see what I was doing wrong)! I just couldn't get over that hurdle in a reasonable amount of time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: DescribeProjection "T:\WORK FOLDER\DEN_MP_SPCS.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Tue Feb 22 11:27:19 2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Running script DescribeProjection...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PROJCS['NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',3000000.000316083],PARAMETER['False_Northing',999999.999996],PARAMETER['Central_Meridian',-105.5],PARAMETER['Standard_Parallel_1',38.45],PARAMETER['Standard_Parallel_2',39.75],PARAMETER['Latitude_Of_Origin',37.83333333333334],UNIT['Foot_US',0.3048006096012192]];-118767900 -94525500 36985113.7070648;-100000 10000;-100000 10000;3.28083333333333E-03;0.001;0.001;IsHighPrecision&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Completed script DescribeProjection...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Tue Feb 22 11:27:19 2011 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Feb 2011 16:28:18 GMT</pubDate>
    <dc:creator>AshleyMott</dc:creator>
    <dc:date>2011-02-22T16:28:18Z</dc:date>
    <item>
      <title>Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566724#M44376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know of a tool or&amp;nbsp; a python script that just returns the projection/coordinate system of a shapefile/feature class? In addition, and I know this sounds dumb, but it would be great if you could drag multiple shapefiles in like a batch. If the files were different, the tool would error out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:59:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566724#M44376</guid>
      <dc:creator>AshleyMott</dc:creator>
      <dc:date>2011-02-17T17:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566725#M44377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Or, just single file is good. I can probably figure the rest. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566725#M44377</guid>
      <dc:creator>AshleyMott</dc:creator>
      <dc:date>2011-02-17T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566726#M44378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The MultiMXD script would probably work if you saved an mxd with all your files first&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=A910AB18-1422-2418-3418-3885D388EF60"&gt;http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=A910AB18-1422-2418-3418-3885D388EF60&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There might be a different tool in here somewhere that would work better. It is a pile of mxd production/management stuff demonstrating python/arcpy functionality.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 21:36:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566726#M44378</guid>
      <dc:creator>MichaelStead</dc:creator>
      <dc:date>2011-02-17T21:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566727#M44379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Describe/000v00000026000000/"&gt;Describe&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000000t000000.htm"&gt;tool validation&lt;/A&gt;&lt;SPAN&gt; to check the projections before running tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 10:11:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566727#M44379</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2011-02-22T10:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566728#M44380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Michael and Andrew.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am attempting to create a Python script that will let me "describe" the projection of a dataset. I want to use this script in a tool I created in ArcCatalog (Add Script). See attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am a little lost, because I don't know Python that well/at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am thinking I need to define parameters? I am getting this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.NameError'&amp;gt;: name 'prjFile' is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (DescribeProjection).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All I want the tool to do is tell you what projection that a dataset is in. You would either drag the dataset into the tool or search for it in a file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 15:47:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566728#M44380</guid>
      <dc:creator>AshleyMott</dc:creator>
      <dc:date>2011-02-22T15:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566729#M44381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;off hand, SpatialReference is case sensitive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;""" &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;*******************************************************************************************
 NAME: DescribeProjection
 Source Name: DescribeProjection.py
 Version: ArcGIS 10.0
 Author: Ashley Mott
 Usage: DescribeProjection &amp;lt;input_data&amp;gt;, &amp;lt;input_coordinate_system&amp;gt;
 Required Arguments: A set of input feature classes or feature layers
 Description: Returns the coordinate system and/or projection of a dataset.
 Date Created: 02/22/2011

********************************************************************************************** """

import arcpy

# Get the feature class to describe
#
featureClass = arcpy.GetParameterAsText(0)
desc = arcpy.Describe(featureClass)

# Create a Describe Object from the prj file.
#
#desc = arcpy.Describe(prjFile)&amp;nbsp; # does nothing

# Print some SpatialReference object properties
SR = desc.SpatialReference&amp;nbsp; #case sensitive
print "SR: ", str(SR)
#haven't checked the rest
print "Name: " + SR.name
print "Type: " + SR.type
print "FalseOriginAndUnits: " + desc.falseOriginAndUnits&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:25:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566729#M44381</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566730#M44382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your code you have this: desc = arcpy.Describe(prjFile). The variable prjFile is not defined.&amp;nbsp; Since you are pointing to a featureclass, you can just access the featureclass' spatial reference directly without having to use the .prj file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

# Get the feature class to describe
#
featureClass = arcpy.GetParameterAsText(0)
desc = arcpy.Describe(featureClass)
# Print some SpatialReference object properties
SR = desc.spatialReference
print SR.name
# shows results in commandline of IDLE
print SR.exportToString()
# Show results in geoprocessing tool dialog 
arcpy.AddMessage(SR.name)
arcpy.AddMessage(SR.exportToString())
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:25:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566730#M44382</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2021-12-12T00:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check Projection/Coordinate tool or script</title>
      <link>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566731#M44383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Andrew and Dan. Success (plus, I see what I was doing wrong)! I just couldn't get over that hurdle in a reasonable amount of time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: DescribeProjection "T:\WORK FOLDER\DEN_MP_SPCS.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Tue Feb 22 11:27:19 2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Running script DescribeProjection...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PROJCS['NAD_1983_StatePlane_Colorado_Central_FIPS_0502_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',3000000.000316083],PARAMETER['False_Northing',999999.999996],PARAMETER['Central_Meridian',-105.5],PARAMETER['Standard_Parallel_1',38.45],PARAMETER['Standard_Parallel_2',39.75],PARAMETER['Latitude_Of_Origin',37.83333333333334],UNIT['Foot_US',0.3048006096012192]];-118767900 -94525500 36985113.7070648;-100000 10000;-100000 10000;3.28083333333333E-03;0.001;0.001;IsHighPrecision&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Completed script DescribeProjection...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Tue Feb 22 11:27:19 2011 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 16:28:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-projection-coordinate-tool-or-script/m-p/566731#M44383</guid>
      <dc:creator>AshleyMott</dc:creator>
      <dc:date>2011-02-22T16:28:18Z</dc:date>
    </item>
  </channel>
</rss>

