File: hdf4dataset.h

package info (click to toggle)
gdal 1.10.1%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (110 lines) | stat: -rw-r--r-- 4,199 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/******************************************************************************
 * $Id: hdf4dataset.h 18945 2010-02-27 20:39:31Z rouault $
 *
 * Project:  Hierarchical Data Format Release 4 (HDF4)
 * Purpose:  Header file for HDF4 datasets reader.
 * Author:   Andrey Kiselev, dron@ak4719.spb.edu
 *
 ******************************************************************************
 * Copyright (c) 2002, Andrey Kiselev <dron@ak4719.spb.edu>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 ****************************************************************************/

#ifndef _HDF4DATASET_H_INCLUDED_
#define _HDF4DATASET_H_INCLUDED_

#include "cpl_list.h"
#include "gdal_pam.h"

typedef enum			// Types of dataset:
{
    HDF4_SDS,			// Scientific Dataset
    HDF4_GR,			// General Raster Image
    HDF4_EOS,                   // HDF EOS
    HDF4_UNKNOWN
} HDF4DatasetType;

typedef enum			// Types of data products:
{
    H4ST_GDAL,		        // HDF written by GDAL
    H4ST_EOS_GRID,              // HDF-EOS Grid
    H4ST_EOS_SWATH,             // HDF-EOS Swath
    H4ST_EOS_SWATH_GEOL,        // HDF-EOS Swath Geolocation Array
    H4ST_SEAWIFS_L1A,		// SeaWiFS Level-1A Data
    H4ST_SEAWIFS_L2,		// SeaWiFS Level-2 Data
    H4ST_SEAWIFS_L3,		// SeaWiFS Level-3 Standard Mapped Image
    H4ST_HYPERION_L1,           // Hyperion L1 Data Product
    H4ST_UNKNOWN
} HDF4SubdatasetType;

/************************************************************************/
/* ==================================================================== */
/*				HDF4Dataset				*/
/* ==================================================================== */
/************************************************************************/

class HDF4Dataset : public GDALPamDataset
{

  private:

    int         bIsHDFEOS;

    static char **HDF4EOSTokenizeAttrs( const char *pszString );
    static char **HDF4EOSGetObject( char **papszAttrList, char **ppszAttrName,
                                    char **ppszAttrValue );
     
  protected:

    FILE	*fp;
    int32	hGR, hSD;
    int32	nImages;
    HDF4SubdatasetType iSubdatasetType;
    const char	*pszSubdatasetType;

    char	**papszGlobalMetadata;
    char	**papszSubDatasets;

    CPLErr              ReadGlobalAttributes( int32 );

    static GDALDataType GetDataType( int32 ) ;
    static const char   *GetDataTypeName( int32 );
    static int          GetDataTypeSize( int32 );
    static double       AnyTypeToDouble( int32, void * );
    static char         **TranslateHDF4Attributes( int32, int32, char *,
                                                   int32, int32, char ** );
    static char         **TranslateHDF4EOSAttributes( int32, int32, int32,
                                                      char ** );

  public:
                HDF4Dataset();
		~HDF4Dataset();
    
    virtual char        **GetMetadata( const char * pszDomain = "" );
    static GDALDataset  *Open( GDALOpenInfo * );
    static int          Identify( GDALOpenInfo * );
};

char *SPrintArray( GDALDataType eDataType, const void *paDataArray,
                   int nValues, const char *pszDelimiter );


#endif /* _HDF4DATASET_H_INCLUDED_ */