Spatial Data
zstructSpatialGridNew
Description: Creates a new spatial GRID struct
Declaration:
zStructSpatialGrid* zstructSpatialGridNew(const char* pathname);
Parameters:
const char* pathname
The pathname for this struct. Must be a valid pathname. A copy of the pathname is used in struct.
Returns: zStructSpatialGrid*
An address to the struct created.
Note:
Always call function zstructFree(struct) when finished using.
See Also:
zspatialGridStore and zspatialGridRetrieve for more information
zStructSpatialGrid
typedef struct {
// Private
int structType;
/* Required */
char *pathname;
int _structVersion; // In case we want to modify the gridstruct later
int _type; // DSS Grid Type
int _version;
char* _dataUnits;
int _dataType;
char* _dataSource; // Needed for HRAP grids
int _lowerLeftCellX;
int _lowerLeftCellY;
int _numberOfCellsX;
int _numberOfCellsY;
float _cellSize;
int _compressionMethod; //zlib for initial implementation
int _sizeofCompressedElements;
void* _compressionParameters;
char* _srsName;
// for now we're using WKT strings for the SRS definitions, but
// here's a placeholder for future options like proj4 or GML
int _srsDefinitionType;
char* _srsDefinition;
float _xCoordOfGridCellZero;
float _yCoordOfGridCellZero;
float _nullValue;
char* _timeZoneID;
int _timeZoneRawOffset;
int _isInterval; // Originally boolean
int _isTimeStamped; // Originally boolean
int _numberOfRanges;
//Actual Data
int _storageDataType;
void *_maxDataValue;
void *_minDataValue;
void *_meanDataValue;
void *_rangeLimitTable;
int *_numberEqualOrExceedingRangeLimit;
void *_data;
} zStructSpatialGrid;
zspatialGridStore
Description: Store a GRID record
Declaration:
int zspatialGridStore(long long *ifltab, zStructSpatialGrid *gridStruct);
Parameters:
long long *ifltab
The file table of the opened DSS file (from zopen).
zStructSpatialGrid *gridStruct
A GRID struct that contains data for a single spatial GRID record. This struct is created by the zstructSpatialGridNew(const char* pathname); with pathname being a valid pathname. When you are finished with the struct, the struct must be freed by a call to zstructFree.
Returns:
STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.
Remarks:
Never reuse a zStructSpatialGrid, always free and create a new one.
zspatialGridRetrieveVersion
Description: Retrieve gridded struct version. A return of '0' indicates DSS 6 type grid.
Declaration:
int zspatialGridRetrieveVersion(long long *ifltab, const char *cpath,
int* gridStructVersion)
Parameters:
long long *ifltab
The file table of the opened DSS file (from zopen).
const char *cpath
The pathname
int* gridStructVersion (output)
Grid structure version for this pathname.
Returns:
int status
STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.
zspatialGridRetrieve
Description: Retrieve a GRID record
Declaration:
int zspatialGridRetrieve(long long *ifltab, zStructSpatialGrid *gridStruct, int boolRetrieveData);
Parameters:
long long *ifltab
The file table of the opened DSS file (from zopen).
zStructSpatialGrid *gridStruct
A GRID struct that contains data for a single spatial GRID record. This struct is created by the zstructSpatialGridNew(const char* pathname); with pathname being a valid pathname. When you are finished with the struct, the struct must be freed by a call to zstructFree.
int boolRetrieveData
A flag indicating if both data and meta-data (header info) should be retrieved:
0, Just retrieve meta-data.
1, Retrieve both meta-data and GRID arrays.
Returns:
STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.
Remarks:
Never reuse a zStructSpatialGrid, always free and create a new one.
zstructSpatialTinNew
Description: Creates a new spatial TIN struct
Declaration:
zStructSpatialTin* zstructSpatialTinNew(const char* pathname);
Parameters:
const char* pathname
The pathname for this struct. Must be a valid pathname. A copy of the pathname is used in struct.
Returns:
zStructSpatialTin*
An address to the struct created.
Note:
Always call function zstructFree(struct) when finished using.
See Also:
zspatialTinStore and zspatialTinRetrieve for more information
zStructSpatialTin
typedef struct {
// Private
int structType;
/* Required */
char *pathname;
// Geospatial metadata
char* SpatialReferenceSystem;
int SRSType; // enum type 0 = WKT;
char* SRSName;
char* SRSUnits;
// metadata for data values
char *units;
char *type;
char *timeZoneName; // Time zone of the data (may or may not match location time zone)
float minXCoordinate;
float maxXCoordinate;
float minYCoordinate;
float maxYCoordinate;
float minValue;
float meanValue;
float maxValue;
// Start and end times, required for TIN container, should be derived
// from the DSS path.
// TIN is made up of points and connections
int numberPoints; // Dimension of arrays
int connectTableLen; // Overall size of the connection array
int pointLabelLen; // Length of label array in bytes
float slendernessRatio; // weeds out splintered triangles
// These arrays have one value per point
float *xCoordinate;
float *yCoordinate;
float *value;
int *pointType; // enumerated type 0 = DCP; 1 = observer gage; 2 = grid cell center;
int *numberConnections;
int *connectTo; // A doubly dimensioned array
char *pointLabel;
// Private - knowing which variables were allocated by the ztsNew functions,
// instead of the calling program
char allocated[zSTRUCT_length];
} zStructSpatialTin;
zspatialTinStore
Description: Store a TIN record
Declaration:
int zspatialTinStore(long long *ifltab, zStructSpatialTin *tinStruct);
Parameters:
long long *ifltab
The file table of the opened DSS file (from zopen).
zStructSpatialTin *tinStruct
A TIN struct that contains data for a single spatial TIN record. This struct is created by the zstructSpatialTinNew (const char* pathname); with pathname being a valid pathname. When you are finished with the struct, the struct must be freed by a call to zstructFree.
Returns:
STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.
Remarks:
Never reuse a zStructSpatialTin, always free and create a new one.
zspatialTinRetrieve
Description: Retrieve a TIN record
Declaration:
int zspatialTinRetrieve(long long *ifltab, zStructSpatialTin *tinStruct,
int boolRetrieveData);
Parameters:
long long *ifltab
The file table of the opened DSS file (from zopen).
zStructSpatialTin *tinStruct
A TIN struct that will contain data for a single spatial TIN record. This struct is created by the zstructSpatialTinNew (const char* pathname); with pathname being a valid existing pathname. When you are finished with the struct, the struct must be freed by a call to zstructFree.
int boolRetrieveData
A flag indicating if both data and meta-data (header info) should be retrieved:
0, Just retrieve meta-data.
1, Retrieve both meta-data and TIN arrays.
Returns:
STATUS_OKAY
error code - value contains a description of the error and where it occurred. See zerrorDecode for descriptions.
Remarks:
Never reuse a zStructSpatialGrid, always free and create a new one.