HDF5 Extras
0.0.1
Convenience Functions for using HDF5 Better
|
Go to the source code of this file.
Typedefs | |
typedef char complex | ci16_t |
typedef short int complex | ci32_t |
typedef int complex | ci64_t |
typedef float complex | c64_t |
typedef double complex | c128_t |
Functions | |
bstring | GS_H5ObjectTypeAsString (int objtype) |
GS_H5ObjectTypeAsString returns a printable version of HDF5 object type. More... | |
bstring | GS_GSObjectTypeAsString (int objtype) |
GS_GSObjectTypeAsString returns printable version of the object type. More... | |
int | GS_CheckFileExistence (const_bstring filename) |
GS_CheckFileExistence checks for the existence of a specified file. More... | |
void | GS_init () |
GS_init initialize some global strings. More... | |
int | GS_ValidID (hid_t id) |
GS_ValidID returns whether the given object-id is a valid identifier. More... | |
bstring | GS_GetIDName (hid_t id) |
GetIDName returns the name of the given handle. More... | |
int | GS_GetStringAttribute (hid_t object_id, const_bstring name, bstring value) |
GS_GetStringAttribute reads a string attribute from an object and returns its value. More... | |
int | GS_SetStringAttribute (hid_t object_id, const_bstring name, const_bstring value) |
GS_SetStringAttribute sets the value of a string attribute for a given object. More... | |
int | GS_ObjectIsFile (hid_t id) |
GS_ObjectIsFile determines if an object-id refers to a file. More... | |
int | GS_ObjectIsDataset (hid_t id, const_bstring name) |
GS_ObjectIsDataset determines if an object is a dataset. More... | |
int | GS_ObjectIsDatasetByID (hid_t id) |
GS_ObjectIsDatasetByID determines if an object-id refers to a dataset. More... | |
int | GS_ObjectIsGroup (hid_t id, const_bstring name) |
GS_ObjectIsGroup determines if a named object is a group. More... | |
int | GS_ObjectIsGroupByID (hid_t id) |
GS_ObjectIsGroupByID determines if an object-id refers to a group. More... | |
int | GS_CheckInternalName (hid_t object_id, const_bstring thename) |
GS_CheckInternalName checks for existence of an object name in the file. More... | |
hid_t | GS_CreateAccessPlist (void) |
GS_CreateAccessPlist creates an HDF5 access parameter list. More... | |
hid_t | GS_FileCreate (const_bstring filename) |
GS_FileCreate creates an empty GeoSci datafile. More... | |
int | GS_FileDelete (const_bstring filename) |
GS_FileDelete deletes an existing GeoSci datafile. More... | |
hid_t | GS_FileOpen (const_bstring dbname, const_bstring access) |
GS_FileOpen opens a GeoSci datafile. More... | |
int | GS_FileFlush (hid_t object_id) |
GS_FileFlush forces the datafile to be updated. More... | |
int | GS_FileClose (hid_t file_id) |
GS_FileClose closes a GeoSci datafile. More... | |
int | GS_FileCloseAllObjects (hid_t file_id) |
GS_FileCloseAllObjects closes all open objects in a file. More... | |
int | GS_FileIsWriteable (hid_t id) |
GS_FileIsWriteable returns if file is writeable or not. More... | |
int | GS_FileCopy (bstring oldname, bstring newname) |
GS_FileCopy copies a GeoSci datafile to a new file. More... | |
int | GS_FileIsOpen (const_bstring filename) |
GS_FileIsOpen determines if a GeoSci datafile is already open in the current process. More... | |
int | GS_FileRename (const_bstring oldname, const_bstring newname) |
GS_FileRename renames an existing GeoSci datafile. More... | |
int | GS_FileReport (const_bstring filename, bstring report_string) |
GS_FileReport summarizes the contents of a GeoSci datafile. More... | |
hid_t | GS_GetValidFileID (hid_t id) |
GS_GetValidFileID returns a valid FileID that contains the object. More... | |
bstring | GS_GetFilename (hid_t id) |
GetFilename returns the filename associated with an ID. More... | |
herr_t | GS_SetCacheSize (hid_t file_id, size_t cache_size) |
GS_SetCacheSize sets the metadata cache size for a GeoSci datafile. More... | |
int | GS_FileCommitDatatypes (hid_t file_id) |
GS_FileCommitDatatypes commits the complex raster datatypes to a file. More... | |
char * | GS_Dirname (const char *name) |
Dirname returns the directory name for a UNIX pathname. More... | |
hid_t | GS_DatasetCreate (hid_t source, const_bstring name, int datatype, int ndims, int *size, int is_extendable, int is_compressed) |
GS_DatasetCreate creates a dataset in a GeoSci datafile. More... | |
int | GS_DatasetDelete (hid_t file_id, const_bstring dataset_name) |
GS_DatasetDelete deletes a a dataset in a GeoSci datafile. More... | |
hid_t | GS_DatasetOpen (hid_t source, const_bstring name) |
GS_DatasetOpen opens a dataset in a GeoSci datafile. More... | |
hid_t | GS_DatasetClose (hid_t id) |
GS_DatasetClose closes a dataset in a GeoSci datafile. More... | |
int | GS_DatasetRename (hid_t group_id, const_bstring oldname, const_bstring newname) |
GS_DatasetRename renames a dataset in a GeoSci datafile. More... | |
hid_t | GS_DatasetGetParent (hid_t id) |
GS_DatasetGetParent returns the parent object-id for a Dataset. More... | |
int | GS_DatasetGetDatatype (hid_t id, const_bstring name) |
GS_DatasetGetDatatype returns the GeoSci datatype for data in the Dataset. More... | |
int | GS_DatasetGetDatatypeByID (hid_t id) |
GS_DatasetGetDatatypeByID returns the GeoSci datatype for the data in the Dataset. More... | |
int | GS_DatasetGetDimensionsByID (hid_t id, long int **size) |
GS_DatasetGetDimensionsByID returns the current dimensions for the Dataset. More... | |
int | GS_DatasetGetDimensions (hid_t id, const_bstring name, long int **size) |
GS_DatasetGetDimensions returns the current dimensions for the Dataset. More... | |
hid_t | GS_DatasetCopy (hid_t source, hid_t destination_group_id, const_bstring destination_dataset_name) |
GS_DatasetCopy copies a dataset to an existing Group: this can be in the same group, a different group, or a different file. More... | |
int | GS_DatasetRead (hid_t dataset_id, const long int *offsets, const long int *sizes, int datatype, void *buffer) |
GS_DatasetRead reads data from a dataset. More... | |
int | GS_DatasetWrite (hid_t dataset_id, const long int *offsets, const long int *sizes, int datatype, const void *buffer) |
GS_DatasetWrite writes data to a dataset. More... | |
int | GS_DataConversion (int in_type, const void *in_buffer, int out_type, void *out_buffer, int nelements) |
GS_DataConversion converts a data buffer between different types. More... | |
int | GS_RasterTypeNumbytes (int datatype) |
int | GS_ConvertFromHDFDatatype (hid_t datatype) |
GS_ConvertFromHDFDatatype returns the GeoSci datatype for the given HDF datatype. More... | |
hid_t | GS_ConvertToHDFDatatype (int datatype) |
GS_ConvertToHDFDatatype returns the HDF datatype for the given GeoSci datatype. More... | |
int | GS_HDFDatatypeClose (hid_t id) |
GS_HDFDatatypeClose closes an HDF datatype. More... | |
bstring | GS_PathnameNodir (const_bstring name) |
GS_PathnameNoDir strips the directory name from the pathname. More... | |
bstring | GS_PathnameGetDir (const_bstring name) |
GS_PathnameGetDir returns the directory name of the pathname. More... | |
bstring | GS_PathnameGetHDFDir (const_bstring name) |
GS_PathnameGetHDFDir returns the directory name of the pathname. More... | |
bstring | GS_PathnameJoin (const_bstring front, const_bstring back) |
GS_PathnameJoin joins 2 pieces of a pathname. More... | |
hid_t | GS_GroupCreate (hid_t file_id, const_bstring groupname) |
GS_GroupCreate creates a new group in a GeoSci Datafile. More... | |
hid_t | GS_GroupOpen (hid_t source, const_bstring name) |
GS_GroupOpen opens an existing group in a GeoSci datafile. More... | |
int | GS_GroupClose (hid_t id) |
GS_GroupClose closes a group in a GeoSci Datafile. More... | |
int | GS_GroupCloseAllObjects (hid_t id) |
GS_GroupCloseAllObjects closes all open objects in a group. More... | |
hid_t | GS_GroupCopy (hid_t source, hid_t destination_object_id, const_bstring destination_group_name) |
GS_GroupCopy copies a group to another location. More... | |
int | GS_GroupRename (hid_t id, const_bstring oldname, const_bstring newname) |
GS_GroupRename renames a group in a GeoSci datafile. More... | |
int | GS_GroupDelete (hid_t file_id, const_bstring group_name) |
GS_GroupDelete deletes a group in a GeoSci datafile. More... | |
int | GS_AppendMetadata (hid_t object_id, const_bstring metadata_name, const_bstring value) |
GS_AppendMetadata appends the given string to the metadata item. More... | |
int | GS_FileCreateMetadata (hid_t file_id, const_bstring descriptor) |
GS_FileCreateMetadata Creates metadata in a GeoSci datafile. More... | |
int | GS_ImageCreateMetadata (hid_t file_id, const_bstring image_name, const_bstring descriptor) |
GS_ImageCreateMetadata fills the standard image metadata attributes with the values that are passed in. More... | |
int | GS_VectorCreateMetadata (hid_t file_id, const_bstring vector_name, const_bstring descriptor) |
GS_VectorCreateMetadata creates vector metadata. More... | |
int | GS_RasterCreateMetadata (hid_t image_id, const_bstring raster_name, int raster_type, int npixels, int nlines, const_bstring descriptor) |
GS_RasterCreateMetadata fills the standard raster metadata attributes with the values that are passed in. More... | |
int | GS_ObjectIsIFileByID (hid_t dataset_id) |
GS_ObjectIsIFileByID determines if the objectID is an internal file. More... | |
int | GS_ObjectIsIFile (hid_t id, const_bstring name) |
GS_ObjectIsIFile determines if the object is an internal file. More... | |
int | GS_ObjectIsImageByID (hid_t id) |
GS_ObjectIsImageByID determines if the object is an image. More... | |
int | GS_ObjectIsImage (hid_t file_id, const_bstring image_name) |
GS_ObjectIsImage determines if the object is an image. More... | |
int | GS_ObjectIsMetadataDatasetByID (hid_t dataset_id) |
ObjectIsMetadataDatasetByID determines if the objectid is a metadata dataset. More... | |
int | GS_ObjectIsMetadataDataset (hid_t id, const_bstring name) |
ObjectIsMetadataDataset determines if the object is a metadata dataset. More... | |
int | GS_ObjectIsMetadataIFileByID (hid_t dataset_id) |
GS_ObjectIsMetadataIFileByID determines if the object-id refers to a metadata internal-file. More... | |
int | GS_ObjectIsMetadataIFile (hid_t id, const_bstring name) |
GS_ObjectIsMetadataIFile determines if the object refers to a metadata internal-file. More... | |
int | GS_ObjectIsRasterByID (hid_t dataset_id) |
GS_ObjectIsRasterByID determines if the object-id refers to a raster image. More... | |
int | GS_ObjectIsRaster (hid_t id, const_bstring name) |
GS_ObjectIsRaster determines if the object is a raster image. More... | |
int | GS_ObjectIsVectorByID (hid_t id) |
GS_ObjectIsVectorByID determines if the object-id refers to a vector. More... | |
int | GS_ObjectIsVector (hid_t id, const_bstring name) |
GS_ObjectIsVector determines if the object is a vector. More... | |
int | GS_ObjectLock (hid_t id) |
GS_ObjectLock makes an object read-only. More... | |
int | GS_ObjectUnlock (hid_t id) |
GS_ObjectUnlock changes and object to have read-write status. More... | |
int | GS_SplitHistory (const_bstring history_string, bstring front, bstring back) |
GS_SplitHistory splits history string into front and back. More... | |
int | GS_UpdateMetadata (hid_t object_id, const_bstring name, bstring value) |
GS_UpdateMetadata update a metadata item for the given object. More... | |
int | GS_ValidMetadataName (int object_type, const_bstring name) |
GS_ValidMetadataName check if the name is a valid metadata item for the given object type. More... | |
int | GS_DatatypeIsComplex (int datatype) |
GS_DatatypeIsComplex returns TRUE if a complex datatype. More... | |
bstring | GS_DatatypeAsString (int datatype) |
GS_DatatypeAsString return a string representing the datatype. More... | |
bstring | GS_DatasetReport (hid_t dataset_id) |
GS_DatasetReport returns a brief description of the dataset. More... | |
int | GS_DatasetIsWriteable (hid_t file_id, const_bstring dataset_name) |
GS_DatasetIsWriteable returns if dataset is writeable or not. More... | |
int | GS_DatasetIsWriteableByID (hid_t dataset_id) |
GS_DatasetIsWriteableByID returns if dataset is writeable or not. More... | |
int | GS_GroupIsWriteable (hid_t file_id, const_bstring group_name) |
GS_GroupIsWriteable returns if the group is writeable or not. More... | |
int | GS_GroupIsWriteableByID (hid_t group_id) |
GS_GroupIsWriteableByID returns if the group is writeable or not. More... | |
bstring | GS_GroupReport (hid_t group_id) |
GS_GroupReport returns a one-line brief description of the group. More... | |
int | GS_GroupGetType (hid_t group_id) |
GS_GroupGetType returns the type of a group in a GeoSci datafile. More... | |
int | GS_GroupSetType (hid_t group_id, int typecode) |
GS_GroupSetType sets the type of a group in a GeoSci datafile. More... | |
bstring | GS_GroupGetDatum (hid_t group_id) |
GS_GroupGetDatum returns a description of the relevant datum if one exists. More... | |
bstring | GS_GroupGetProjection (hid_t group_id) |
GS_GroupGetProjection returns a description of the relevant projection. More... | |
int | GS_GroupGetBounds (hid_t group_id, double *xmin, double *xmax, double *ymin, double *ymax) |
GS_GroupGetBounds returns the rectangular bounding coordinates. More... | |
bstring | GS_DatasetGetDatum (hid_t dataset_id) |
GS_DatasetGetDatum returns a description of the relevant datum if one exists. More... | |
bstring | GS_DatasetGetProjection (hid_t dataset_id) |
GS_DatasetGetProjection returns a description of the relevant projection. More... | |
int | GS_DatasetGetBounds (hid_t dataset_id, double *xmin, double *xmax, double *ymin, double *ymax) |
GS_DatasetGetBounds returns the rectangular bounding coordinates. More... | |
int | GS_ObjectGetH5Children (hid_t object_id, int *nobjs, bstring **objnames, int **objtypes) |
GS_ObjectGetH5Children returns list of all children objects. More... | |
int | GS_ObjectGetGSChildren (hid_t object_id, int *nobjs, bstring **objnames, int **objtypes) |
GS_ObjectGetGSChildren returns list of GeoSci children objects. More... | |
int | GS_DatasetGetType (hid_t dataset_id) |
GS_DatasetGetType returns the type of a GeoSci Dataset. More... | |
int | GS_DatasetSetType (hid_t dataset_id, int typecode) |
GS_DatasetSetType set the type of a dataset in a GeoSci file. More... | |
hid_t | GS_ImageCreate (hid_t file_id, const_bstring image_name, const_bstring image_descriptor) |
GS_ImageCreate creates a new image in a GeoSci file and opens it. More... | |
int | GS_ImageClose (hid_t image_id) |
GS_ImageClose closes an Open Image}. More... | |
hid_t | GS_ImageOpen (hid_t file_id, const_bstring image_name) |
GS_ImageOpen opens an existing image. More... | |
int | GS_ImageDelete (hid_t file_id, const_bstring image_name) |
GS_ImageDelete deletes an existing image. More... | |
int | GS_AppendHistory (hid_t object_id, const_bstring history_line) |
GS_AppendHistory appends to the history metadata. More... | |
int | GS_AbortedHistory (hid_t object_id, const_bstring history_line) |
GS_AbortedHistory writes aborted message to history metadata. More... | |
hid_t | GS_RasterCreate (hid_t image_id, const_bstring raster_name, int raster_type, int npixels, int nlines, const_bstring descriptor) |
GS_RasterCreate create new image raster for a GeoSci Image. More... | |
hid_t | GS_RasterOpen (hid_t image_id, const_bstring raster_name) |
GS_RasterOpen opens existing raster dataset. More... | |
int | GS_RasterClose (hid_t raster_id) |
GS_RasterClose closes an open raster dataset. More... | |
int | GS_RasterDelete (hid_t image_id, const_bstring raster_name) |
GS_RasterDelete deletes an existing raster. More... | |
bstring | GS_GetRasterTypeAsString (int datatype) |
GS_GetRasterTypeAsString returns a string representing the datatype. More... | |
int | GS_RasterPixelSize (hid_t raster_id, int func, double *x_pixelsize, double *y_pixelsize, bstring pixel_units) |
GS_RasterPixelSize reads/writes Raster Pixel Size. More... | |
int | GS_RasterSizeInfo (hid_t raster_id, int *npixels, int *nlines) |
GS_RasterSizeInfo returns the number of pixels and lines in a raster. More... | |
int | GS_RasterCheckWindow (hid_t file_id, const_bstring image_name, int *window) |
GS_RasterCheckWindow checks whether a requested window selection is within the bounds of an image. It will also default a window specification to be the whole image if XSize and/or YSize are zero. More... | |
int | GS_RasterCheckWindowByID (hid_t image_id, int *window) |
GS_RasterCheckWindowByID checks whether a requested window selection is within the bounds of a raster. It will also default a window specification to be the whole raster if XSize and/or YSize are zero. More... | |
int | GS_CheckWindowInside (int *window_in, const int *window_enclosing) |
CheckWindowInside checks if one Window is contained by another. More... | |
int | GS_RasterTypeIsInteger (int datatype) |
GS_RasterTypeIsInteger returns TRUE for integer types. More... | |
int | GS_RasterTypeIsComplex (int datatype) |
GS_RasterTypeIsComplex returns TRUE for complex types. More... | |
int | GS_CheckUniqueName (hid_t file_id, const char *thename) |
GS_CheckUniqueName check if name is unique. More... | |
int GS_AbortedHistory | ( | hid_t | object_id, |
const_bstring | history_line | ||
) |
GS_AbortedHistory writes aborted message to history metadata.
AbortedHistory() writes an "Aborted" message to the history metadata, and updates the last_update_datetime metadata item. This works for any object with a "history" metadata item, and a "last_update_datetime" metadata item.
[in] | object_id | ID of a file, an image, or any other valid object in a GeoSci file. |
[in] | history_line | This string is appended to the history metadata item for the given object, along with " ***ABORTED*** " |
TRUE
on success, FALSE
otherwise. int GS_AppendHistory | ( | hid_t | object_id, |
const_bstring | history_line | ||
) |
GS_AppendHistory appends to the history metadata.
AppendHistory() appends the given string to the history metadata item, and updates the last_update_datetime metadata item. This works for any object with a "history" metadata item, and a "last_update_datetime" metadata item.
[in] | object_id | ID of a file, an image, or any other valid object in a GeoSci file. |
int GS_AppendMetadata | ( | hid_t | object_id, |
const_bstring | metadata_name, | ||
const_bstring | value | ||
) |
GS_AppendMetadata appends the given string to the metadata item.
[in] | object_id | ID of a file, and image, or any other valid object in a GeoSci file. |
[in] | metadata_name | The name of the metadata item to update. |
[in] | value | This string is appended to the metadata item for the given object. |
TRUE
on success, FALSE
on failure.int GS_CheckFileExistence | ( | const_bstring | filename | ) |
GS_CheckFileExistence checks for the existence of a specified file.
[in] | filename | Name of file to check for. |
TRUE
if the file exists, or FALSE
if it does not exist (or is not accessable).int GS_CheckInternalName | ( | hid_t | object_id, |
const_bstring | thename | ||
) |
GS_CheckInternalName checks for existence of an object name in the file.
[in] | object_id | Handle of an already-open GeoSci object. |
[in] | name | Name of the object one wishes to test. Must be a relative pathname, relative to the object in "object_id". If object_id is a file, then this can be an absolute name. For example: /groupa/group1/datasetw. |
TRUE
if the name exists, FALSE
if not.int GS_CheckUniqueName | ( | hid_t | object_id, |
const char * | thename | ||
) |
GS_CheckUniqueName check if name is unique.
[in] |
int GS_CheckWindowInside | ( | int * | window_in, |
const int * | window_enclosing | ||
) |
CheckWindowInside checks if one Window is contained by another.
[in] | window | Vector containing desired window specification. window[0] = Xoffset window[1] = Yoffset window[2] = Xsize window[3] = Ysize If window[2] is 0, window[2] will be set to image X size - window[0]. If window[3] is 0, window[3] will be set to image Y size - window[1]. |
[in] | window_enclosing | Vector containing enclosing window specification. |
int GS_ConvertFromHDFDatatype | ( | hid_t | datatype | ) |
GS_ConvertFromHDFDatatype returns the GeoSci datatype for the given HDF datatype.
[in] | datatype | A handle to an HDF5 datatype. |
GS_DATATYPE_UI1
(Unsigned Integer, 1-bit)GS_DATATYPE_UI8
(Unsigned Integer, 8-bit)GS_DATATYPE_SI8
(Signed Integer, 8-bit)GS_DATATYPE_CI8
(Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16
(Unsigned Integer, 16-bit)GS_DATATYPE_SI16
(Signed Integer, 16-bit)GS_DATATYPE_CI16
(Complex Integer, 16-bit)GS_DATATYPE_UI32
(Unsigned Integer, 32-bit)GS_DATATYPE_SI32
(Signed Integer, 32-bit)GS_DATATYPE_CI32
(Complex Integer, 32-bit)GS_DATATYPE_CI64
(Complex Integer, 64-bit)GS_DATATYPE_R32
(Real, 32-bit)GS_DATATYPE_R64
(Real, 64-bit)GS_DATATYPE_C64
(Complex, 64-bit)GS_DATATYPE_C128
(Complex, 128-bit)GS_DATATYPE_UI64
(Unsigned Integer, 64-bit)GS_DATATYPE_SI64
(Signed Integer, 64-bit)hid_t GS_ConvertToHDFDatatype | ( | int | datatype | ) |
GS_ConvertToHDFDatatype returns the HDF datatype for the given GeoSci datatype.
[in] | datatype | An integer representing a GeoSci datatype. Valid datatypes are:GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
hid_t GS_CreateAccessPlist | ( | void | ) |
GS_CreateAccessPlist creates an HDF5 access parameter list.
The list that GS_CreateAccessPlist() returns is for use when creating or opening an HDF5 file. It sets raw data chunk cache parameters, as well as a driver for file I/O.
int GS_DataConversion | ( | int | in_type, |
const void * | in_buffer, | ||
int | out_type, | ||
void * | out_buffer, | ||
int | nelements | ||
) |
GS_DataConversion converts a data buffer between different types.
[in] | in_type | The type of data in in_buffer . The valid datatypes are: GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
[in] | in_buffer | The data we want to convert to a different type. |
[in] | out_type | The type of data we want in out_buffer . Same valid datatypes as in in_type . |
[in] | out_buffer | The destination of the converted data from in_buffer . |
[in] | nelements | The number of elements to convert. |
TRUE
on sucess, FALSE
on failure.hid_t GS_DatasetClose | ( | hid_t | id | ) |
GS_DatasetClose closes a dataset in a GeoSci datafile.
[in] | id | A handle for the dataset. Perhaps from GS_DatasetOpen(). |
TRUE
on sucess, FALSE
on failure.hid_t GS_DatasetCopy | ( | hid_t | source, |
hid_t | destination_group_id, | ||
const_bstring | destination_dataset_name | ||
) |
GS_DatasetCopy copies a dataset to an existing Group: this can be in the same group, a different group, or a different file.
[in] | source | A handle for a dataset. |
[in] | destination_group_id | The handle of the destination group. |
[in] | destination_dataset_name | The name of the new dataset to create. |
hid_t GS_DatasetCreate | ( | hid_t | source, |
const_bstring | name, | ||
int | datatype, | ||
int | ndims, | ||
int * | size, | ||
int | is_extendable, | ||
int | is_compressed | ||
) |
GS_DatasetCreate creates a dataset in a GeoSci datafile.
[in] | source | A handle for the file or other container within which to create the dataset. |
[in] | name | The name of the dataset to create. |
[in] | datatype | The datatype of the numbers to store. Must be one of:GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
[in] | ndims | The number of dimensions for the dataset. |
[in] | size | The (initial) size for each dimension |
[in] | is_extendable | Set to TRUE to make the dataset size extendable, set to FALSE to make the dataset size fixed. |
[in] | is_compressed | Set to TRUE to make the dataset compressed, set to FALSE to make the dataset uncompressed. |
int GS_DatasetDelete | ( | hid_t | file_id, |
const_bstring | dataset_name | ||
) |
GS_DatasetDelete deletes a a dataset in a GeoSci datafile.
[in] | id | A handle for the file. |
[in] | dataset_name | The name of the dataset in the file. Should start with a "/". |
TRUE
on sucess, FALSE
on failure.int GS_DatasetGetBounds | ( | hid_t | dataset_id, |
double * | xmin, | ||
double * | xmax, | ||
double * | ymin, | ||
double * | ymax | ||
) |
GS_DatasetGetBounds returns the rectangular bounding coordinates.
[in] | dataset_id | A handle for a dataset. |
[out] | xmin | |
[out] | xmax | |
[out] | ymin | |
[out] | ymax | The coordinates are returned with units that are consistent with the projection that is used. Typically the units are decimal degrees or meters. |
TRUE
on success, FALSE
if there are any errors.FALSE
is returned. Otherwise, the correct numbers are filled in, and TRUE
is returned. int GS_DatasetGetDatatype | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_DatasetGetDatatype returns the GeoSci datatype for data in the Dataset.
[in] | id | File handle of selected GeoSci file, or object handle of the container for the Dataset. |
[in] | object_name | Name of object to query. |
GS_DATATYPE_UI1
(Unsigned Integer, 1-bit)GS_DATATYPE_UI8
(Unsigned Integer, 8-bit)GS_DATATYPE_SI8
(Signed Integer, 8-bit)GS_DATATYPE_CI8
(Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16
(Unsigned Integer, 16-bit)GS_DATATYPE_SI16
(Signed Integer, 16-bit)GS_DATATYPE_CI16
(Complex Integer, 16-bit)GS_DATATYPE_UI32
(Unsigned Integer, 32-bit)GS_DATATYPE_SI32
(Signed Integer, 32-bit)GS_DATATYPE_CI32
(Complex Integer, 32-bit)GS_DATATYPE_CI64
(Complex Integer, 64-bit)GS_DATATYPE_R32
(Real, 32-bit)GS_DATATYPE_R64
(Real, 64-bit)GS_DATATYPE_C64
(Complex, 64-bit)GS_DATATYPE_C128
(Complex, 128-bit)GS_DATATYPE_UI64
(Unsigned Integer, 64-bit)GS_DATATYPE_SI64
(Signed Integer, 64-bit)int GS_DatasetGetDatatypeByID | ( | hid_t | id | ) |
GS_DatasetGetDatatypeByID returns the GeoSci datatype for the data in the Dataset.
[in] | id | Datset handle |
GS_DATATYPE_UI1
(Unsigned Integer, 1-bit)GS_DATATYPE_UI8
(Unsigned Integer, 8-bit)GS_DATATYPE_SI8
(Signed Integer, 8-bit)GS_DATATYPE_CI8
(Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16
(Unsigned Integer, 16-bit)GS_DATATYPE_SI16
(Signed Integer, 16-bit)GS_DATATYPE_CI16
(Complex Integer, 16-bit)GS_DATATYPE_UI32
(Unsigned Integer, 32-bit)GS_DATATYPE_SI32
(Signed Integer, 32-bit)GS_DATATYPE_CI32
(Complex Integer, 32-bit)GS_DATATYPE_CI64
(Complex Integer, 64-bit)GS_DATATYPE_R32
(Real, 32-bit)GS_DATATYPE_R64
(Real, 64-bit)GS_DATATYPE_C64
(Complex, 64-bit)GS_DATATYPE_C128
(Complex, 128-bit)GS_DATATYPE_UI64
(Unsigned Integer, 64-bit)GS_DATATYPE_SI64
(Signed Integer, 64-bit)bstring GS_DatasetGetDatum | ( | hid_t | dataset_id | ) |
GS_DatasetGetDatum returns a description of the relevant datum if one exists.
[in] | dataset_id | A handle for a dataset. |
int GS_DatasetGetDimensions | ( | hid_t | id, |
const_bstring | name, | ||
long int ** | size | ||
) |
GS_DatasetGetDimensions returns the current dimensions for the Dataset.
[in] | id | File handle of selected GeoSci file, or object handle of the container for the Dataset. |
[in] | name | Name of object to query. |
[out] | size | A vector of long integers: the size of each dimension: the number of data-objects per dimension. |
size
. This vector is allocated by this function, and should be GFree()'d when done with it.int GS_DatasetGetDimensionsByID | ( | hid_t | id, |
long int ** | size | ||
) |
GS_DatasetGetDimensionsByID returns the current dimensions for the Dataset.
[in] | id | object handle of the Dataset. |
[out] | size | A vector of long integers: the size of each dimension: the number of data-objects per dimension. |
size
. This vector is allocated by this function, and should be GFree()'d when done with it.hid_t GS_DatasetGetParent | ( | hid_t | id | ) |
GS_DatasetGetParent returns the parent object-id for a Dataset.
[in] | id | The handle of the Dataset. |
bstring GS_DatasetGetProjection | ( | hid_t | dataset_id | ) |
GS_DatasetGetProjection returns a description of the relevant projection.
[in] | dataset_id | A handle for a dataset. |
int GS_DatasetGetType | ( | hid_t | dataset_id | ) |
GS_DatasetGetType returns the type of a GeoSci Dataset.
[in] | dataset_id | A handle for the dataset. |
GS_OBJECT_TYPE_IFILE
(10)GS_OBJECT_TYPE_RASTER
(9)GS_OBJECT_TYPE_METADATA_DATASET
(12)GS_OBJECT_TYPE_METADATA_IFILE
(13)GS_OBJECT_TYPE_UNKNOWN
(0)int GS_DatasetIsWriteable | ( | hid_t | file_id, |
const_bstring | dataset_name | ||
) |
GS_DatasetIsWriteable returns if dataset is writeable or not.
[in] | id | A handle for the file. |
[in] | dataset_name | The name of the dataset in the file. Should start with a "/". |
TRUE
if the dataset is writeable, FALSE
otherwise.int GS_DatasetIsWriteableByID | ( | hid_t | id | ) |
GS_DatasetIsWriteableByID returns if dataset is writeable or not.
[in] | id | A handle for the dataset. |
TRUE
if the dataset is writeable, FALSE
otherwise.hid_t GS_DatasetOpen | ( | hid_t | source, |
const_bstring | name | ||
) |
GS_DatasetOpen opens a dataset in a GeoSci datafile.
[in] | source | A handle for a file or other container that has a dataset in it. |
[in] | name | The name of the dataset to open. |
int GS_DatasetRead | ( | hid_t | dataset_id, |
const long int * | offsets, | ||
const long int * | sizes, | ||
int | datatype, | ||
void * | buffer | ||
) |
GS_DatasetRead reads data from a dataset.
[in] | id | A handle for the dataset. Perhaps from GS_DatasetOpen(). |
[in] | offsets | Must supply an offset to the first data element to read for each dimension. Zero offset is used for reading starting with the first data-element. |
[in] | sizes | Must supply how many data elements to read for each dimension. Zero offset is used for reading starting with the first data-element. Using the offset and size for each dimension allows the specification of rectangular windows in n-dimensional space. For example, in 2-dimensions the window is: xoffset = offset[0], yoffset= offset[1] xsize = sizes[0], ysize = sizes[1] |
[in] | datatype | The datatype of the buffer. All the data that is read is converted to this datatype, and then returned to the caller in buffer . See the Details section for how this conversion is done. The valid datatypes are:GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
[out] | buffer | This is a pointer to enough memory to hold the data that is being read. |
TRUE
on sucess, FALSE
on failure.int GS_DatasetRename | ( | hid_t | group_id, |
const_bstring | oldname, | ||
const_bstring | newname | ||
) |
GS_DatasetRename renames a dataset in a GeoSci datafile.
[in] | group_id | A handle for the container of the dataset. This should be a group. |
[in] | oldname | Current name of dataset to rename. |
[in] | newname | Desired new name of the dataset. |
TRUE
on sucess, FALSE
on failure.bstring GS_DatasetReport | ( | hid_t | dataset_id | ) |
GS_DatasetReport returns a brief description of the dataset.
[in] | dataset_id | A handle for a dataset. |
int GS_DatasetSetType | ( | hid_t | dataset_id, |
int | typecode | ||
) |
GS_DatasetSetType set the type of a dataset in a GeoSci file.
[in] | dataset_id | A handle for the dataset. |
[in] | typecode | An integer type code specifying the type of dataset. One of: GS_OBJECT_TYPE_IFILE 10 GS_OBJECT_TYPE_RASTER 9 GS_OBJECT_TYPE_METADATA_DATASET 12 GS_OBJECT_TYPE_METADATA_IFILE 13 |
int GS_DatasetWrite | ( | hid_t | dataset_id, |
const long int * | offsets, | ||
const long int * | sizes, | ||
int | datatype, | ||
const void * | buffer | ||
) |
GS_DatasetWrite writes data to a dataset.
[in] | id | A handle for the dataset. Perhaps from GS_DatasetOpen(). |
[in] | offsets | Must supply an offset to the first data element to write for each dimension. Zero offset is used for writing starting with the first data-element. |
[in] | sizes | Must supply how many data elements to write for each dimension. Zero offset is used for writing starting with the first data-element. Using the offset and size for each dimension allows the specification of rectangular windows in n-dimensional space. For example, in 2-dimensions the window is: xoffset = offset[0], yoffset= offset[1] xsize = sizes[0], ysize = sizes[1] |
[in] | datatype | The datatype of the buffer. All the data that is written is converted from this datatype, to the datatype used by the Dataset. See the Details section for how this conversion is done. The valid datatypes are:GS_DATATYPE_UI1 (Unsigned Integer, 1-bit)GS_DATATYPE_UI8 (Unsigned Integer, 8-bit)GS_DATATYPE_SI8 (Signed Integer, 8-bit)GS_DATATYPE_CI8 (Complex Integer, 8-bit (not supported))GS_DATATYPE_UI16 (Unsigned Integer, 16-bit)GS_DATATYPE_SI16 (Signed Integer, 16-bit)GS_DATATYPE_CI16 (Complex Integer, 16-bit)GS_DATATYPE_UI32 (Unsigned Integer, 32-bit)GS_DATATYPE_SI32 (Signed Integer, 32-bit)GS_DATATYPE_CI32 (Complex Integer, 32-bit)GS_DATATYPE_CI64 (Complex Integer, 64-bit)GS_DATATYPE_R32 (Real, 32-bit)GS_DATATYPE_R64 (Real, 64-bit)GS_DATATYPE_C64 (Complex, 64-bit)GS_DATATYPE_C128 (Complex, 128-bit)GS_DATATYPE_UI64 (Unsigned Integer, 64-bit)GS_DATATYPE_SI64 (Signed Integer, 64-bit) |
[out] | buffer | This is a pointer to enough memory to hold the data that is being written. |
TRUE
on sucess, FALSE
on failure.bstring GS_DatatypeAsString | ( | int | datatype | ) |
GS_DatatypeAsString return a string representing the datatype.
[in] | datatype | An integer representing a GeoSci datatype. Valid datatypes:GS_DATATYPE_UI1 1 A single bit GS_DATATYPE_UI8 2 Unsigned 8-bit integer GS_DATATYPE_SI8 3 Signed 8-bit integer GS_DATATYPE_CI8 4 Complex 8-bit integer GS_DATATYPE_UI16 5 Unsigned 16-bit integer GS_DATATYPE_SI16 6 Signed 16-bit integer GS_DATATYPE_CI16 7 Complex 16-bit integer GS_DATATYPE_UI32 8 Unsigned 32-bit integer GS_DATATYPE_SI32 9 Signed 32-bit integer GS_DATATYPE_CI32 10 Complex 32-bit integer GS_DATATYPE_CI64 11 Complex 64-bit integer GS_DATATYPE_R32 12 32-bit Real number GS_DATATYPE_R64 13 64-bit Real number GS_DATATYPE_C64 14 Complex 64-bit floating-point number GS_DATATYPE_C128 15 Complex 128-bit floating point GS_DATATYPE_UI64 16 Unsigned 64-bit integer GS_DATATYPE_SI64 17 Signed 64-bit integer |
int GS_DatatypeIsComplex | ( | int | datatype | ) |
GS_DatatypeIsComplex returns TRUE if a complex datatype.
[in] | datatype | An integer representing a GeoSci datatype. Valid datatypes:GS_DATATYPE_UI1 1 A single bit GS_DATATYPE_UI8 2 Unsigned 8-bit integer GS_DATATYPE_SI8 3 Signed 8-bit integer GS_DATATYPE_CI8 4 Complex 8-bit integer GS_DATATYPE_UI16 5 Unsigned 16-bit integer GS_DATATYPE_SI16 6 Signed 16-bit integer GS_DATATYPE_CI16 7 Complex 16-bit integer GS_DATATYPE_UI32 8 Unsigned 32-bit integer GS_DATATYPE_SI32 9 Signed 32-bit integer GS_DATATYPE_CI32 10 Complex 32-bit integer GS_DATATYPE_CI64 11 Complex 64-bit integer GS_DATATYPE_R32 12 32-bit Real number GS_DATATYPE_R64 13 64-bit Real number GS_DATATYPE_C64 14 Complex 64-bit floating-point number GS_DATATYPE_C128 15 Complex 128-bit floating point GS_DATATYPE_UI64 16 Unsigned 64-bit integer GS_DATATYPE_SI64 17 Signed 64-bit integer |
TRUE
is returned for complex datatypes, FALSE
for others, and ERROR
otherwise.char* GS_Dirname | ( | const char * | name | ) |
Dirname returns the directory name for a UNIX pathname.
[in] | name | The name of an object in an existing GeoSci file. Use Unix filenaming conventions, giving the full pathname, starting with "/". |
int GS_FileClose | ( | hid_t | file_id | ) |
GS_FileClose closes a GeoSci datafile.
[in] | file_id | File handle for GeoSci file to be closed. |
TRUE
is returned on success, while FALSE
is returned on failure.int GS_FileCloseAllObjects | ( | hid_t | id | ) |
GS_FileCloseAllObjects closes all open objects in a file.
[in] | id | The handle of the open file, or any object in the file. |
TRUE
is returned on success, FALSE
otherwise.int GS_FileCommitDatatypes | ( | hid_t | file_id | ) |
GS_FileCommitDatatypes commits the complex raster datatypes to a file.
[in] | file_id | The file ID |
GS_FileCopy copies a GeoSci datafile to a new file.
[in] | oldname | Name of existing file to copy. |
[in] | newname | Name of new file to create and copy into. |
TRUE
is returned on success, FALSE
on failure.hid_t GS_FileCreate | ( | const_bstring | filename | ) |
GS_FileCreate creates an empty GeoSci datafile.
The basic file metadata is created, but nothing else. GS_FileCreate() assumes the file does NOT exist before creating it, and will return an error if a file with the same name already exists.
[in] | filename | Name of file to be created. If there is no ".hd5" extension, this routine will create a file with the ".hdf5" extension. |
int GS_FileCreateMetadata | ( | hid_t | file_id, |
const_bstring | descriptor | ||
) |
GS_FileCreateMetadata Creates metadata in a GeoSci datafile.
GS_FileCreateMetadata() creates a new metadata group to store per-file metadata in, it then fills them in with default values, and the file descriptor string that is passed in.
[in] | file_id | The file ID |
[in] | descriptor | A character string describing the file contents. |
The file metadata is stored in a group named "/_Header". The file metadata items are: grouptype
(= "Metadata"
), filetype
(= "GEOSCI"
), software_version
(= "V0.0.1"
), creation_datetime
, last_update_datetime
, history
, and descriptor
, the last one being set by a call to this function.
Note that until the file metadata is set up correctly the file is not recognized as a valid GeoSci file, and so most functions in this library will not operate on it successfully. Because of this, the file creation function, GS_FileCreate, calls this function as part of the file creation process.
int GS_FileDelete | ( | const_bstring | filename | ) |
GS_FileDelete deletes an existing GeoSci datafile.
[in] | filename | Name of existing file to delete. |
TRUE
is returned on success, FALSE
on failure.int GS_FileFlush | ( | hid_t | object_id | ) |
GS_FileFlush forces the datafile to be updated.
GS_FileFlush() forces all changes to a file to be flushed to the hard drive, forcing them to occur rather than waiting in a "buffered" state.
[in] | object_id | ID of a file, an image, or any other valid object in a GeoSci datafile. |
TRUE
on success, FALSE
otherwise.int GS_FileIsOpen | ( | const_bstring | filename | ) |
GS_FileIsOpen determines if a GeoSci datafile is already open in the current process.
[in] | filename | Name of existing file to query. |
TRUE
is returned if the file is open, FALSE
otherwise.int GS_FileIsWriteable | ( | hid_t | id | ) |
GS_FileIsWriteable returns if file is writeable or not.
[in] | id | The handle of the file, or any object in the file. |
TRUE
if the file associated with the given handle is writeable, or FALSE
if not. Returns ERROR
(-1) if cannot determine the status.writeable
metadata is TRUE
, which can be changed via a call to GS_ObjectLock, and GS_objectUnlock. hid_t GS_FileOpen | ( | const_bstring | dbname, |
const_bstring | access | ||
) |
GS_FileOpen opens a GeoSci datafile.
[in] | dbname | The name of the GeoSci datafile to be opened. |
[in] | access | Read/Write flag: "r" : Open file for Read only "r+": Open file for Read/Write |
hid_t
file handle for the file opened. If the GeoSci file does not exist, a negative file handle is returned, and the global error_string
is set.int GS_FileRename | ( | const_bstring | oldname, |
const_bstring | newname | ||
) |
GS_FileRename renames an existing GeoSci datafile.
[in] | oldname | Name of existing file to rename. |
[in] | newname | New name to be assigned to file 'oldname'. |
TRUE
is returned on success, FALSE
on failure.int GS_FileReport | ( | const_bstring | filename, |
bstring | report_string | ||
) |
GS_FileReport summarizes the contents of a GeoSci datafile.
[in] | filename | Name of datafile to be queried. |
[in] | report_string | The returned report, as a multi-line string. On entry, must be a valid bstring. |
TRUE
on success, FALSE
on failure. The report_string
contains a multi-line string with contents like the following:bstring GS_GetFilename | ( | hid_t | id | ) |
GetFilename returns the filename associated with an ID.
[in] | id | The handle of the file, or any object in the file. |
bstring GS_GetIDName | ( | hid_t | id | ) |
GetIDName returns the name of the given handle.
[in] | id | The handle of the file, or any object in the file. |
bstring GS_GetRasterTypeAsString | ( | int | datatype | ) |
GS_GetRasterTypeAsString returns a string representing the datatype.
[in] | datatype | An integer representing a GeoSci raster datatype. Valid datatypes:GS_DATATYPE_UI1 1 A single bitGS_DATATYPE_UI8 2 Unsigned 8-bit integerGS_DATATYPE_SI8 3 Signed 8-bit integerGS_DATATYPE_CI8 4 Complex 8-bit integerGS_DATATYPE_UI16 5 Unsigned 16-bit integerGS_DATATYPE_SI16 6 Signed 16-bit integerGS_DATATYPE_CI16 7 Complex 16-bit integerGS_DATATYPE_UI32 8 Unsigned 32-bit integerGS_DATATYPE_SI32 9 Signed 32-bit integerGS_DATATYPE_CI32 10 Complex 32-bit integerGS_DATATYPE_CI64 11 Complex 64-bit integerGS_DATATYPE_R32 12 32-bit Real numberGS_DATATYPE_R64 13 64-bit Real numberGS_DATATYPE_C64 14 Complex 64-bit floating-point numberGS_DATATYPE_C128 15 Complex 128-bit floating point GS_DATATYPE_UI64 16 Unsigned 64-bit integerGS_DATATYPE_SI64 17 Signed 64-bit integer |
int GS_GetStringAttribute | ( | hid_t | object_id, |
const_bstring | name, | ||
bstring | value | ||
) |
GS_GetStringAttribute reads a string attribute from an object and returns its value.
[in] | object_id | The opened object where the attribute is stored. |
[in] | name | The name of the attribute variable. |
[in] | value | The returned value of the variable. On input, this must be a valid bstring. |
hid_t GS_GetValidFileID | ( | hid_t | id | ) |
GS_GetValidFileID returns a valid FileID that contains the object.
[in] | id | An id for an object in a GeoSci file. |
This function either returns an id
that is the same as the passed-in id
, but with an incremented reference-count, or it returns a different id
, also with an incremented reference-count. The user should always GS_FileClose() this id
when done with it. The associated file will only be closed when the reference count reaches zero.
A typical usage of this is to make sure a passed-in id
is a file_id
. In such a case, this will increment the reference count by 1, and the user should then GS_FileClose() it when done, which will NOT close the file that the passed-in file_id
refers to.
In another scenario, where the code needs to return a newly-opened object in the passed-in file_id
, one needs to be more careful. Do not use this routine. Instead call GS_ObjectIsFile(id) to make sure the id
refers to a file, and return an error if it doesn't.
int GS_GroupClose | ( | hid_t | id | ) |
GS_GroupClose closes a group in a GeoSci Datafile.
[in] | id | The handle for the already-open group. |
TRUE
is returned if the group is succesfully closed, FALSE
otherwise.int GS_GroupCloseAllObjects | ( | hid_t | id | ) |
GS_GroupCloseAllObjects closes all open objects in a group.
[in] | id | The handle of the open group. |
TRUE
is returned on success, FALSE
otherwise.hid_t GS_GroupCopy | ( | hid_t | source, |
hid_t | destination_object_id, | ||
const_bstring | destination_group_name | ||
) |
GS_GroupCopy copies a group to another location.
[in] | source | A handle for a group. |
[in] | destination_object_id | The handle of the destination group or file. |
[in] | destination_group_name | The name of the new dataset to create. |
hid_t GS_GroupCreate | ( | hid_t | file_id, |
const_bstring | groupname | ||
) |
GS_GroupCreate creates a new group in a GeoSci Datafile.
[in] | file_id | A handle for an already-open GeoSci datafile. |
[in] | groupname | The name of the group in an existing GeoSci datafile to be created. Use Unix/Web filenaming conventions, giving the full pathname, starting with "/". All but the last component of this name must already exist. |
A valid handle to the new group is returned on success. A negative value is returned on failure.
int GS_GroupDelete | ( | hid_t | file_id, |
const_bstring | group_name | ||
) |
GS_GroupDelete deletes a group in a GeoSci datafile.
[in] | file_id | A handle for the already-open GeoSci file. |
[in] | group_name | The name of the group, starting with a '/' and giving the full path to the group. |
TRUE
is returned if the group and all objects it contains are successfully deleted, FALSE
otherwise.int GS_GroupGetBounds | ( | hid_t | group_id, |
double * | xmin, | ||
double * | xmax, | ||
double * | ymin, | ||
double * | ymax | ||
) |
GS_GroupGetBounds returns the rectangular bounding coordinates.
[in] | group_id | A handle for a group. |
[out] | xmin | |
[out] | xmax | |
[out] | ymin | |
[out] | ymax | The coordinates are returned with units that are consistent with the projection that is used. Typically the units are decimal degrees or meters. |
TRUE
on success, FALSE
if there are any errors.FALSE
is returned. Otherwise, the correct numbers are filled in, and TRUE
is returned. bstring GS_GroupGetDatum | ( | hid_t | group_id | ) |
GS_GroupGetDatum returns a description of the relevant datum if one exists.
[in] | group_id | A handle for a group. |
bstring GS_GroupGetProjection | ( | hid_t | group_id | ) |
GS_GroupGetProjection returns a description of the relevant projection.
[in] | group_id | A handle for a group. |
int GS_GroupGetType | ( | hid_t | group_id | ) |
GS_GroupGetType returns the type of a group in a GeoSci datafile.
[in] | group_id | A handle for the group. |
GS_OBJECT_TYPE_METADATA_GROUP
1GS_OBJECT_TYPE_IMAGE
2GS_OBJECT_TYPE_VECTOR
3GS_OBJECT_TYPE_VECTOR2D
4GS_OBJECT_TYPE_VECTOR3D
5GS_OBJECT_TYPE_TIN
6GS_OBJECT_TYPE_MESH2D
7GS_OBJECT_TYPE_MESH3D
8GS_OBJECT_TYPE_RASTER
9GS_OBJECT_TYPE_IFILE
10GS_OBJECT_TYPE_METADATA_DATASET
12GS_OBJECT_TYPE_METADATA_IFILE
13int GS_GroupIsWriteable | ( | hid_t | file_id, |
const_bstring | group_name | ||
) |
GS_GroupIsWriteable returns if the group is writeable or not.
[in] | id | A handle for the file. |
[in] | group_name | The name of the group in the file. Should start with a "/". |
TRUE
if the dataset is writeable, FALSE
otherwise.int GS_GroupIsWriteableByID | ( | hid_t | group_id | ) |
GS_GroupIsWriteableByID returns if the group is writeable or not.
[in] | id | A handle for the group. |
TRUE
if the dataset is writeable, FALSE
otherwise.hid_t GS_GroupOpen | ( | hid_t | source, |
const_bstring | name | ||
) |
GS_GroupOpen opens an existing group in a GeoSci datafile.
[in] | source | A handle for a file or other container that has a group in it. |
[in] | name | The name of the group to open. |
int GS_GroupRename | ( | hid_t | id, |
const_bstring | oldname, | ||
const_bstring | newname | ||
) |
GS_GroupRename renames a group in a GeoSci datafile.
[in] | id | A handle for the file, or other container of the group. |
[in] | oldname | Current name of group to rename. |
[in] | newname | Desired new name of the group. |
TRUE
on sucess, FALSE
on failure.bstring GS_GroupReport | ( | hid_t | group_id | ) |
GS_GroupReport returns a one-line brief description of the group.
[in] | group_id | A handle for a group. |
int GS_GroupSetType | ( | hid_t | group_id, |
int | typecode | ||
) |
GS_GroupSetType sets the type of a group in a GeoSci datafile.
[in] | group_id | A handle for the group. |
[in] | typecode | An integer type code specifying the type of dataset. One of:GS_OBJECT_TYPE_METADATA_GROUP 1GS_OBJECT_TYPE_IMAGE 2GS_OBJECT_TYPE_VECTOR 3GS_OBJECT_TYPE_VECTOR2D 4GS_OBJECT_TYPE_VECTOR3D 5GS_OBJECT_TYPE_TIN 6GS_OBJECT_TYPE_MESH2D 7GS_OBJECT_TYPE_MESH3D 8GS_OBJECT_TYPE_RASTER 9GS_OBJECT_TYPE_IFILE 10GS_OBJECT_TYPE_METADATA_DATASET 12GS_OBJECT_TYPE_METADATA_IFILE 13 |
TRUE
on sucess, FALSE
on failure.bstring GS_GSObjectTypeAsString | ( | int | objtype | ) |
GS_GSObjectTypeAsString returns printable version of the object type.
[in] | object_type | Object type. One of: GS_OBJECT_TYPE_METADATA_GROUP 1 GS_OBJECT_TYPE_IMAGE 2 GS_OBJECT_TYPE_VECTOR 3 GS_OBJECT_TYPE_VECTOR2D 4 GS_OBJECT_TYPE_VECTOR3D 5 GS_OBJECT_TYPE_TIN 6 GS_OBJECT_TYPE_MESH2D 7 GS_OBJECT_TYPE_MESH3D 8 GS_OBJECT_TYPE_RASTER 9 GS_OBJECT_TYPE_IFILE 10 GS_OBJECT_TYPE_FILE 11 GS_OBJECT_TYPE_METADATA_DATASET 12 GS_OBJECT_TYPE_METADATA_IFILE 13 |
object_type
according to the following table:object type | returned string |
---|---|
GS_OBJECT_TYPE_METADATA_GROUP | Metadata |
GS_OBJECT_TYPE_IMAGE | Image |
GS_OBJECT_TYPE_VECTOR | Vector |
GS_OBJECT_TYPE_VECTOR2D | Vector2D |
GS_OBJECT_TYPE_VECTOR3D | Vector3D |
GS_OBJECT_TYPE_TIN | TIN |
GS_OBJECT_TYPE_MESH2D | Mesh2D |
GS_OBJECT_TYPE_MESH3D | Mesh3D |
GS_OBJECT_TYPE_RASTER | Raster |
GS_OBJECT_TYPE_IFILE | Internal File |
GS_OBJECT_TYPE_FILE | File |
GS_OBJECT_TYPE_METADATA_DATASET | Metadata Dataset |
GS_OBJECT_TYPE_METADATA_IFILE | Metadata Internal File |
Note that the returned string should NOT be GFree'd or bdestroy'd when done.
bstring GS_H5ObjectTypeAsString | ( | int | objtype | ) |
GS_H5ObjectTypeAsString returns a printable version of HDF5 object type.
[in] | object_type | object type, as an integer. One of: H5O_TYPE_GROUP H5O_TYPE_DATASET H5O_TYPE_NAMED_DATATYPE |
object type | returned string |
---|---|
H5O_TYPE_GROUP | Group |
H5O_TYPE_DATASET | Dataset |
H5O_TYPE_NAMED_DATATYPE | Named Datatype |
On failure, the string "Unknown Object Type" is returned.
Note that the returned string should NOT be bdestroy'd when done.
int GS_HDFDatatypeClose | ( | hid_t | id | ) |
GS_HDFDatatypeClose closes an HDF datatype.
[in] | id | The id of the datatype. |
TRUE
on success, ERROR (-1) on failure.int GS_ImageClose | ( | hid_t | image_id | ) |
GS_ImageClose closes an Open Image}.
[in] | image_id | Image handle of an image in a GEOSCI file. |
TRUE
on success, FALSE
on failure. hid_t GS_ImageCreate | ( | hid_t | file_id, |
const_bstring | image_name, | ||
const_bstring | image_descriptor | ||
) |
GS_ImageCreate creates a new image in a GeoSci file and opens it.
[in] | file_id | |
[in] | imagename | Name of the image to create. Must not be the same as any other existing object in the file or the creation will fail. |
[in] | image_descriptor | A string describing the contents of the image. This describes all the channels, in a general sense. |
int GS_ImageCreateMetadata | ( | hid_t | file_id, |
const_bstring | image_name, | ||
const_bstring | descriptor | ||
) |
GS_ImageCreateMetadata fills the standard image metadata attributes with the values that are passed in.
[in] | file_id | The file ID |
[in] | image_name | A character string giving the name of the image. |
[in] | descriptor | A character string describing the image contents. |
After creating a new image named "datatake 34" in a file named "av1.h5", we must set the metadata for the image before the image object can be used. The descriptor is "Apr 3, 2012, 2:18 PM".
The image metadata is attached to the Group within which all the Datasets are stored. The image metadata items are: grouptype
(= "Image"
), descriptor
, creation_datetime
, last_update_datetime
, history
, and writeable
.
Note that until the image metadata is set up correctly the image is not recognized as a valid GeoSci Image object, and so most functions in this library will not operate on it successfully. Because of this, the image creation functions, such as GS_ImageCreate, call this function as part of the creation process.
int GS_ImageDelete | ( | hid_t | file_id, |
const_bstring | image_name | ||
) |
GS_ImageDelete deletes an existing image.
[in] | file_id; | File handle of selected GeoSci file |
[in] | image_name | Name of image to delete. |
TRUE
is returned on success, FALSE
on failure. hid_t GS_ImageOpen | ( | hid_t | file_id, |
const_bstring | image_name | ||
) |
GS_ImageOpen opens an existing image.
[in] | file_id | File handle of selected GeoSci file. |
[in] | image_name | Name of image to open. |
void GS_init | ( | ) |
int GS_ObjectGetGSChildren | ( | hid_t | object_id, |
int * | nobjs, | ||
bstring ** | objnames, | ||
int ** | objtypes | ||
) |
GS_ObjectGetGSChildren returns list of GeoSci children objects.
[in] | object_id | handle of an open object. The names of the children of this object, if any, are returned. |
[out] | nobjs | The number of objects (children) found. |
[out] | objnames | The returned list of object names. when done, bdestroy() each element, and GFree the container. |
[out] | objtypes | The returned list of object types. GFree it when done. Valid values are: GS_OBJECT_TYPE_METADATA_GROUP 1 GS_OBJECT_TYPE_IMAGE 2 GS_OBJECT_TYPE_VECTOR 3 GS_OBJECT_TYPE_VECTOR2D 4 GS_OBJECT_TYPE_VECTOR3D 5 GS_OBJECT_TYPE_TIN 6 GS_OBJECT_TYPE_MESH2D 7 GS_OBJECT_TYPE_MESH3D 8 |
int GS_ObjectGetH5Children | ( | hid_t | object_id, |
int * | nobjs, | ||
bstring ** | objnames, | ||
int ** | objtypes | ||
) |
GS_ObjectGetH5Children returns list of all children objects.
[in] | object_id | Handle of an open object. The names of the children of this object, if any, are returned. |
[out] | nobjs; | The number of objects (children) returned. |
[out] | objnames; | The returned list of object names. bdestroy() each item it when done, and GFree() entire list when done. |
[out] | objtypes; | The returned list of object types. GFree it when done. Valid values are: H5O_TYPE_GROUP H5O_TYPE_DATASET H5O_TYPE_NAMED_DATATYPE |
TRUE
on success FALSE
on failure.int GS_ObjectIsDataset | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsDataset determines if an object is a dataset.
[in] | id | File handle or Image handle of selected GeoSci file. |
[in] | object_name; | Name of object to query. |
int GS_ObjectIsDatasetByID | ( | hid_t | id | ) |
GS_ObjectIsDatasetByID determines if an object-id refers to a dataset.
[in] | id | object handle in selected GeoSci file. |
TRUE
is returned if the object is a dataset, FALSE
otherwise.int GS_ObjectIsFile | ( | hid_t | id | ) |
GS_ObjectIsFile determines if an object-id refers to a file.
[in] | id | Object handle of selected GeoSci file. |
int GS_ObjectIsGroup | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsGroup determines if a named object is a group.
[in] | id | object handle of a file or another group in the selected GeoSci datafile. |
[in] | object_name | Name of object to query. This name is relative to the given object. |
int GS_ObjectIsGroupByID | ( | hid_t | id | ) |
GS_ObjectIsGroupByID determines if an object-id refers to a group.
[in] | object_id | object handle in a GeoSci file. |
int GS_ObjectIsIFile | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsIFile determines if the object is an internal file.
[in] | id | The handle for the already-open group. |
[in] | name | The name of the ifile within the group. |
TRUE
is returned if the object is an IFile, FALSE
otherwise.int GS_ObjectIsIFileByID | ( | hid_t | dataset_id | ) |
GS_ObjectIsIFileByID determines if the objectID is an internal file.
[in] | id | The handle of the open internal file. |
TRUE
is returned if the object is an IFile, FALSE
otherwise.int GS_ObjectIsImage | ( | hid_t | file_id, |
const_bstring | image_name | ||
) |
GS_ObjectIsImage determines if the object is an image.
[in] | id | The handle of an object in a GeoSci file. |
[in] | object_name; | Name of object to query. This name is relative to the given object. |
int GS_ObjectIsImageByID | ( | hid_t | id | ) |
GS_ObjectIsImageByID determines if the object is an image.
[in] | id; | The handle of the open objbect. |
int GS_ObjectIsMetadataDataset | ( | hid_t | id, |
const_bstring | name | ||
) |
ObjectIsMetadataDataset determines if the object is a metadata dataset.
[in] | id | The handle of the open group. |
[in] | name | The name of the object within the group. |
int GS_ObjectIsMetadataDatasetByID | ( | hid_t | dataset_id | ) |
ObjectIsMetadataDatasetByID determines if the objectid is a metadata dataset.
[in] | id | The handle of the open object. |
int GS_ObjectIsMetadataIFile | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsMetadataIFile determines if the object refers to a metadata internal-file.
[in] | id | The handle of the open group. |
[in] | name | The name of the object within the group. |
TRUE
on success, FALSE
on failure.int GS_ObjectIsMetadataIFileByID | ( | hid_t | dataset_id | ) |
GS_ObjectIsMetadataIFileByID determines if the object-id refers to a metadata internal-file.
[in] | id | The handle of the open object. |
TRUE
on success, FALSE
on failure.int GS_ObjectIsRaster | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsRaster determines if the object is a raster image.
[in] | id | The handle of the open image. |
[in] | name | Name of the raster within the image. |
int GS_ObjectIsRasterByID | ( | hid_t | dataset_id | ) |
GS_ObjectIsRasterByID determines if the object-id refers to a raster image.
[in] | id | The handle of the open raster. |
int GS_ObjectIsVector | ( | hid_t | id, |
const_bstring | name | ||
) |
GS_ObjectIsVector determines if the object is a vector.
[in] | id | object handle of a file or another group in the selected GeoSci file. |
[in] | object_name | Name of object to query. This name is relative to the given object. |
int GS_ObjectIsVectorByID | ( | hid_t | id | ) |
GS_ObjectIsVectorByID determines if the object-id refers to a vector.
[in] | id | The handle of the open vector. |
int GS_ObjectLock | ( | hid_t | id | ) |
GS_ObjectLock makes an object read-only.
[in] | id | The handle of the file, or any object in the file. |
int GS_ObjectUnlock | ( | hid_t | id | ) |
GS_ObjectUnlock changes and object to have read-write status.
[in] | id | The handle of the file, or any object in the file. |
bstring GS_PathnameGetDir | ( | const_bstring | name | ) |
GS_PathnameGetDir returns the directory name of the pathname.
[in] | name | The pathname to process. |
bstring GS_PathnameGetHDFDir | ( | const_bstring | name | ) |
GS_PathnameGetHDFDir returns the directory name of the pathname.
[in] | name | The pathname to process. |
bstring GS_PathnameJoin | ( | const_bstring | front, |
const_bstring | back | ||
) |
GS_PathnameJoin joins 2 pieces of a pathname.
[in] | front | The front part of the pathname. Should not end with a '/' or a '\'. |
[in] | back | The back part of the pathname. Should not start or end end with a '/' or a '\'. |
bstring GS_PathnameNodir | ( | const_bstring | name | ) |
GS_PathnameNoDir strips the directory name from the pathname.
[in] | name | The pathname to process. |
int GS_RasterCheckWindow | ( | hid_t | image_id, |
const_bstring | raster_name, | ||
int * | window | ||
) |
GS_RasterCheckWindow checks whether a requested window selection is within the bounds of an image. It will also default a window specification to be the whole image if XSize and/or YSize are zero.
[in] | image_id | Image handle that has the raster in it. |
[in] | raster_name | Name of raster to check. |
[in,out] | window | Vector containing desired window specification: window[0] = Xoffset window[1] = Yoffset window[2] = Xsize window[3] = Ysize If window[2] is 0, window[2] will be set to image X size - window[0]. If window[3] is 0, window[3] will be set to image Y size - window[1]. |
int GS_RasterCheckWindowByID | ( | hid_t | raster_id, |
int * | window | ||
) |
GS_RasterCheckWindowByID checks whether a requested window selection is within the bounds of a raster. It will also default a window specification to be the whole raster if XSize and/or YSize are zero.
[in] | raster_id | Handle of raster to check. |
[in,out] | window | Vector containing desired window specification: window[0] = Xoffset window[1] = Yoffset window[2] = Xsize window[3] = Ysize If window[2] is 0, on return window[2] will be set to image X size - window[0]. If window[3] is 0, on return window[3] will be set to image Y size - window[1]. |
int GS_RasterClose | ( | hid_t | raster_id | ) |
GS_RasterClose closes an open raster dataset.
[in] | raster_id | Raster handle in a GeoSci file. |
TRUE
is returned on success, FALSE
otherwise. hid_t GS_RasterCreate | ( | hid_t | image_id, |
const_bstring | const_raster_name, | ||
int | raster_type, | ||
int | npixels, | ||
int | nlines, | ||
const_bstring | descriptor | ||
) |
GS_RasterCreate create new image raster for a GeoSci Image.
[in] | image_id; | A handle for an already-open image. |
[in] | raster_name | The name of the raster channel to create. |
[in] | raster_type | The type for the raster data. One of: DATATYPE_UI1 1 A single bit GS_DATATYPE_UI8 2 Unsigned 8-bit integerGS_DATATYPE_SI8 3 Signed 8-bit integerGS_DATATYPE_CI8 4 Complex 8-bit integerGS_DATATYPE_UI16 5 Unsigned 16-bit integerGS_DATATYPE_SI16 6 Signed 16-bit integerGS_DATATYPE_CI16 7 Complex 16-bit integerGS_DATATYPE_UI32 8 Unsigned 32-bit integerGS_DATATYPE_SI32 9 Signed 32-bit integerGS_DATATYPE_CI32 10 Complex 32-bit integerGS_DATATYPE_CI64 11 Complex 64-bit integerGS_DATATYPE_R32 12 32-bit Real numberGS_DATATYPE_R64 13 64-bit Real numberGS_DATATYPE_C64 14 Complex 64-bit floating-point numberGS_DATATYPE_C128 15 Complex 128-bit floating point numberGS_DATATYPE_SI64 16 Signed 64-bit integer |
[in] | npixels | The x-dimension of the raster channel. |
[in] | nlines | The y-dimension of the raster channel. |
[in] | descriptor; | A string describing the raster contents. |
pixel_size__units="meter"
, pixels_size_x=1.0
, pixel_size_y=1.0
. These can be reset to valid values using the function GS_RasterPixelSize. int GS_RasterCreateMetadata | ( | hid_t | image_id, |
const_bstring | raster_name, | ||
int | raster_type, | ||
int | npixels, | ||
int | nlines, | ||
const_bstring | descriptor | ||
) |
GS_RasterCreateMetadata fills the standard raster metadata attributes with the values that are passed in.
[in] | image_id | The ID of the image that contains this raster. |
[in] | raster_name | A character string giving the name of the existing raster in the image. |
[in] | raster_type | The type for the raster data. One of: DATATYPE_UI1 1 A single bit GS_DATATYPE_UI8 2 Unsigned 8-bit integerGS_DATATYPE_SI8 3 Signed 8-bit integerGS_DATATYPE_CI8 4 Complex 8-bit integerGS_DATATYPE_UI16 5 Unsigned 16-bit integerGS_DATATYPE_SI16 6 Signed 16-bit integerGS_DATATYPE_CI16 7 Complex 16-bit integerGS_DATATYPE_UI32 8 Unsigned 32-bit integerGS_DATATYPE_SI32 9 Signed 32-bit integerGS_DATATYPE_CI32 10 Complex 32-bit integerGS_DATATYPE_CI64 11 Complex 64-bit integerGS_DATATYPE_R32 12 32-bit Real numberGS_DATATYPE_R64 13 64-bit Real numberGS_DATATYPE_C64 14 Complex 64-bit floating-point numberGS_DATATYPE_C128 15 Complex 128-bit floating point numberGS_DATATYPE_SI64 16 Signed 64-bit integer |
[in] | npixels | The x-dimension of the raster channel. |
[in] | nlines | The y-dimension of the raster channel. |
[in] | descriptor | A character string describing the image contents. |
TRUE
on success, FALSE
on failure.After creating a new raster named "r3" in an image named "datatake 34" in a file named "av1.h5", we must set the metadata for the raster before the raster object can be used. The descriptor is "SIRC-SLC data from SRL-1 over Greenland". The raster datatype is complex-integer, each 32 bits, with 1024 pixels along the x-direction, and 2048 lines along the y-dimension.
The raster metadata is attached to the Dataset that holds the raster data. The raster metadata items are:
dataset_type
(= "Raster"
),
pixel_size_units
(default is "meter"
),
pixel_size_x
,
pixel_size_y
,
type
,
npixels
,
nlines
,
descriptor
,
creation_datetime
,
last_update_datetime
,
history
,
and writeable
.
Note that until the raster metadata is set up correctly the raster is not recognized as a valid GeoSci Raster object, and so most functions in this library will not operate on it successfully. Because of this, the raster creation functions, such as GS_RasterCreate, call this function as part of the creation process.
int GS_RasterDelete | ( | hid_t | image_id, |
const_bstring | raster_name | ||
) |
GS_RasterDelete deletes an existing raster.
[in] | image_id | Handle of containing image. |
[in] | raster_name | Name of raster to delete. |
TRUE
is returned on success, FALSE
on failure. hid_t GS_RasterOpen | ( | hid_t | image_id, |
const_bstring | raster_name | ||
) |
GS_RasterOpen opens existing raster dataset.
[in] | image_id | Image handle in a GEOSCI file |
[in] | raster_name | Name of raster dataset to open. |
int GS_RasterPixelSize | ( | hid_t | raster_id, |
int | func, | ||
double * | x_pixelsize, | ||
double * | y_pixelsize, | ||
bstring | pixel_units | ||
) |
GS_RasterPixelSize reads/writes Raster Pixel Size.
[in] | raster_id | Handle to already-opened Raster in a GeoSci file. |
[in] | func | Flag indicating whether to write the passed pixel size to the image metadata (GS_WRITE), or return the pixel size currently stored for the image (GS_READ). |
[in,out] | x_pixelsize | Pixel ground X-size in `pixel_units' units. |
[in,out] | y_pixelsize | Pixel ground Y-size in `pixel_units' units. |
[in,out] | pixel_units | Pixel Size Units string. |
TRUE
is returned on success, FALSE
otherwise. int GS_RasterSizeInfo | ( | hid_t | raster_id, |
int * | npixels, | ||
int * | nlines | ||
) |
GS_RasterSizeInfo returns the number of pixels and lines in a raster.
[in] | raster_id | Handle for opened raster in a Geosci file. |
[out] | npixels | Pointer to integer to be loaded with the number of image pixels. |
[out] | nlines | Pointer to integer to be loaded with the number of image lines. |
int GS_RasterTypeIsComplex | ( | int | datatype | ) |
GS_RasterTypeIsComplex returns TRUE for complex types.
[in] | datatype | An integer representing a GeoSci datatype. Valid datatypes:GS_DATATYPE_UI1 1 A single bitGS_DATATYPE_UI8 2 Unsigned 8-bit integerGS_DATATYPE_SI8 3 Signed 8-bit integerGS_DATATYPE_CI8 4 Complex 8-bit integerGS_DATATYPE_UI16 5 Unsigned 16-bit integerGS_DATATYPE_SI16 6 Signed 16-bit integerGS_DATATYPE_CI16 7 Complex 16-bit integerGS_DATATYPE_UI32 8 Unsigned 32-bit integerGS_DATATYPE_SI32 9 Signed 32-bit integerGS_DATATYPE_CI32 10 Complex 32-bit integerGS_DATATYPE_CI64 11 Complex 64-bit integerGS_DATATYPE_R32 12 32-bit Real numberGS_DATATYPE_R64 13 64-bit Real numberGS_DATATYPE_C64 14 Complex 64-bit floating-point numberGS_DATATYPE_C128 15 Complex 128-bit floating point GS_DATATYPE_UI64 16 Unsigned 64-bit integerGS_DATATYPE_SI64 17 Signed 64-bit integer |
TRUE
is returned for complex types, FALSE
for scalar types and ERROR
otherwise. int GS_RasterTypeIsInteger | ( | int | datatype | ) |
GS_RasterTypeIsInteger returns TRUE for integer types.
[in] | datatype | An integer representing a GeoSci datatype. Valid datatypes:GS_DATATYPE_UI1 1 A single bitGS_DATATYPE_UI8 2 Unsigned 8-bit integerGS_DATATYPE_SI8 3 Signed 8-bit integerGS_DATATYPE_CI8 4 Complex 8-bit integerGS_DATATYPE_UI16 5 Unsigned 16-bit integerGS_DATATYPE_SI16 6 Signed 16-bit integerGS_DATATYPE_CI16 7 Complex 16-bit integerGS_DATATYPE_UI32 8 Unsigned 32-bit integerGS_DATATYPE_SI32 9 Signed 32-bit integerGS_DATATYPE_CI32 10 Complex 32-bit integerGS_DATATYPE_CI64 11 Complex 64-bit integerGS_DATATYPE_R32 12 32-bit Real numberGS_DATATYPE_R64 13 64-bit Real numberGS_DATATYPE_C64 14 Complex 64-bit floating-point numberGS_DATATYPE_C128 15 Complex 128-bit floating point GS_DATATYPE_UI64 16 Unsigned 64-bit integerGS_DATATYPE_SI64 17 Signed 64-bit integer |
TRUE
is returned for integer types, FALSE
for floating-point types and ERROR otherwise.herr_t GS_SetCacheSize | ( | hid_t | file_id, |
size_t | cache_size | ||
) |
GS_SetCacheSize sets the metadata cache size for a GeoSci datafile.
[in] | file_id | File handle for GeoSci datafile |
[in] | cache_size | Size in bytes for the metadata cache. 1048576 (1 MByte) is a good default. |
int GS_SetStringAttribute | ( | hid_t | object_id, |
const_bstring | name, | ||
const_bstring | value | ||
) |
GS_SetStringAttribute sets the value of a string attribute for a given object.
[in] | group_id | The opened object where the attribute is stored. |
[in] | name | The name of the attribute variable. |
[in] | value | The value of the variable to set. |
int GS_SplitHistory | ( | const_bstring | history_string, |
bstring | front, | ||
bstring | back | ||
) |
GS_SplitHistory splits history string into front and back.
"line1;\nline2;\nline3;\n"
"\line1;\nline2;\n"
back = "line3;\n"
This is programmed as: The history string is made up of lines delimited by ";\n". There are several cases:
li If the history string is non-empty, but has no ";\n" delimiters, then the returned front string is empty, and the back string is this string, with a ";\n" appended to it.
int GS_UpdateMetadata | ( | hid_t | object_id, |
const_bstring | name, | ||
bstring | value | ||
) |
GS_UpdateMetadata update a metadata item for the given object.
[in] | object_id | ID of GeoSci object to modify. Can be a file, an image, etc. |
[in] | name | The name of the metadata variable to modify. |
[in] | value | The new value for the metadata variable. |
descriptor
metadata for an image to "Angkor Wat, Cambodia". int GS_ValidID | ( | hid_t | id | ) |
GS_ValidID returns whether the given object-id is a valid identifier.
[in] | id | An identifier that may have been returned from one of the other routines in the library, possibly referring to a file, an image, or some other object of interest in the file. |
int GS_ValidMetadataName | ( | int | object_type, |
const_bstring | name | ||
) |
GS_ValidMetadataName check if the name is a valid metadata item for the given object type.
[in] | object_type | An integer giving the type of object this metadata variable refers to. Valid object types are: GS_OBJECT_TYPE_METADATA_GROUP 1GS_OBJECT_TYPE_IMAGE 2GS_OBJECT_TYPE_VECTOR 3GS_OBJECT_TYPE_VECTOR2D 4GS_OBJECT_TYPE_VECTOR3D 5GS_OBJECT_TYPE_TIN 6GS_OBJECT_TYPE_MESH2D 7GS_OBJECT_TYPE_MESH3D 8GS_OBJECT_TYPE_RASTER 9GS_OBJECT_TYPE_IFILE 10GS_OBJECT_TYPE_METADATA_DATASET 12GS_OBJECT_TYPE_METADATA_IFILE 13 |
[in] | name | A character string giving the name of the metadata variable to query. |
TRUE
is returned if the name is a valid metadata variable, FALSE
otherwise.descriptor
is a valid metadata item for an image before updating its value: int GS_VectorCreateMetadata | ( | hid_t | file_id, |
const_bstring | vector_name, | ||
const_bstring | descriptor | ||
) |
GS_VectorCreateMetadata creates vector metadata.
[in] | file_id | The file ID. |
[in] | vector_name | A character string giving the name of the image. |
[in] | descriptor | A character string describing the vector contents. |
After creating a new vector named "hydrology" in a file named "av1.h5", we must set the metadata for the vector object before it can be used. The descriptor is "water boundaries".
The vector metadata is attached to the Group within which the vector Dataset is stored. The vector metadata items are: grouptype
(= "Image"
), descriptor
, creation_datetime
, last_update_datetime
, history
, writeable
and spatialref
.
Note that until the vector metadata is set up correctly the image is not recognized as a valid GeoSci Vector object, and so most functions in this library will not operate on it successfully. Because of this, the vector creation function, GS_VectorCreate calls this function as part of the creation process.