HydrologicEngineeringCenter / hec-dss

source code for HEC-DSS (Data Storage System)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSS grid, and origin considered by HEC-RAS

vcloarec opened this issue · comments

Hi,

I've done some tries to construct some DSS grid data to bring them to HEC-RAS.

I am wondering about _xCoordOfGridCellZero and _yCoordOfGridCellZero parameters of the zStructSpatialGrid struct.
Tell me if I am wrong, but it seems that HEC-RAC handles only grid with these parameters set to 0, and for this reason if I have a grid that have not its origin exactly proportional to the cell size, (_lowerLeftCellX x _cellSize , _lowerLeftCellY x _cellSize) in real world coordinate, my grid could not be perfectly well positioned.

For example, when I have a grid with a bottom left origin with real world coordinate (123.45 , 56,78) and a cell size of 1.0, I will have my DSS grid origin set to (_lowerLeftCellX = 123 , _lowerLeftCellY= 57), because I have to start from (0,0). So, in real world coordinate, my dss grid orgin will be (123.00 , 57.00) instead of the real origin.

Am I wrong? May be I missed something with HEC-RAS?

I found some documentation in a Java class called SpecifiedGridInfo.

/**
 * The SpecifiedGridInfo class inherits from GridInfo, extending the grid metadata to support 
 * any coordinate system, and adding new metadata fields that HEC has determined would 
 * be useful since the original GridInfo was defined in 1994.  
 * 
 * The new data fields are:
 *   _srsName (String) The name of the spatial reference system (SRS) for the grid.
 *   _srsDefinition (String) A complete spatial reference identifier in a text 
 *         of arbitrary length.  For present use, we are populating this field 
 *         with a Spatial Reference Identifier in well-known text (WKT) format.
 *   _xCoordOfGridCellZero (float) The x coordinate value, in the SRS, of the
 *         lower left corner (not the center) of cell (0, 0).
 *   _yCoordOfGridCellZero (float) The y coordinate value, in the SRS, of the
 *         lower left corner (not the center) of cell (0, 0).
 *   _nullValue (float) the value used in the grid's data array to represent a "no data"
 *         cell.
 *   _timeZoneID (String) a name for the time zone that applies to the data in the grid.
 *   _timeZoneRawOffset (int) Offset in milliseconds from UTC.
 *   _isTimeStamped (boolean) false for data that is time-invariant (e.g. grids of 
 *         stable parameters, like ground elevation).
 *   _isTSElement (boolean) false for data that is time-invariant (e.g. grids of 
 *         stable parameters, like ground elevation).
 *   _isInterval (boolean) false for instantaneous values, true for period data.
 *         
 * In addition, the GridInfo version number is explicitly stored in the header of the 
 * DSS record, and the compression method defaults to ZLIB's deflate method
 *

thanks @ktarbet , I think I have also seen this doc in the C file or something quite similar.

But my question is more about the behavior of HEC-RAS that the definition of this parameters, that I think I have understood.
But may-be it is the wrong place to talk about HEC-RAS behavior?

With the the info above about _xCoordOfGridCellZero , @ajkennedy-HEC may have suggestions.

closing this issue: @vcloarec There are some means of contact for RAS here : https://www.hec.usace.army.mil/software/hec-ras/