The Java package hec.heclib.grid contains classes that provide an organizational framework for grid data and metadata as they are stored in grid records in DSS files and operated on in Java programs such as HEC-HMS and HEC-DssVue. Users of DssVue can use these classes in Jython scripts to carry out customized analyses or data processing.

Summarizing very briefly, the cells in the HEC grids are referenced by row and column number, with numbers increasing upwards and to the right (or to the north and east) away from an implied origin cell in row 0, column 0. The positioning and numbering of the rows and columns are set in advance, so that the indices become an indirect form of geo-referencing. Once a system of row and column numbering is established, a given pair of row and column numbers always refers to the same area on the earth’s surface. This system of indirect geo-referencing by row and column number was established to take advantage of precipitation data provided by the US National Weather Service using the Hydrologic Rainfall Analysis Program (HRAP) grid, and generalized to support other coordinate systems.


A single grid covers a range of rows and columns, starting from an origin, identified by a pair of integers, and covering an extent of rows and columns identified by another pair of integers. The extent values determine the number of cells in the grid, and a one-dimensional vector of values is mapped by row, starting in the lower-left cell, to the cells in the grid.


In HEC Java programs, a grid is represented by an object of class hec.heclib.grid.GridData. The metadata for a grid is represented by an object of class hec.heclib.grid.GridInfo. Every GridData object contains a GridInfo object, so grids always have access to their data and metadata. The structure of HEC-DSS grid records, which correspond closely to the attributes of GridData and GridInfo classes


The hec.heclib.grid.GriddedData class manages storage and retrieval of GridData and GridInfo objects in DSS files and records. GriddedData is a sub-class of HecDataManager, and inherits methods for opening and cataloging DSS files, setting pathname parts, and identifying record types (this is not a complete list of inherited methods) from its various super-classes. Once a DSS file and path are set for a GriddedData object, the storeGriddedData and retrieveGriddedData methods are available for storing or retrieving GridData and GridInfo objects in DSS files.