HDF5 Extras  0.0.1
Convenience Functions for using HDF5 Better
hdf5mine.h
Go to the documentation of this file.
1 #ifndef HDF5MINE_H_
2 #define HDF5MINE_H_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
10 //#define GSP_READ 0
11 //#define GSP_WRITE 1
12 
13 bstring GS_H5ObjectTypeAsString(int objtype);
14 bstring GS_GSObjectTypeAsString(int objtype);
15 
17 void GS_init();
18 
19 int GS_ValidID(hid_t id);
20 bstring GS_GetIDName(hid_t id);
21 
22 int GS_GetStringAttribute( hid_t object_id, const_bstring name, bstring value);
23 int GS_SetStringAttribute( hid_t object_id, const_bstring name, const_bstring value);
24 
25 int GS_ObjectIsFile(hid_t id);
26 int GS_ObjectIsDataset(hid_t id, const_bstring name);
27 int GS_ObjectIsDatasetByID(hid_t id);
28 int GS_ObjectIsGroup(hid_t id, const_bstring name);
29 int GS_ObjectIsGroupByID(hid_t id);
30 
31 int GS_CheckInternalName(hid_t object_id, const_bstring thename);
32 hid_t GS_CreateAccessPlist(void);
33 
34 hid_t GS_FileCreate(const_bstring filename);
35 int GS_FileDelete(const_bstring filename);
36 hid_t GS_FileOpen(const_bstring dbname, const_bstring access);
37 int GS_FileFlush(hid_t object_id);
38 int GS_FileClose(hid_t file_id);
39 int GS_FileCloseAllObjects(hid_t file_id);
40 int GS_FileIsWriteable(hid_t id);
41 int GS_FileCopy(bstring oldname, bstring newname);
42 int GS_FileIsOpen(const_bstring filename);
43 int GS_FileRename(const_bstring oldname, const_bstring newname);
44 int GS_FileReport(const_bstring filename, bstring report_string);
45 hid_t GS_GetValidFileID(hid_t id);
46 
47 bstring GS_GetFilename(hid_t id);
48 herr_t GS_SetCacheSize(hid_t file_id, size_t cache_size);
49 int GS_FileCommitDatatypes(hid_t file_id);
50 
51 
52 char *GS_Dirname(const char *name);
53 
54 
55 hid_t GS_DatasetCreate(hid_t source, const_bstring name, int datatype,
56  int ndims, int *size, int is_extendable,
57  int is_compressed);
58 int GS_DatasetDelete(hid_t file_id, const_bstring dataset_name);
59 hid_t GS_DatasetOpen(hid_t source, const_bstring name);
60 hid_t GS_DatasetClose(hid_t id);
61 int GS_DatasetRename(hid_t group_id, const_bstring oldname, const_bstring newname);
62 hid_t GS_DatasetGetParent(hid_t id);
63 int GS_DatasetGetDatatype(hid_t id, const_bstring name);
64 int GS_DatasetGetDatatypeByID(hid_t id);
65 int GS_DatasetGetDimensionsByID(hid_t id, long int **size);
66 int GS_DatasetGetDimensions(hid_t id, const_bstring name, long int **size);
67 hid_t GS_DatasetCopy(hid_t source, hid_t destination_group_id,
68  const_bstring destination_dataset_name);
69 
70  int GS_DatasetRead(hid_t dataset_id, const long int *offsets,
71  const long int *sizes, int datatype, void *buffer);
72 int GS_DatasetWrite(hid_t dataset_id, const long int *offsets,
73  const long int *sizes, int datatype, const void *buffer);
74 
75 
76 int GS_DataConversion( int in_type, const void *in_buffer,
77  int out_type, void *out_buffer,
78  int nelements);
79 int GS_RasterTypeNumbytes(int datatype );
80 
81 
82 int GS_ConvertFromHDFDatatype(hid_t datatype);
83 hid_t GS_ConvertToHDFDatatype(int datatype);
84 int GS_HDFDatatypeClose(hid_t id);
85 
86 
87 
88 
93 
94 
95 hid_t GS_GroupCreate(hid_t file_id, const_bstring groupname);
96 hid_t GS_GroupOpen(hid_t source, const_bstring name);
97 int GS_GroupClose(hid_t id);
98 int GS_GroupCloseAllObjects(hid_t id);
99 hid_t GS_GroupCopy(hid_t source, hid_t destination_object_id,
100  const_bstring destination_group_name);
101 int GS_GroupRename(hid_t id, const_bstring oldname, const_bstring newname);
102 int GS_GroupDelete(hid_t file_id, const_bstring group_name );
103 
104 
106 
107 #define GS_READ 0
108 #define GS_WRITE 1
109 
110  //#define GS_DATASET_TYPE_UNKNOWN 0
111  //#define GS_DATASET_TYPE_INTERNAL_FILE 1
112  //#define GS_DATASET_TYPE_RASTER 2
113  //#define GS_DATASET_TYPE_METADATA 3
114  //#define GS_DATASET_TYPE_METADATA_IFILE 4
115 
116 #define GS_IFILE_SUCCESS 1
117 #define GS_IFILE_FAILURE 2
118 
119 
120 
121 // geosci group types in hdf5 files:
122 #define GS_OBJECT_TYPE_UNKNOWN 0
123 #define GS_OBJECT_TYPE_METADATA_GROUP 1
124 #define GS_OBJECT_TYPE_IMAGE 2
125 #define GS_OBJECT_TYPE_VECTOR 3
126 #define GS_OBJECT_TYPE_VECTOR2D 4
127 #define GS_OBJECT_TYPE_VECTOR3D 5
128 #define GS_OBJECT_TYPE_TIN 6
129 #define GS_OBJECT_TYPE_MESH2D 7
130 #define GS_OBJECT_TYPE_MESH3D 8
131 #define GS_OBJECT_TYPE_RASTER 9
132 #define GS_OBJECT_TYPE_IFILE 10
133 #define GS_OBJECT_TYPE_FILE 11
134 #define GS_OBJECT_TYPE_METADATA_DATASET 12
135 #define GS_OBJECT_TYPE_METADATA_IFILE 13
136 #define GS_OBJECT_TYPE_UNDER_CONSTRUCTION -1
137 
138 
139 // geosci coordinates units:
140 #define GS_COORDINATES_UNKNOWN 0
141 #define GS_COORDINATES_DEGREES 1
142 #define GS_COORDINATES_METERS 2
143 #define GS_COORDINATES_PIXELS 3
144 
145 
146 
147 
148 
149 /* complex types: */
150 /* needs updating based on machine defaults....*/
151 /* tried using the int8_t, etc types but it would not compile...??? */
152 /* LEP: dec 1, 2013 */
153 typedef char complex ci16_t;
154 typedef short int complex ci32_t;
155 typedef int complex ci64_t;
156 typedef float complex c64_t;
157 typedef double complex c128_t;
158 
159 
160 
161 
162 // the functions:
163 int GS_AppendMetadata(hid_t object_id, const_bstring metadata_name,
164  const_bstring value);
165 int GS_FileCreateMetadata(hid_t file_id, const_bstring descriptor);
166  //int GS_ImageCreateMetadata(hid_t file_id, const_bstring image_name,
167  // const_bstring typestring, const_bstring chanstr,
168  // const_bstring pixstr, const_bstring linestr,
169  // const_bstring descriptor);
170 int GS_ImageCreateMetadata(hid_t file_id, const_bstring image_name,
171  const_bstring descriptor);
172 int GS_VectorCreateMetadata(hid_t file_id, const_bstring vector_name,
173  const_bstring descriptor);
174 
175 int GS_RasterCreateMetadata(hid_t image_id, const_bstring raster_name,
176  int raster_type, int npixels, int nlines,
177  const_bstring descriptor);
178 
179 
180 
181  //int GS_ObjectGetType(hid_t object_id);
182 int GS_ObjectIsIFileByID( hid_t dataset_id );
183 int GS_ObjectIsIFile( hid_t id, const_bstring name );
184 int GS_ObjectIsImageByID( hid_t id );
185 int GS_ObjectIsImage(hid_t file_id, const_bstring image_name);
186 int GS_ObjectIsMetadataDatasetByID( hid_t dataset_id );
187 int GS_ObjectIsMetadataDataset( hid_t id, const_bstring name );
188 int GS_ObjectIsMetadataIFileByID( hid_t dataset_id );
189 int GS_ObjectIsMetadataIFile( hid_t id, const_bstring name );
190 int GS_ObjectIsRasterByID( hid_t dataset_id );
191 int GS_ObjectIsRaster( hid_t id, const_bstring name );
192 int GS_ObjectIsVectorByID( hid_t id );
193 int GS_ObjectIsVector( hid_t id, const_bstring name );
194 int GS_ObjectLock(hid_t id);
195 int GS_ObjectUnlock(hid_t id);
196 int GS_SplitHistory(const_bstring history_string, bstring front, bstring back);
197 int GS_UpdateMetadata( hid_t object_id, const_bstring name, bstring value);
198 int GS_ValidMetadataName(int object_type, const_bstring name);
199 
200 
201 hid_t GS_ConvertToHDFDatatype(int datatype);
202 
203 int GS_DatatypeIsComplex(int datatype);
204 bstring GS_DatatypeAsString(int datatype);
205 
206 bstring GS_DatasetReport(hid_t dataset_id);
207 int GS_DatasetIsWriteable(hid_t file_id, const_bstring dataset_name);
208 int GS_DatasetIsWriteableByID(hid_t dataset_id);
209 
210 int GS_GroupIsWriteable(hid_t file_id, const_bstring group_name);
211 int GS_GroupIsWriteableByID(hid_t group_id);
212 bstring GS_GroupReport(hid_t group_id);
213 
214 int GS_GroupGetType(hid_t group_id);
215 int GS_GroupSetType(hid_t group_id, int typecode);
216 
217 bstring GS_GroupGetDatum(hid_t group_id);
218 bstring GS_GroupGetProjection(hid_t group_id);
219 int GS_GroupGetBounds(hid_t group_id, double *xmin, double *xmax,
220  double *ymin, double *ymax);
221 
222 bstring GS_DatasetGetDatum(hid_t dataset_id);
223 bstring GS_DatasetGetProjection(hid_t dataset_id);
224 int GS_DatasetGetBounds(hid_t dataset_id, double *xmin, double *xmax,
225  double *ymin, double *ymax);
226 
227 
228 
229 int GS_ObjectGetH5Children( hid_t object_id, int *nobjs,
230  bstring **objnames, int **objtypes);
231 int GS_ObjectGetGSChildren( hid_t object_id, int *nobjs,
232  bstring **objnames, int **objtypes);
233 
234 int GS_DatasetGetType(hid_t dataset_id);
235  int GS_DatasetSetType(hid_t dataset_id, int typecode);
236 
238 
240 
241 
242 
243 
244 
245 
246 hid_t GS_ImageCreate(hid_t file_id, const_bstring image_name,
247  const_bstring image_descriptor);
248 int GS_ImageClose( hid_t image_id);
249 hid_t GS_ImageOpen( hid_t file_id, const_bstring image_name);
250 int GS_ImageDelete( hid_t file_id, const_bstring image_name);
251 
252 int GS_AppendHistory(hid_t object_id, const_bstring history_line);
253 int GS_AbortedHistory(hid_t object_id, const_bstring history_line);
254 
255 hid_t GS_RasterCreate(hid_t image_id, const_bstring raster_name,
256  int raster_type, int npixels, int nlines,
257  const_bstring descriptor);
258 hid_t GS_RasterOpen( hid_t image_id, const_bstring raster_name);
259 int GS_RasterClose( hid_t raster_id);
260 int GS_RasterDelete( hid_t image_id, const_bstring raster_name);
261 bstring GS_GetRasterTypeAsString(int datatype);
262 int GS_RasterPixelSize(hid_t raster_id,int func, double *x_pixelsize,
263  double *y_pixelsize, bstring pixel_units);
264 int GS_RasterSizeInfo(hid_t raster_id, int *npixels, int *nlines);
265 int GS_RasterCheckWindow( hid_t file_id, const_bstring image_name, int *window);
266 int GS_RasterCheckWindowByID( hid_t image_id, int *window);
267 int GS_CheckWindowInside( int *window_in, const int *window_enclosing );
268 
270  //yet int GetRasterTypes(hid_t image_id, int **types, int *ntypes);
271  //yet int GetRasterTypeNumbytes(int datatype );
272  //yet int GetRasterTypeAsInteger(char *typestring);
273 int GS_RasterTypeIsInteger(int datatype);
274 int GS_RasterTypeIsComplex(int datatype);
275 int GS_CheckUniqueName(hid_t file_id, const char *thename);
276 
277 
278 
279 
280 
281 
282 
283 
285 
286 #ifdef OLDSTUFF
287 
288  //int GetStringAttribute( hid_t group_id, const char *name, char **value);
289 
290  //int FileReport(const char *filename, char **report_string);
291 int ImageReport(const char *filename, const char *image_name,
292  char **report_string);
293 int FreeReportString(char *str);
294 
295 
296  //done//hid_t ImageOpen( hid_t file_id, const char *image_name);
297  //done//int ImageClose( hid_t image_id);
298  //done//int ImageDelete( hid_t file_id, const char *image_name);
299  //done//hid_t ImageAdd(hid_t file_id, const char *image_name,
300  // const char *image_descriptor,
301  // int pixels, int lines,int channels,
302  // int *channel_types, const char **channel_descriptors);
303 int ImageCopy( hid_t file_from, const char *image_from,
304  int *channels_from, int *window_from,
305  hid_t file_to, const char *image_to,
306  int *channels_to, int *window_to);
307 
308 int ImageCopyByID( hid_t image_from, const char *raster_name_from, int *window_from,
309  hid_t image_to, const char *raster_name_to, int *window_to);
310 
311 int ImageImport(const char *infilename,const char *outfilename,
312  const char *outimagename);
313 int ImageChannelAdd(hid_t file_id, const char *cimage_name,
314  int channels, int *channel_types,
315  const char **channel_descriptors);
316 int ImageChannelDelete(hid_t file_id, const char *cimage_name,
317  int *channels);
318 
319 
320 
321  //hid_t GroupOpen(hid_t gid, const char *name);
322  //int GroupClose(hid_t id );
323  //hid_t GroupCreate(hid_t file_id, const char *groupname);
324  //int GroupDelete(hid_t file_id, const char *group_name );
325 
326 
327 
328  //hid_t FileCreate(const char *filename, int pixels, int lines, const int channels[]);
329  //hid_t FileCreateEmpty(const char *filename);
330  //hid_t FileOpen(const char *dbname, const char *access);
331  //int FileClose(hid_t file_id);
332  //int FileFlush(hid_t object_id);
333 
334 
335  //void Time (char *string, int format);
336 
337  //herr_t SetCacheSize(hid_t file_id, size_t cache_size);
338 
339  //hid_t CreateAccessPlist(void);
340 
341 int ImageSizeInfo(hid_t image_id, int *npixels, int *nlines, int *nchannels);
342 
343  //int FileWriteable( hid_t id);
344  //char *GetFilename(hid_t id);
345 int CheckWindow( hid_t file_id, const char *image_name, int *window);
346 int CheckWindowByID( hid_t image_id, int *window);
347 int CheckWindowInside( int *window_in, const int *window_enclosing );
348 int CheckChannels( hid_t file_id, const char *image_name,
349  const int *channel_list, int nchans,
350  int *is_valid_channel, int *is_writeable_channel);
351 int CheckChannelsValid( hid_t file_id, const char *image_name,
352  const int *channel_list, int nchans);
353 int CheckChannelsWriteable( hid_t file_id, const char *image_name,
354  const int *channel_list, int nchans);
355 
356 int CheckDatatype(int datatype);
357  //hid_t GetHdf5Type(int datatype);
358 char *GetRasterTypeAsString(int datatype);
359 int HDF5Type2GSPType(hid_t datatype);
360 
361 
362 
363 void DisableHDF5ErrorReporting(void);
364 void EnableHDF5ErrorReporting(void);
365 
366  //int ValidID(hid_t id);
367  //hid_t GetValidFileID(hid_t id);
368 
369 
370  //int ObjectIsDataset(hid_t id, const char *name);
371  //int ObjectIsDatasetByID(hid_t id);
372  //int ObjectIsFile(hid_t id);
373  //int ObjectIsImage(hid_t id, const char *name);
374  //int ObjectIsImageByID( hid_t id );
375  //int ObjectIsVector( hid_t id, const char *name );
376  //int ObjectIsVectorByID( hid_t id );
377  //int ObjectIsGroup(hid_t file_id, const char *name);
378  //int ObjectIsGroupByID(hid_t id);
379  //int ObjectIsMetadataDataset( hid_t id, const char *name );
380  //int ObjectIsMetadataDatasetByID( hid_t dataset_id );
381  //int ObjectIsMetadataIFileByID( hid_t dataset_id );
382 
383 
384 
385 
386 hid_t RasterOpen( hid_t image_id, const char *raster_name);
387 hid_t RasterClose( hid_t raster_id);
388 int GetRasterTypes(hid_t image_id, int **types, int *ntypes);
389 int GetRasterTypeNumbytes(int datatype );
390 int GetRasterTypeAsInteger(char *typestring);
391 int GS_RasterTypeIsInteger(int datatype);
392 int GS_RasterTypeIsComplex(int datatype);
393 
394 void Progress( const char *name, double frac);
395 
396 
397  //hid_t DatasetOpen(hid_t source, const char *name);
398  //hid_t DatasetClose(hid_t id);
399  //int DatasetDelete(hid_t file_id, const char *dataset_name);
400  //int DatasetGetType(hid_t dataset_id);
401  //int DatasetSetType(hid_t dataset_id, int typecode);
402 
403 
404 
405 int ImageIO( hid_t file_id, const char *image_name, int func,
406  int xoff, int yoff, int xsize, int ysize,
407  void *buffer, int *datatypes, int *buffer_window,
408  int nchans, int *chanmap, int write_history);
409 
410 
411 //#include "generic_image.h"
412 
413 double GetDoubleValue(void *buf,int index, int from_type,
414  int to_type, int reim);
415 int PutDoubleValue(double value, void *buf,int index,
416  int to_type, int reim);
417 
418 double complex GetDoubleComplexValue(void *buf,int index, int from_type,
419  int to_type);
420 int PutDoubleComplexValue(double complex value, void *buf,int index,
421  int to_type);
422 
423 
424 
425 
426 long int GetSystemMemory(void);
427 long int GetFreeMemory(void);
428 
429  //char *Dirname(const char *name);
430 
431 
432  //int ObjectIsRaster( hid_t id, const char *name );
433  //int ObjectIsRasterByID( hid_t datasetid );
434 
435 
436 
437 
438 
439 
440 
441 
442 
443 
444 
445 
446 
447 
448 int SpatialrefCreate(hid_t file_id, const char *object_name,
449  const char *code, const char *wkt,
450  const char *proj4);
451 
452 int SpatialrefIO(hid_t file_id, const char *object_name, int func,
453  char *code, char *wkt, char *proj4);
454 
455 int SpatialrefReport(const char *filename, const char *object_name,
456  char **report_string);
457 
458 
459 int SpatialrefCopy(hid_t from_file_id, const char *from_object_name,
460  hid_t to_file_id, const char *to_object_name);
461 
462 //char *GSPGetAuthorityCode(OGRSpatialReferenceH asr);
463 
464 //int GetObjectType(hid_t object_id);
465 //int GS_GetGroupType(hid_t file_id, const_bstring group_name);
466 //int GS_GetGroupTypeByID(hid_t object_id);
467 //int GroupTypeString2Int(const char *grouptypestring);
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 //int CreateFileMetadata(hid_t file_id, const char *descriptor);
484 //int CreateImageMetadata(hid_t file_id, const char *image_name,
485 // const char *typestring, const char *chanstr,
486 // const char *pixstr, const char *linestr,
487 // const char *descriptor);
488 //int CreateVectorMetadata(hid_t file_id, const char *vector_name,
489 // const char *descriptor);
490 
491 
492 //int UpdateFileMetadata( hid_t file_id, const char *name, const char *value);
493 //int AppendFileMetadata( hid_t file_id, const char *name, const char *value);
494 //int ValidFileMetadataName(const char *name);
495 //int AppendMetadata(hid_t object_id, const char *metadata_name, const char *value);
496 //int UpdateMetadata( hid_t object_id, const char *name, const char *value);
497 
498 
499 //int UpdateImageMetadata( hid_t file_id, const char *image_name,
500 // const char *name, const char *value);
501 //int AppendImageMetadata( hid_t file_id, const char *image_name,
502 // const char *name, const char *value);
503 //int UpdateImageMetadataByID( hid_t image_id, const char *name,
504 // const char *value);
505 
506 //int UpdateRasterMetadata( hid_t file_id, const char *image_name,
507 // const char *raster_name,
508 // const char *name, const char *value);
509 
510 //int ValidMetadataName(int object_type, const char *name);
511 
512 int UpdateDescriptor( hid_t object_id, const char *descriptor);
513  //done//int AbortedHistory(hid_t object_id, const char *history_line);
514  //DONE//int AppendHistory(hid_t object_id, const char *history_line);
515  //int SplitHistory(char *history_string, char **front, char **back);
516 
517 
518 int CoordinatesCreate(hid_t file_id, const char *object_name,
519  double ULx, double ULy, double LRx, double LRy);
520 
521 int CoordinatesCopy(hid_t from_file_id, const char *from_object_name,
522  hid_t to_file_id, const char *to_object_name);
523 
524 int CoordinatesIO(hid_t file_id, const char *object_name, int func,
525  double *ULx, double *UULy, double *ULRx, double *ULRy,
526  int *units);
527 int CoordinatesReport(hid_t file_id, const char *object_name,
528  char *report_string);
529 
530 
531 int VectorDatabaseInit(hid_t file_id, const char *vector_name);
532 
533 //sqlite3 *VectorDatabaseOpen(hid_t vector_id);
534 
535 int GetVectorTableDef(const char *filename, char **table_name,
536  int *geometry_type, int *dimension,
537  char ***column_types, char ***column_names);
538 
539 
540 hid_t VectorAdd(hid_t file_id, const char *vector_name,
541  const char *vector_descriptor);
542 
543 //int OSRImport(OGRSpatialReferenceH asr, OGRDataSourceH hDS);
544 
545 int SpatialrefImport( const char *filename, char *code,
546  char *wkt, char *proj4 );
547 
548 int DecodeSRID( const char *code, int *code_number );
549 
550 
551 
552 
553 
554 
555 
556 
557 
558 
559 
560 
561 
562 
563 
564 
565 
566 
567 
568 
569 // defs for very generic geometry types for vectors
570 // these include 2d, 2.5-d, and on-multi and multi- versions of each
571 #define GSP_POINT 1
572 #define GSP_LINE 2
573 #define GSP_POLYGON 3
574 #define GSP_COLLECTION 4
575 
576 //defs for more specific geometry types:
577 #define GSP_POINT2 1
578 #define GSP_LINE2 2
579 #define GSP_POLYGON2 3
580 #define GSP_COLLECTION2 4
581 #define GSP_RING2 5
582 #define GSP_POINT25 6
583 #define GSP_LINE25 7
584 #define GSP_POLYGON25 8
585 #define GSP_COLLECTION25 9
586 
587 char *GetVectorTypeAsString(int datatype);
588 int GetVectorNumShapes(hid_t vector_id,int *num_types,int *types,
589  long int *num_per_type);
590 int GetVectorBounds(hid_t vector_id,int *num_types,int *types,
591  double *bounds_per_type);
592 
593 
594  //int GetChildren( hid_t object_id, int *nobjs,
595  // char ***objnames, int **objtypes);
596 char *H5ObjectTypeAsString(int objtype);
597 int GetGSPChildren( hid_t object_id, int *nobjs,
598  char ***objnames, int **objtypes);
599 char *GSPObjectTypeAsString(int objtype);
600 
601 
602 // for debug only:
603 int report_num_objects_open(void);
604 int count_num_objects_open(void);
605 
606 
607 
608  //int DatasetRename(hid_t group_id, const char *oldname, const char *newname);
609 
610  //int FileRename(const char *oldname, const char *newname);
611  //int FileIsOpen(const char *filename);
612  //int FileDelete(const char *filename);
613 
614  //int ObjectLock(hid_t id);
615 hid_t GetRasterParent(hid_t id);
616 int GetRasterNumber(hid_t id);
617 int ChannelWritabilityIO(hid_t image_id, int func, int *nchannels,
618  int *writeability);
619  //int ObjectUnlock(hid_t id);
620 
621  //done//hid_t RasterCreate(hid_t image_id, const char *raster_name,
622  // int raster_type, int nnpixels, int nnlines,
623  // const char *descriptor);
624 int RasterDelete( hid_t image_id, const char *raster_name);
625 
626 
627 
628 
629 hid_t PyramidCheck(hid_t image_id, int npyramids, int *xsizes, int *ysizes);
630 hid_t PyramidCreate(hid_t image_id);
631 int PyramidDelete(hid_t image_id);
632 hid_t PyramidExist(hid_t image_id);
633 hid_t PyramidCalcSizes(int npixels, int nlines,
634  int *npyramids, int **xsizes, int **ysizes);
635 hid_t PyramidUpdate(hid_t image_id);
636 int DatetimeCompare(const char *time2, const char *time1, double *difference);
637 
638 int CheckRasterWriteableByID(hid_t raster_id);
639 
640 
641 
642 
643  //char *PathnameDir(const char *name);
644  //char *PathnameNodir(const char *name);
645  //char *PathnameJoin(const char *front, const char *back);
646 
647 
648 
649 
650 
651 int ImageFilterAverage( hid_t file_from, const char *image_from, int *channels_from,
652  int *filter_size, const char *mask, int nthreads, int memsize_gbytes,
653  hid_t file_mask, const char *image_mask, int channel_mask,
654  int *window_mask,
655  hid_t file_to, const char *image_to, int *channels_to);
656 
657 int ImageFilterBoxcarByID( hid_t in_raster_id,
658  int *filter_size, double *filter_coeffs,
659  const char *mask, int nthreads, int memsize_gbytes,
660  hid_t raster_mask_id,int *window_mask,
661  hid_t out_raster_id);
662 
663 
664 //int LocationCreate(hid_t file_id, const char *object_name,
665 // GeoLocationMetadata_t *location_hdr);
666 
667 //int LocationIO(hid_t file_id, const char *object_name, int func,
668 // GeoLocationMetadata_t *location_hdr);
669 
670 int LocationCopy(hid_t from_file_id, const char *from_object_name,
671  hid_t to_file_id, const char *to_object_name);
672 
673 int LocationReport(const char *filename, const char *object_name,
674  char **report_string);
675 
676 
677 
678 
679 
680 
681 
682 
683 // reading files with keys and values in ascii:
684 void set_keyval_comment(char comment_character);
685 int open_keyval(char *filename, char *mode);
686 int close_keyval(int filehandle);
687 int read_keyval_int(int fileh,char *location);
688 double read_keyval_dbl(int fileh,char *location);
689 char *read_keyval_str(int fileh,char *location);
690 int *read_keyval_intvec(int fileh,char *location, int *n);
691 double *read_keyval_dblvec(int fileh,char *location, int *n);
692 char **read_keyval_strvec(int fileh,char *location, int *n);
693 
694 /********************************************************************/
695 /* formatted_read.h 7-96 */
696 /* */
697 /* by Leland Pierce (lep@eecs.umich.edu) */
698 /* */
699 /* This is a set of subroutines for doing reading */
700 /* of any type of data from a binary string. */
701 /* */
702 /* Data types: ASCII: int, double, string BINARY: int, float */
703 /* scalars only. */
704 /* */
705 /* A pointer to each dynamically-allocated variable is */
706 /* returned. */
707 /* */
708 /* Usage: */
709 /* #include "formatted_read.h" */
710 /* */
711 /* link with formatted_read.o */
712 /* */
713 /* =============================================================== */
714 
715 /*-------------------------------------------*/
716 /* PUBLIC CONSTANTS: */
717 /*-------------------------------------------*/
718 
719 /* integer formats that are possible: */
720 #define TWOS_COMPLEMENT 1
721 #define SIGN_MAGNITUDE 2
722 
723 /* real formats that are possible: */
724 #define IEEE_754 1
725 #define VAX_F_FLOATING 2
726 #define IBM_360_370_E_FORMAT 3
727 
728 /* Possible machine names, for use in formattedReadInit */
729 #define SUN 1
730 #define INTEL_PC 2
731 #define VAX 3
732 #define IBM360 4
733 #define HP9000 5
734 #define APOLLO 6
735 #define SGI 7
736 #define DEC_UNIX 8
737 /* others? */
738 
739 
740 
741 /*-------------------------------------------*/
742 /* PUBLIC FUNCTIONS: */
743 /*-------------------------------------------*/
744 
745 void formattedReadInit(int machineName);
746 
747 void formattedReadRawInit(int intByteOrder[4], int intFormat,
748  int floatByteOrder[4], int floatFormat);
749 
750 void *formattedRead(unsigned char *string, char *format);
751 
752 //==============================================================
753 //=============end of formatted_read.h==========================
754 //==============================================================
755 //==============================================================
756 //==============================================================
757 
758 
759 /*-----------------------------------------------------------------*/
760 /* Reading URLs as files */
761 /*-----------------------------------------------------------------*/
762 #include <curl/curl.h>
763 enum fcurl_type_e {
764  CFTYPE_NONE=0,
765  CFTYPE_FILE=1,
766  CFTYPE_CURL=2
767 };
768 
769 struct fcurl_data
770 {
771  enum fcurl_type_e type; /* type of handle */
772  union {
773  CURL *curl;
774  FILE *file;
775  } handle; /* handle */
776 
777  char *buffer; /* buffer to store cached data*/
778  size_t buffer_len; /* currently allocated buffers length */
779  size_t buffer_pos; /* end of data in buffer*/
780  int still_running; /* Is background url fetch still in progress */
781 };
782 
783 typedef struct fcurl_data URL_FILE;
784 
785 URL_FILE *url_fopen (const char *url,const char *operation);
786 int url_fclose (URL_FILE *file);
787 int url_feof (URL_FILE *file);
788 size_t url_fread (void *ptr, size_t size, size_t nmemb, URL_FILE *file);
789 char * url_fgets (char *ptr, size_t size, URL_FILE *file);
790 void url_rewind (URL_FILE *file);
791 //==============================================================
792 //=============end of reading urls as files=====================
793 //==============================================================
794 
795 void convert_inertial_to_fixed(double *x, double *y, double *z,
796  double *vx, double *vy, double *vz, double gha);
797 double GreenwichMeanSiderealTimeDegrees(double julian_date);
798 double GreenwichApparentSiderealTimeDegrees(double julian_date);
799 
800 //==============================================================
801 // reading xml files...basic stuff
802 int open_xml(const char *filename, char *mode);
803 int close_xml(int filehandle);
804 int read_xml_int(int fileh,char *location);
805 double read_xml_dbl(int fileh,char *location);
806 char *read_xml_str(int fileh,char *location);
807 int *read_xml_intvec(int fileh,char *location, int *n);
808 double *read_xml_dblvec(int fileh,char *location, int *n);
809 char **read_xml_strvec(int fileh,char *location, int *n);
810 
811 //==============================================================
812 int polyfit(int npts, double *inx,double *iny, int ncoeffs, double *coeffs);
813 
814 //==============================================================
815 //for reading hdf5 files that aren't geoscipy files:
816 hid_t open_hdf5(const char *filename, char mode);
817 herr_t close_hdf5(hid_t filehandle);
818 int read_hdf5_int(hid_t file,char *location,char *name);
819 double read_hdf5_dbl(hid_t file,char *location,char *name);
820 char *read_hdf5_str(hid_t file,char *location,char *name);
821 double *read_hdf5_dblvec(hid_t file,char *location,char *name, int *n);
822 double *read_hdf5_dblmat(hid_t file,char *location,char *name, int *n, int *m);
823 void read_hdf5_dataset_dimensions(hid_t file,char *location,
824  int *ndims, int **dims);
825 int hdf5_dump(int argc, const char *argv[]);
826 
827 //==============================================================
828 void Geodetic2XYZ(double lat, double lon, double h,
829  double *x, double *y, double *z,
830  double major, double flattening);
831 void XYZ2Geodetic(double x, double y, double z,
832  double *lat, double *lon, double *h,
833  double major, double flattening);
834 //void Any2XYZ(double projx, double projy, double projheight,
835 // ProjInfo_t *projinfo,
836 // double *x, double *y, double *z);
837 //==============================================================
838 
839 //temporarily here (this is pure PCI.....)
840 typedef struct {
841  int pbx; /* No. of elements computed for BETA b(X) */
842  int pby; /* No. of elements computed for BETA b(Y) */
843  double rbx[21]; /* Actual current BETAS b(X) */
844  double rby[21]; /* Actual current BETAS b(Y) */
845  double rabx[3]; /* Actual current affine BETAS b(X) */
846  double raby[3]; /* Actual current affine BETAS b(Y) */
847  double covx[21][21]; /* covariance matrix for b(X) */
848  double covy[21][21]; /* covariance matrix for b(Y) */
849 } GEOInfo_t;
850 
851 
852 void GCPRegression2(GEOInfo_t *geo,
853  double *rix, double *riy,
854  double *rox, double *roy,
855  int ngcp, int *order, double *rmsx, double *rmsy );
856 
857 void GCPTransform(GEOInfo_t *geo, double rix, double riy,
858  double *roxhat, double *royhat);
859 
860 void GCPTransform2(GEOInfo_t *geo, double rix, double riy,
861  double *roxhat, double *royhat,
862  double *roxerr, double *royerr);
863 
864 //==============================================================
865 
866 double JulianDateOfYear(int year);
867 double DayOfYear(int year, int month, int day);
868 
869 int GetSpatialref_UTM_WGS84(int zone,char row, char *code,
870  char *wkt, char *proj4);
871 
872 
873 
874 
875 
876 int RasterDescriptorIO(hid_t image_id, const char *raster_name,
877  int func, char *descriptor);
878 
879 
880 
881 int RawHeaderGetSize(hid_t file_id, const char *object_name);
882 int RawHeaderIO(hid_t file_id, const char *object_name, int func,
883  void *hdr, int hdrlength);
884 int RawHeaderCreate(hid_t file_id, const char *object_name,
885  void *hdr, int hdrlength);
886 
887 
888 //==============================================================
889 
890 void DestroyStringList( char **list );
891 int CountStringList( char **list );
892 char **AddStringToList( char **target_list, char *new_string );
893 
894 //==============================================================
895 
896 
897 
898 
899 
900 
901 
902 #endif
903  //OLDSTUFF
904 
905 
906 
907 
908 
909 
910 
911 
912 
913 
914 
915 #ifdef __cplusplus
916 }
917 #endif
918 
919 #endif
int GS_ObjectIsMetadataIFileByID(hid_t dataset_id)
GS_ObjectIsMetadataIFileByID determines if the object-id refers to a metadata internal-file.
Definition: GS_ObjectIsMetadataIFileByID.c:64
int GS_FileIsOpen(const_bstring filename)
GS_FileIsOpen determines if a GeoSci datafile is already open in the current process.
Definition: GS_FileIsOpen.c:50
bstring GS_PathnameNodir(const_bstring name)
GS_PathnameNoDir strips the directory name from the pathname.
Definition: GS_Pathname.c:69
int GS_GroupIsWriteable(hid_t file_id, const_bstring group_name)
GS_GroupIsWriteable returns if the group is writeable or not.
Definition: GS_GroupIsWriteable.c:48
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...
Definition: GS_RasterCheckWindow.c:62
hid_t GS_DatasetClose(hid_t id)
GS_DatasetClose closes a dataset in a GeoSci datafile.
Definition: GS_DatasetClose.c:41
hid_t GS_RasterOpen(hid_t image_id, const_bstring raster_name)
GS_RasterOpen opens existing raster dataset.
Definition: GS_RasterOpen.c:65
int GS_ObjectIsVectorByID(hid_t id)
GS_ObjectIsVectorByID determines if the object-id refers to a vector.
Definition: GS_ObjectIsVectorByID.c:53
int GS_AbortedHistory(hid_t object_id, const_bstring history_line)
GS_AbortedHistory writes aborted message to history metadata.
Definition: GS_AbortedHistory.c:66
int GS_ObjectIsIFile(hid_t id, const_bstring name)
GS_ObjectIsIFile determines if the object is an internal file.
Definition: GS_ObjectIsIFile.c:49
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...
Definition: GS_ValidMetadataName.c:77
int GS_CheckUniqueName(hid_t file_id, const char *thename)
GS_CheckUniqueName check if name is unique.
Definition: GS_CheckUniqueName.c:36
char * GS_Dirname(const char *name)
Dirname returns the directory name for a UNIX pathname.
Definition: GS_Dirname.c:39
int GS_RasterTypeIsComplex(int datatype)
GS_RasterTypeIsComplex returns TRUE for complex types.
Definition: GS_RasterTypeIsComplex.c:60
int GS_RasterCheckWindowByID(hid_t image_id, int *window)
GS_RasterCheckWindowByID checks whether a requested window selection is within the bounds of a raster...
Definition: GS_RasterCheckWindowByID.c:81
int GS_FileCopy(bstring oldname, bstring newname)
GS_FileCopy copies a GeoSci datafile to a new file.
Definition: GS_FileCopy.c:54
hid_t GS_ImageOpen(hid_t file_id, const_bstring image_name)
GS_ImageOpen opens an existing image.
Definition: GS_ImageOpen.c:52
int GS_GroupRename(hid_t id, const_bstring oldname, const_bstring newname)
GS_GroupRename renames a group in a GeoSci datafile.
Definition: GS_GroupRename.c:45
int GS_GroupDelete(hid_t file_id, const_bstring group_name)
GS_GroupDelete deletes a group in a GeoSci datafile.
Definition: GS_GroupDelete.c:52
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 i...
Definition: GS_ImageCreateMetadata.c:83
hid_t GS_FileOpen(const_bstring dbname, const_bstring access)
GS_FileOpen opens a GeoSci datafile.
Definition: GS_FileOpen.c:58
int GS_ConvertFromHDFDatatype(hid_t datatype)
GS_ConvertFromHDFDatatype returns the GeoSci datatype for the given HDF datatype. ...
Definition: GS_ConvertFromHDFDatatype.c:72
hid_t GS_GroupCreate(hid_t file_id, const_bstring groupname)
GS_GroupCreate creates a new group in a GeoSci Datafile.
Definition: GS_GroupCreate.c:61
int GS_DatasetIsWriteableByID(hid_t dataset_id)
GS_DatasetIsWriteableByID returns if dataset is writeable or not.
Definition: GS_DatasetIsWriteableByID.c:42
int GS_FileCloseAllObjects(hid_t file_id)
GS_FileCloseAllObjects closes all open objects in a file.
Definition: GS_FileCloseAllObjects.c:45
int GS_GroupSetType(hid_t group_id, int typecode)
GS_GroupSetType sets the type of a group in a GeoSci datafile.
Definition: GS_GroupSetType.c:53
bstring GS_PathnameJoin(const_bstring front, const_bstring back)
GS_PathnameJoin joins 2 pieces of a pathname.
Definition: GS_Pathname.c:373
int GS_DatatypeIsComplex(int datatype)
GS_DatatypeIsComplex returns TRUE if a complex datatype.
Definition: GS_DatatypeIsComplex.c:70
int GS_GroupCloseAllObjects(hid_t id)
GS_GroupCloseAllObjects closes all open objects in a group.
Definition: GS_GroupCloseAllObjects.c:46
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.
Definition: GS_DatasetWrite.c:101
int GS_ObjectIsRaster(hid_t id, const_bstring name)
GS_ObjectIsRaster determines if the object is a raster image.
Definition: GS_ObjectIsRaster.c:60
bstring GS_GetIDName(hid_t id)
GetIDName returns the name of the given handle.
Definition: GS_GetIDName.c:39
int GS_DatasetGetBounds(hid_t dataset_id, double *xmin, double *xmax, double *ymin, double *ymax)
GS_DatasetGetBounds returns the rectangular bounding coordinates.
Definition: GS_DatasetGetBounds.c:55
void GS_init()
GS_init initialize some global strings.
Definition: GS_init.c:39
int GS_GroupIsWriteableByID(hid_t group_id)
GS_GroupIsWriteableByID returns if the group is writeable or not.
Definition: GS_GroupIsWriteableByID.c:45
int GS_DatasetDelete(hid_t file_id, const_bstring dataset_name)
GS_DatasetDelete deletes a a dataset in a GeoSci datafile.
Definition: GS_DatasetDelete.c:50
int GS_DatasetGetDimensionsByID(hid_t id, long int **size)
GS_DatasetGetDimensionsByID returns the current dimensions for the Dataset.
Definition: GS_DatasetGetDimensionsByID.c:62
int GS_ObjectIsImageByID(hid_t id)
GS_ObjectIsImageByID determines if the object is an image.
Definition: GS_ObjectIsImageByID.c:55
int GS_FileDelete(const_bstring filename)
GS_FileDelete deletes an existing GeoSci datafile.
Definition: GS_FileDelete.c:52
int GS_GroupGetType(hid_t group_id)
GS_GroupGetType returns the type of a group in a GeoSci datafile.
Definition: GS_GroupGetType.c:53
hid_t GS_GroupOpen(hid_t source, const_bstring name)
GS_GroupOpen opens an existing group in a GeoSci datafile.
Definition: GS_GroupOpen.c:47
bstring GS_GroupGetDatum(hid_t group_id)
GS_GroupGetDatum returns a description of the relevant datum if one exists.
Definition: GS_GroupGetDatum.c:52
herr_t GS_SetCacheSize(hid_t file_id, size_t cache_size)
GS_SetCacheSize sets the metadata cache size for a GeoSci datafile.
Definition: GS_SetCacheSize.c:50
hid_t GS_GetValidFileID(hid_t id)
GS_GetValidFileID returns a valid FileID that contains the object.
Definition: GS_GetValidFileID.c:66
int GS_ObjectIsVector(hid_t id, const_bstring name)
GS_ObjectIsVector determines if the object is a vector.
Definition: GS_ObjectIsVector.c:49
int GS_GroupClose(hid_t id)
GS_GroupClose closes a group in a GeoSci Datafile.
Definition: GS_GroupClose.c:50
int GS_CheckWindowInside(int *window_in, const int *window_enclosing)
CheckWindowInside checks if one Window is contained by another.
Definition: GS_RasterCheckWindow.c:176
int GS_ObjectIsDatasetByID(hid_t id)
GS_ObjectIsDatasetByID determines if an object-id refers to a dataset.
Definition: GS_ObjectIsDatasetByID.c:55
int GS_FileReport(const_bstring filename, bstring report_string)
GS_FileReport summarizes the contents of a GeoSci datafile.
Definition: GS_FileReport.c:64
hid_t GS_FileCreate(const_bstring filename)
GS_FileCreate creates an empty GeoSci datafile.
Definition: GS_FileCreate.c:87
int GS_FileRename(const_bstring oldname, const_bstring newname)
GS_FileRename renames an existing GeoSci datafile.
Definition: GS_FileRename.c:55
int GS_DatasetGetDimensions(hid_t id, const_bstring name, long int **size)
GS_DatasetGetDimensions returns the current dimensions for the Dataset.
Definition: GS_DatasetGetDimensions.c:68
int GS_DatasetGetDatatypeByID(hid_t id)
GS_DatasetGetDatatypeByID returns the GeoSci datatype for the data in the Dataset.
Definition: GS_DatasetGetDatatypeByID.c:65
int GS_FileCreateMetadata(hid_t file_id, const_bstring descriptor)
GS_FileCreateMetadata Creates metadata in a GeoSci datafile.
Definition: GS_FileCreateMetadata.c:82
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.
Definition: GS_SetStringAttribute.c:67
int GS_ImageDelete(hid_t file_id, const_bstring image_name)
GS_ImageDelete deletes an existing image.
Definition: GS_ImageDelete.c:55
int GS_RasterDelete(hid_t image_id, const_bstring raster_name)
GS_RasterDelete deletes an existing raster.
Definition: GS_RasterDelete.c:64
int GS_RasterTypeIsInteger(int datatype)
GS_RasterTypeIsInteger returns TRUE for integer types.
Definition: GS_RasterTypeIsInteger.c:63
hid_t GS_DatasetGetParent(hid_t id)
GS_DatasetGetParent returns the parent object-id for a Dataset.
Definition: GS_DatasetGetParent.c:44
int GS_ObjectIsMetadataIFile(hid_t id, const_bstring name)
GS_ObjectIsMetadataIFile determines if the object refers to a metadata internal-file.
Definition: GS_ObjectIsMetadataIFile.c:69
int GS_VectorCreateMetadata(hid_t file_id, const_bstring vector_name, const_bstring descriptor)
GS_VectorCreateMetadata creates vector metadata.
Definition: GS_VectorCreateMetadata.c:84
bstring GS_GetRasterTypeAsString(int datatype)
GS_GetRasterTypeAsString returns a string representing the datatype.
Definition: GS_GetRasterTypeAsString.c:55
int GS_CheckInternalName(hid_t object_id, const_bstring thename)
GS_CheckInternalName checks for existence of an object name in the file.
Definition: GS_CheckInternalName.c:54
int GS_CheckFileExistence(const_bstring filename)
GS_CheckFileExistence checks for the existence of a specified file.
Definition: GS_CheckFileExistence.c:47
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.
Definition: GS_GroupCopy.c:53
int GS_RasterClose(hid_t raster_id)
GS_RasterClose closes an open raster dataset.
Definition: GS_RasterClose.c:35
hid_t GS_ConvertToHDFDatatype(int datatype)
GS_ConvertToHDFDatatype returns the HDF datatype for the given GeoSci datatype.
Definition: GS_ConvertToHDFDatatype.c:70
bstring GS_DatasetGetProjection(hid_t dataset_id)
GS_DatasetGetProjection returns a description of the relevant projection.
Definition: GS_DatasetGetProjection.c:54
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...
Definition: GS_RasterCreateMetadata.c:129
int GS_GroupGetBounds(hid_t group_id, double *xmin, double *xmax, double *ymin, double *ymax)
GS_GroupGetBounds returns the rectangular bounding coordinates.
Definition: GS_GroupGetBounds.c:55
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.
Definition: GS_GetStringAttribute.c:61
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.
Definition: GS_RasterPixelSize.c:64
bstring GS_PathnameGetHDFDir(const_bstring name)
GS_PathnameGetHDFDir returns the directory name of the pathname.
Definition: GS_Pathname.c:289
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.
Definition: GS_DataConversion.c:96
int GS_SplitHistory(const_bstring history_string, bstring front, bstring back)
GS_SplitHistory splits history string into front and back.
Definition: GS_SplitHistory.c:89
bstring GS_GSObjectTypeAsString(int objtype)
GS_GSObjectTypeAsString returns printable version of the object type.
Definition: GS_GSObjectTypeAsString.c:96
int GS_UpdateMetadata(hid_t object_id, const_bstring name, bstring value)
GS_UpdateMetadata update a metadata item for the given object.
Definition: GS_UpdateMetadata.c:64
int GS_AppendHistory(hid_t object_id, const_bstring history_line)
GS_AppendHistory appends to the history metadata.
Definition: GS_AppendHistory.c:65
bstring GS_PathnameGetDir(const_bstring name)
GS_PathnameGetDir returns the directory name of the pathname.
Definition: GS_Pathname.c:172
int GS_ObjectIsDataset(hid_t id, const_bstring name)
GS_ObjectIsDataset determines if an object is a dataset.
Definition: GS_ObjectIsDataset.c:81
int GS_FileFlush(hid_t object_id)
GS_FileFlush forces the datafile to be updated.
Definition: GS_FileFlush.c:51
int GS_ObjectIsMetadataDataset(hid_t id, const_bstring name)
ObjectIsMetadataDataset determines if the object is a metadata dataset.
Definition: GS_ObjectIsMetadataDataset.c:44
int GS_AppendMetadata(hid_t object_id, const_bstring metadata_name, const_bstring value)
GS_AppendMetadata appends the given string to the metadata item.
Definition: GS_AppendMetadata.c:72
int GS_ObjectUnlock(hid_t id)
GS_ObjectUnlock changes and object to have read-write status.
Definition: GS_ObjectUnlock.c:57
int GS_FileClose(hid_t file_id)
GS_FileClose closes a GeoSci datafile.
Definition: GS_FileClose.c:50
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.
Definition: GS_RasterCreate.c:88
int GS_ObjectIsGroup(hid_t id, const_bstring name)
GS_ObjectIsGroup determines if a named object is a group.
Definition: GS_ObjectIsGroup.c:70
int GS_ValidID(hid_t id)
GS_ValidID returns whether the given object-id is a valid identifier.
Definition: GS_ValidID.c:45
int GS_ObjectIsRasterByID(hid_t dataset_id)
GS_ObjectIsRasterByID determines if the object-id refers to a raster image.
Definition: GS_ObjectIsRasterByID.c:53
int GS_DatasetRename(hid_t group_id, const_bstring oldname, const_bstring newname)
GS_DatasetRename renames a dataset in a GeoSci datafile.
Definition: GS_DatasetRename.c:50
int GS_FileCommitDatatypes(hid_t file_id)
GS_FileCommitDatatypes commits the complex raster datatypes to a file.
Definition: GS_FileCommitDatatypes.c:51
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.
Definition: GS_DatasetCreate.c:84
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.
Definition: GS_ImageCreate.c:68
hid_t GS_CreateAccessPlist(void)
GS_CreateAccessPlist creates an HDF5 access parameter list.
Definition: GS_CreateAccessPlist.c:150
int GS_DatasetIsWriteable(hid_t file_id, const_bstring dataset_name)
GS_DatasetIsWriteable returns if dataset is writeable or not.
Definition: GS_DatasetIsWriteable.c:47
int GS_FileIsWriteable(hid_t id)
GS_FileIsWriteable returns if file is writeable or not.
Definition: GS_FileIsWriteable.c:56
int GS_ObjectGetGSChildren(hid_t object_id, int *nobjs, bstring **objnames, int **objtypes)
GS_ObjectGetGSChildren returns list of GeoSci children objects.
Definition: GS_ObjectGetGSChildren.c:97
int GS_ObjectIsIFileByID(hid_t dataset_id)
GS_ObjectIsIFileByID determines if the objectID is an internal file.
Definition: GS_ObjectIsIFile.c:182
bstring GS_DatasetGetDatum(hid_t dataset_id)
GS_DatasetGetDatum returns a description of the relevant datum if one exists.
Definition: GS_DatasetGetDatum.c:52
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.
Definition: GS_DatasetCopy.c:53
bstring GS_GroupGetProjection(hid_t group_id)
GS_GroupGetProjection returns a description of the relevant projection.
Definition: GS_GroupGetProjection.c:54
Definition: bstrlib.h:200
int GS_ImageClose(hid_t image_id)
GS_ImageClose closes an Open Image}.
Definition: GS_ImageClose.c:43
int GS_ObjectIsFile(hid_t id)
GS_ObjectIsFile determines if an object-id refers to a file.
Definition: GS_ObjectIsFile.c:51
int GS_HDFDatatypeClose(hid_t id)
GS_HDFDatatypeClose closes an HDF datatype.
Definition: GS_HDFDatatypeClose.c:51
int GS_ObjectIsGroupByID(hid_t id)
GS_ObjectIsGroupByID determines if an object-id refers to a group.
Definition: GS_ObjectIsGroupByID.c:76
int GS_DatasetSetType(hid_t dataset_id, int typecode)
GS_DatasetSetType set the type of a dataset in a GeoSci file.
Definition: GS_DatasetSetType.c:43
int GS_DatasetGetType(hid_t dataset_id)
GS_DatasetGetType returns the type of a GeoSci Dataset.
Definition: GS_DatasetGetType.c:44
int GS_ObjectLock(hid_t id)
GS_ObjectLock makes an object read-only.
Definition: GS_ObjectLock.c:62
int GS_ObjectIsMetadataDatasetByID(hid_t dataset_id)
ObjectIsMetadataDatasetByID determines if the objectid is a metadata dataset.
Definition: GS_ObjectIsMetadataDataset.c:119
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.
Definition: GS_DatasetRead.c:106
bstring GS_DatasetReport(hid_t dataset_id)
GS_DatasetReport returns a brief description of the dataset.
Definition: GS_DatasetReport.c:69
int GS_ObjectGetH5Children(hid_t object_id, int *nobjs, bstring **objnames, int **objtypes)
GS_ObjectGetH5Children returns list of all children objects.
Definition: GS_ObjectGetH5Children.c:107
int GS_RasterSizeInfo(hid_t raster_id, int *npixels, int *nlines)
GS_RasterSizeInfo returns the number of pixels and lines in a raster.
Definition: GS_RasterSizeInfo.c:77
int GS_ObjectIsImage(hid_t file_id, const_bstring image_name)
GS_ObjectIsImage determines if the object is an image.
Definition: GS_ObjectIsImage.c:51
bstring GS_GroupReport(hid_t group_id)
GS_GroupReport returns a one-line brief description of the group.
Definition: GS_GroupReport.c:64
int GS_DatasetGetDatatype(hid_t id, const_bstring name)
GS_DatasetGetDatatype returns the GeoSci datatype for data in the Dataset.
Definition: GS_DatasetGetDatatype.c:69
bstring GS_DatatypeAsString(int datatype)
GS_DatatypeAsString return a string representing the datatype.
Definition: GS_DatatypeAsString.c:70
bstring GS_GetFilename(hid_t id)
GetFilename returns the filename associated with an ID.
Definition: GS_GetFilename.c:43
bstring GS_H5ObjectTypeAsString(int objtype)
GS_H5ObjectTypeAsString returns a printable version of HDF5 object type.
Definition: GS_H5ObjectTypeAsString.c:75
hid_t GS_DatasetOpen(hid_t source, const_bstring name)
GS_DatasetOpen opens a dataset in a GeoSci datafile.
Definition: GS_DatasetOpen.c:53