Error when creating some WGS 1984 UTM spatial references

222
2
Jump to solution
05-06-2021 10:53 PM
Tim_McGinnes
Occasional Contributor III

Arcpy in ArcGIS Pro 2.7.3 is giving errors when trying to create a spatial reference. It is happening with single digit WGS 1984 UTM Zones. Code to replicate below:

sr = arcpy.SpatialReference("WGS 1984 UTM Zone 10N")
print(sr.name)
WGS_1984_UTM_Zone_10N

sr = arcpy.SpatialReference("WGS 1984 UTM Zone 6S")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\mixins.py", line 942, in __init__
    self._arc_object.createFromFile(item, vcs)
RuntimeError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.

Found while investigating this post:

Create model that calculates spatial reference from a layer 

0 Kudos
1 Solution

Accepted Solutions
RandyBurton
MVP Regular Contributor

You might try two spaces between Zone and 6S.  I ran into a similar problem with Desktop, and the extra space was the fix. I think the extra space is used for aligning single and double digits.

>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 10N")
>>> print sr.name
WGS_1984_UTM_Zone_10N
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 6S") # single space
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\arcobjects\mixins.py", line 992, in __init__
    self._arc_object.createFromFile(item, vcs)
RuntimeError: ERROR 999999: Error executing function.
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone  6S") # double space
>>> print sr.name
WGS_1984_UTM_Zone_6S

 

View solution in original post

2 Replies
RandyBurton
MVP Regular Contributor

You might try two spaces between Zone and 6S.  I ran into a similar problem with Desktop, and the extra space was the fix. I think the extra space is used for aligning single and double digits.

>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 10N")
>>> print sr.name
WGS_1984_UTM_Zone_10N
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone 6S") # single space
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\arcobjects\mixins.py", line 992, in __init__
    self._arc_object.createFromFile(item, vcs)
RuntimeError: ERROR 999999: Error executing function.
>>> sr = arcpy.SpatialReference("WGS 1984 UTM Zone  6S") # double space
>>> print sr.name
WGS_1984_UTM_Zone_6S

 

View solution in original post

JayantaPoddar
MVP Esteemed Contributor

Yes. I found the same.

JayantaPoddar_0-1620369883522.png

 

The cause lies with the list of names of coordinate systems for ArcGIS Pro.

JayantaPoddar_1-1620370066758.png

Same with ArcMap as well.

0 Kudos