<?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: Error creating spatial reference from Alaska state plane system in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132580#M10292</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had several occasions to need the name of coordinate system, with no underscores, the proper spacing, parenthesis around 'feet', etc.&amp;nbsp; I noticed that &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listspatialreferences.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListSpatialReferences&lt;/A&gt;&amp;nbsp;appears to&amp;nbsp;provide&amp;nbsp;that if you look at the function's&amp;nbsp;return string.&amp;nbsp;&amp;nbsp;A slight modification of the sample code&amp;nbsp;by inserting&amp;nbsp;line 9:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# Get the list of spatial references&lt;/SPAN&gt;
srs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListSpatialReferences&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*alaska*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a SpatialReference object for each one and print the&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# central meridian&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; sr_string &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; srs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; sr_string&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'/'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# coordinate system name text&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# sr_object = arcpy.SpatialReference(sr_string)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# print "{0.centralMeridian}   {0.name}".format(sr_object)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'''
part of the output:

NAD 1983 StatePlane Alaska  1 FIPS 5001 (US Feet)
NAD 1983 StatePlane Alaska  2 FIPS 5002 (US Feet)
NAD 1983 StatePlane Alaska  3 FIPS 5003 (US Feet)
NAD 1983 StatePlane Alaska  4 FIPS 5004 (US Feet)
NAD 1983 StatePlane Alaska  5 FIPS 5005 (US Feet)
NAD 1983 StatePlane Alaska  6 FIPS 5006 (US Feet)
NAD 1983 StatePlane Alaska  7 FIPS 5007 (US Feet)
NAD 1983 StatePlane Alaska  8 FIPS 5008 (US Feet)
NAD 1983 StatePlane Alaska  9 FIPS 5009 (US Feet)
NAD 1983 StatePlane Alaska 10 FIPS 5010 (US Feet)
'''&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can see the double spaces after 'Alaska' and the parenthesis around 'feet' &amp;nbsp;in lines 16-24.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:25:49 GMT</pubDate>
    <dc:creator>RandyBurton</dc:creator>
    <dc:date>2021-12-11T07:25:49Z</dc:date>
    <item>
      <title>Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132575#M10287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a state plane feature class that covers the entire United States.&amp;nbsp; We use it to find the name of a coordinate system and plug it into arcpy.SpatialReference().&amp;nbsp; This works great for everywhere but &lt;EM&gt;most&lt;/EM&gt; Alaska coordinate systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason, it fails on every Alaska coordinate system except for one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/441703_alaska.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For what it's worth, it will accept the WKID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/441745_alaska_wkid.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it's probably better to use the WKID than a string, but I inherited this project and&amp;nbsp;it's not currently set up to use the WKID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a reason why the&amp;nbsp;function&amp;nbsp;would accept the first Alaska value, but not the second?&amp;nbsp; I can't tell if this is a bug or if someone on my end failed to update coordinate system names.&amp;nbsp; Is there a file to browse accepted system names?&amp;nbsp; The PDF (&lt;A href="http://desktop.arcgis.com/en/arcmap/10.5/analyze/arcpy-classes/pdf/projected_coordinate_systems.pdf"&gt;http://desktop.arcgis.com/en/arcmap/10.5/analyze/arcpy-classes/pdf/projected_coordinate_systems.pdf&lt;/A&gt;) isn't much help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 17:50:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132575#M10287</guid>
      <dc:creator>RyanDavis1</dc:creator>
      <dc:date>2019-04-10T17:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132576#M10288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;fails for me even when raw encoding the string... spaces or not don't make a difference, but the WKID is fine&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3120"&gt;Melita Kennedy&lt;/A&gt;‌ bug? or something obviously missed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 18:08:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132576#M10288</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-04-10T18:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132577#M10289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, how tricky of me. I think to align the zone numbers, there are &lt;STRONG&gt;2 spaces&lt;/STRONG&gt; before the numbers for zones 1 - 9. This occurs in the "display names" used in the coordinate system picker, not in the CRS names themselves. Here's one of them:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"NAD 1983 StatePlane Alaska&amp;nbsp; 1 FIPS 5001 (US Feet)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beware, when I copy-pasted it, the second space was stripped out. I had to add it back in. This is true in all the AK zones across the various geographic CRS/datums because I always copy and paste the set (in Notepad which doesn't change the spaces) and then update the geographic CRS names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Melita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit was to add phrase in last sentence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 18:20:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132577#M10289</guid>
      <dc:creator>MelitaKennedy</dc:creator>
      <dc:date>2019-04-10T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132578#M10290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use underscores... spaces are evil &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 18:25:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132578#M10290</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-04-10T18:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132579#M10291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhh, that makes sense.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yet another argument to use the WKID, but this should help me get to a quick fix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you both &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ and &lt;A href="https://community.esri.com/migrated-users/3120"&gt;Melita Kennedy&lt;/A&gt;‌.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 19:53:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132579#M10291</guid>
      <dc:creator>RyanDavis1</dc:creator>
      <dc:date>2019-04-10T19:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error creating spatial reference from Alaska state plane system</title>
      <link>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132580#M10292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had several occasions to need the name of coordinate system, with no underscores, the proper spacing, parenthesis around 'feet', etc.&amp;nbsp; I noticed that &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listspatialreferences.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListSpatialReferences&lt;/A&gt;&amp;nbsp;appears to&amp;nbsp;provide&amp;nbsp;that if you look at the function's&amp;nbsp;return string.&amp;nbsp;&amp;nbsp;A slight modification of the sample code&amp;nbsp;by inserting&amp;nbsp;line 9:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# Get the list of spatial references&lt;/SPAN&gt;
srs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListSpatialReferences&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*alaska*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a SpatialReference object for each one and print the&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# central meridian&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; sr_string &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; srs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; sr_string&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'/'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# coordinate system name text&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# sr_object = arcpy.SpatialReference(sr_string)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# print "{0.centralMeridian}   {0.name}".format(sr_object)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'''
part of the output:

NAD 1983 StatePlane Alaska  1 FIPS 5001 (US Feet)
NAD 1983 StatePlane Alaska  2 FIPS 5002 (US Feet)
NAD 1983 StatePlane Alaska  3 FIPS 5003 (US Feet)
NAD 1983 StatePlane Alaska  4 FIPS 5004 (US Feet)
NAD 1983 StatePlane Alaska  5 FIPS 5005 (US Feet)
NAD 1983 StatePlane Alaska  6 FIPS 5006 (US Feet)
NAD 1983 StatePlane Alaska  7 FIPS 5007 (US Feet)
NAD 1983 StatePlane Alaska  8 FIPS 5008 (US Feet)
NAD 1983 StatePlane Alaska  9 FIPS 5009 (US Feet)
NAD 1983 StatePlane Alaska 10 FIPS 5010 (US Feet)
'''&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can see the double spaces after 'Alaska' and the parenthesis around 'feet' &amp;nbsp;in lines 16-24.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-creating-spatial-reference-from-alaska-state/m-p/132580#M10292</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T07:25:49Z</dc:date>
    </item>
  </channel>
</rss>

