HDF5 Extras
0.0.1
Convenience Functions for using HDF5 Better
|
These functions are on top of the HDF-5 library that the rest of the library is supposed to call. This way, the dependency on HDF-5 is limited to this one set of functions, and can be replaced, if needed, by rewriting them using a different file format library.
The four major categories of objects that are supported by HDF-5 are the following:
The HDF-5 standard basically allows one to create a filesystem-within-a-file. Datasets are basically files'', while Groups are
directories''. The concept of metadata is an extension to normal filesystems, and can be attached to Groups as well as Datasets.
We abstract the functions for creation, deletion, modification, etc. of each of these four objects.
These functions provide a way to determine the type of an object given its identifier, and to make various queries. Functions for HDF-5 objects are:
Functions for GeoSci objects are:
There are no Metadata identifiers, and so there are no query functions related to Metadata. However, we can create Datasets that hold Metadata, and these are specially identified so that they are not confused with other Datasets. The GS_CheckInternalName function is used to make sure we don't try to create an object using a name that is already in use.
We can also make objects be read-only by "locking" them, and we can also "unlock" them:
Some miscellaneous functions are:
Some functions to process pathnames, which deal with different naming conventions on different platforms automatically, are:
There are two kinds of functions in this set: one for creating standard HDF-5 Metadata, and the other for creating Datasets to hold Metadata.
These are some functions for dealing with the history metadata, which keeps track of what functions, with what arguments, have been applied to the data in a file:
While this function is used to update the descriptor for any object:
The following functions deal with coordinates that are used to keep track of the geographic bounding rectangle of an object:
The following functions deal with georeferencing of a raster dataset, such as an image. It provides two distinct ways to do this: either an affine transform, or a set of tie points. The affine transform is based on the following equations:
while the tie points provide the geographic coordinates given the x-y
coordinates for several points within the dataset. This metadata is named "Location", and these are the functions to deal with it:
For datasets that have coordinates given with respect to a particular Datum, and possibly also a map projection, the "Spatial Reference" metadata or "Spatialref" metadata is used. This is a string containing three different representations of the datum and map projection: first is the EPSG or IAU2000 code for the datum/map-projection combination, second is the WKT version, and third is the Proj.4 version.
Noite that the EPSG code is for data related to the Earth, while the IAU2000 code is used for data related to other planets or moons.
For files we have the following functions:
These functions deal with HDF-5 files that have been created by the hdf5-extras C library. Generic HDF-5 I/O functions for all other HDF-5 files, are described elsewhere. [YET]
For datasets we have the following functions:
And the related functions to deal with the datatype of a Dataset:
note: YET: all the GS_Datatype functions need to be renamed to be RasterType not Datatype.
For groups we have the following functions:
In the hdf5-extras C library we use groups to contain all the data related to a particular datatype, such as an image, or a set of vectors, and so generally we define these Groups to be our Objects. The GS_GroupGetType function returns this type.
Since most groups will contain geographic data of some kind, we also provide functions for such queries on any group:
Of course, if the group does not have geographic attributes, these functions say so.
Images are HDF-5 Groups with a variety of HDF-5 Attribute data associated with them, and several HDF-5 Datasets containing the image data, and other related data, as well as other metadata. These are the general functions for operating on Image objects:
(yet) Image pyramids are lower-resolution versions of the channels associated with an image. These HDF-5 Datasets are generally useful to make a GUI appear faster when a user is loading image data or roaming around an image.
(yet) Vector objects are sets of coordinates with respect to some Datum, and usually with some projection. These objects can be points, lines, polygons, and others, usually with the coordinates being 2D, such as Latitude and Longitude or Easting/Northing. The spatialite
spatial-relational database program has been made part of the GeoSci package, and so these sets of vectors are stored as a Vector object inside an IFile that represents a sqlite3
database file. This provides the full functionality of the spatial-relational database as well as a storage format.
Some routines needed to make all the vector functionality possible are:
next: HDF5 Internal Files