<?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: Describe().SpatialReference.Name with period in file name in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664466#M51631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help. I tried making the the shapefile into a layer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;gp.MakeFeatureLayer('D:/Temp/Test.2.shp','t2')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and received this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;ERROR 000732: Input Features: Dataset D:/Temp/Test.2.shp does not exist or is not supported&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think my best bet is going to be to rename the offending files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Mar 2011 17:56:05 GMT</pubDate>
    <dc:creator>DanWakefield1</dc:creator>
    <dc:date>2011-03-09T17:56:05Z</dc:date>
    <item>
      <title>Describe().SpatialReference.Name with period in file name</title>
      <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664463#M51628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm running ArcGIS 9.3.1 and I have a shapefile with a period in the name, such as "Test.2.shp", which I can not use Describe to get the projection for. When I try to use gp.Describe('Test.2.shp').SpatialReference.Name, I get the error "RuntimeError: DescribeData: Method SpatialReference does not exist."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcgisscripting, sys

gp = arcgisscripting.create(9.3)
gp.SetProduct("ArcInfo")
gp.workspace = 'D:/Temp'

print 'Test1.shp Name: '+gp.Describe('Test1.shp').Name
print 'Test.2.shp Name: '+gp.Describe('Test.2.shp').Name

print 'Test1 Prj: '+gp.Describe('Test1.shp').SpatialReference.Name
print 'Test.2 Prj: '+gp.Describe('Test.2.shp').SpatialReference.Name
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this is the result from the command line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Test1.shp Name: Test1.shp
Test.2.shp Name: Test.2.shp
Test1 Prj: NAD_1983_StatePlane_Illinois_East_FIPS_1201
Traceback (most recent call last):
&amp;nbsp; File "D:\Temp\test.py", line 11, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Test.2 Prj: '+gp.Describe('Test.2.shp').SpatialReference.Name
RuntimeError: DescribeData: Method SpatialReference does not exist&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both Test1.shp and Test.2.shp have the same projection. Am I doing something wrong, or does anyone have a suggestion for me? I'd prefer not to have to rename the files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 15:59:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664463#M51628</guid>
      <dc:creator>DanWakefield1</dc:creator>
      <dc:date>2011-03-09T15:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Describe().SpatialReference.Name with period in file name</title>
      <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664464#M51629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Generally speaking:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Only name GIS datasets using letters, numbers, or an "_".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Always start the name (database names, rasters, featureclasses, field names too!, etc.) with a letter (not a number or an underscore).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Avoid spaces and special characters (such as a ".", "&amp;amp;", "#", etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) If you can help it, keep names &amp;lt;= 10 characters. There are many exceptions of course, but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have followed these four basic rules for 12 years, and have never gone wrong. Sorry, but I think you will have to rename your shapefile to get this to work (maybe reformat to a FGDB, and the "." may be supported in that format?).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 16:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664464#M51629</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-03-09T16:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Describe().SpatialReference.Name with period in file name</title>
      <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664465#M51630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you try making a feature layer from the unfortunately-named shapefile and then try the describe on that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fc = r"C:\temp\test.badname.shp"
gp.MakeFeatureLayer(fc,"fl")
dscObj = gp.describe("fl")
srObj = dscObj.spatialreference
print srObj.name&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664465#M51630</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T04:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Describe().SpatialReference.Name with period in file name</title>
      <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664466#M51631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help. I tried making the the shapefile into a layer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;gp.MakeFeatureLayer('D:/Temp/Test.2.shp','t2')&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and received this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;ERROR 000732: Input Features: Dataset D:/Temp/Test.2.shp does not exist or is not supported&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think my best bet is going to be to rename the offending files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 17:56:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664466#M51631</guid>
      <dc:creator>DanWakefield1</dc:creator>
      <dc:date>2011-03-09T17:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Describe().SpatialReference.Name with period in file name</title>
      <link>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664467#M51632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmm...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option (assuming this works), would be to temporarily rename the shapefile (use the Rename tool), use the describe, and then rename it back. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yet another option: There is a .prj file that accompanies the .shp (assuming there is a defined projection). Instead of using the describe method directly, maybe just have Python look for/read the .prj file. The prj string can then be loaded into a SR object using the "loadFromString" method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2011 18:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/describe-spatialreference-name-with-period-in-file/m-p/664467#M51632</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-03-09T18:07:44Z</dc:date>
    </item>
  </channel>
</rss>

