Level DEM: Spatial reference does not have z unit

14520
8
07-12-2011 08:43 PM
Labels (1)
xiaoliDong
New Contributor
I am using ArcHydro tool for ArcGIS 10. When I was doing the function "Level DEM", it always pops out this error saying "Level DEM: Spatial reference does not have z unit". Does anyone have the same problem? Could anyone please help me solve this problem? Is there a way to add z unit to the input raster data?

Thank you very much in advance.
Tags (2)
0 Kudos
8 Replies
ChristineDartiguenave
Esri Contributor
One way of doing this is to edit the projection file associated to the input grid.

- Open the prj file associated to the grid (prj.adf) in a text editor.
- Set the parameters Units to the desired value (e.g. FEET, METERS) for the ground unit if not set.
- Set the parameters Zunits to the desired value for the z-unit. This parameter is set to NO if the z-unit is not explicitly defined: in that case the z-unit is assumed to be the same as the ground unit.

The zunits parameter may be set using a unit name (e.g. METERS, FEET) or a number in the projection file: this number represents the number of zunits that are needed to equal one meter (not one ground unit). For example, for a ground unit in meters, a z-unit in centimeter is defined as:

Units  METERS
Zunits 100
as there are 100 cm in 1m.

For a ground unit in feet, a z-unit in centimeter is defined as:
Units  FEET
Zunits 100
as there are 100 cm in 1m.

Christine Dartiguenave
Esri Water Resources Team
0 Kudos
curtvprice
MVP Esteemed Contributor

The WTK describes these parameters. Looks they are not exposed in arcpy.SpatialReference, at least as of 10.2.2.

I was trying to get at them with setZFalseOriginAndUnits (false_z, z_units) using values [0, 100]  but that doesn't seem to change the WTK text when exported.

PROJCS['NAD_1983_Albers',
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['Albers'],
PARAMETER['False_Easting',0.0],
PARAMETER['False_Northing',0.0],
PARAMETER['central_meridian',-96.0],
PARAMETER['Standard_Parallel_1',29.5],
PARAMETER['Standard_Parallel_2',45.5],
PARAMETER['latitude_of_origin',23.0],
UNIT['Meter',1.0]],
VERTCS['Unknown VCS',VDATUM['Unknown'],
PARAMETER['Vertical_Shift',0.0],
PARAMETER['Direction',1.0],
UNIT['User_Defined_Unit',0.01]];
-16901100 -6972200 266467840.990852;-100000 100;-100000 10000;0.001;0.1;0.001;IsHighPrecision
0 Kudos
ChristineDartiguenave
Esri Contributor

The spatial reference is now read from the auxiliary file (*.aux.xml) associated to the raster. This file contains information on the raster that cannot be stored in the raster itself (e.g. spatial reference in the SRS section).

The old projection file is overwritten based on the content of the auxiliary file – this is why ArcMap will not recognize the changes to the projection file.

You can modify the spatial reference properties and set the z unit in the Z Coordinate System tab in the Spatial Reference Properties window.

You can select an existing Z Coordinate System or create a custom one by right-clicking and existing one and selecting Copy and Modify.

Christine Dartiguenave

Esri Water Resources Team

AxelThomas
New Contributor III

Christine,

I am having the same trouble: any modifications in the adf.prj-file are not recognized by ArcHydro. My raster coordinate system is a national reference system without a Z coordinate system. Consequently the Spatial Reference Properties window does only show a XY Coordinate System tab - there are no existing Z-coordinate systems to modify according to your post. How do I add a new one?

Thank you very much in advance!

Axel

0 Kudos
curtvprice
MVP Esteemed Contributor

Christine, is there a way to do this from Python? This is why I was dismayed it apparently isn't supported in the SpatialReference object even though it seemed like it should be.

0 Kudos
AxelThomas
New Contributor III

Any way to modify the Z-coordinate system values would be ok for me: manually, Python, ArcObjects - we only need the information how to do it...

Cheers,

Axel

curtvprice
MVP Esteemed Contributor

I got a question about this today and looked into it again. The Define Projection tool does the trick. That tool exposes the Z coordinate tab so you can set the values. When I set the Z values to NAVD88 and units to centimeters, it runs successfully and it seems to "take" - at least when i describe it I can see it has been set.

Define Projection with Z

Check of results in Python window:

>>> arcpy.Describe("elev_cm.tif").spatialReference.exportToString()

u"PROJCS['USA_Contiguous_Albers_Equal_Area_Conic_USGS_version',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['Albers'],PARAMETER['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',-96.0],PARAMETER['standard_parallel_1',29.5],PARAMETER['standard_parallel_2',45.5],PARAMETER['latitude_of_origin',23.0],UNIT['Meter',1.0]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Centimeter',0.01]];-16901100 -6972200 266467840.990852;-100000 100;-100000 10000;0.001;0.1;0.001;IsHighPrecision"

0 Kudos
curtvprice
MVP Esteemed Contributor

I have an update on this, 10.5 has improved Z support on the SpatialReference object, which now has a vcs property. 

Still don't see an easy way to change the Z units, but you can define canned xy and z systems with codes:

SR = arcpy.SpatialReference(102039, 5703)

SpatialReference—Help | ArcGIS Desktop 

VCS—Help | ArcGIS Desktop 

0 Kudos