Assign Spatial Reference for Vertical Coordinate system?

5078
2
05-19-2015 04:14 AM
JohnLay
Occasional Contributor

Is it possible to assign the Vertical Coordinate System using a coordinate system's factory code (or authority code)?

Something along the lines of

arcpy.SpatialReference(105703)

for NAVD 1988 (US survey feet).

SpatialReference only works for Geographic and Projected Coordinate systems.

0 Kudos
2 Replies
DanPatterson_Retired
MVP Esteemed Contributor

The only thing I have noticed is the ability to use a scale factor to convert Z-values from meters to feet when converting to raster format.  I presume that you have experimented.  Did you get an error message along these lines...

>>> import arcpy
>>> arcpy.SpatialReference(105703)
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\mixins.py", line 949, in __init__
    self._arc_object.createFromFile(item)
RuntimeError: ERROR 999999: Error executing function.
the input is not a geographic or projected coordinate system
>>>

probably because arcmap only uses X and Y values to assess equality for spatial relationships as outlined in my blog post..

0 Kudos
JohnLay
Occasional Contributor

I'm actually trying to simplify this:

arcpy.CreateFeatureDataset_management(Test_gdb, "DoesItWork", "PROJCS['NAD_1983_2011_StatePlane_North_Carolina_FIPS_3200_Ft_US',GEOGCS['GCS_NAD_1983_2011',DATUM['NAD_1983_2011',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',2000000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-79.0],PARAMETER['Standard_Parallel_1',34.3333333333333],PARAMETER['Standard_Parallel_2',36.1666666666667],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',33.75],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988 Geoid12a',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]];-121841900 -93659000 3048.00609601219;-100000 10000;-100000 10000;3.28083333333333E-03;0.001;0.001;IsHighPrecision")

into something that is a little more manageable and less prone to error.

If I replace

arcpy.CreateFeatureDataset_management(Test_gdb, "DoesItWork", "PROJCS [ ... ],VERTCS[ ... ]; ... 

with

StatePlane = arcpy.SpatialReference(103122)
arcpy.CreateFeatureDataset_management(Test_gdb, "DoesItWork", "PROJCS[StatePlane], ,VERTCS[ ... ]; ...

I'm halfway there. I just need to find a way to simplify the vertical spatial reference.

I am trying to write a script that will create a feature dataset in order to create terrains. I have to do this 100 times for each of our 100 counties. But, I want the code to be easily manipulated so that it can be absorbed into other projects.

0 Kudos