core
vil
file_formats
vil_geotiff_header.h
Go to the documentation of this file.
1
// This is core/vil/file_formats/vil_geotiff_header.h
2
#ifndef vil_geotiff_header_h_
3
#define vil_geotiff_header_h_
4
//:
5
// \file
6
// \author Gamze Tunali
7
// \date Jan 31, 2007
8
// \brief A header structure for geotiff files
9
//
10
// This class is responsible for extracting (putting) information
11
// from (into) the geotiff header that is required to specify a vil_image_resource
12
// There are bool flags that indicate that the item has been successfully
13
// read (written) to the open geotiff file.
14
//
15
// \verbatim
16
// Modifications
17
// <none>
18
// \endverbatim
19
20
#include <vector>
21
#ifdef _MSC_VER
22
# include <vcl_msvc_warnings.h>
23
#endif
24
#include <tiffio.h>
25
#include <geotiffio.h>
26
27
class
vil_geotiff_header
28
{
29
public
:
30
31
typedef
enum
{
UNDEF
=-1,
NORTH
=0,
SOUTH
=1}
GTIF_HEMISPH
;
32
vil_geotiff_header
(TIFF* tif);
33
34
// destructor frees up gtif
35
virtual
~vil_geotiff_header
() { GTIFFree(
gtif_
); }
36
37
int
gtif_number_of_keys
()
const
{
return
number_of_geokeys_
; }
38
39
bool
gtif_tiepoints
(std::vector<std::vector<double> > &tiepoints);
40
41
bool
gtif_pixelscale
(
double
&scale_x,
double
&scale_y,
double
&scale_z);
42
43
//:returns the matrix in the argument
44
bool
gtif_trans_matrix
(
double
* &trans_matrix);
45
46
//: returns the Zone and the Hemisphere (0 for N, 1 for S);
47
bool
PCS_WGS84_UTM_zone
(
int
&zone,
GTIF_HEMISPH
&hemisph);
48
49
//: returns the Zone and the Hemisphere (0 for N, 1 for S);
50
bool
PCS_NAD83_UTM_zone
(
int
&zone,
GTIF_HEMISPH
&hemisph);
51
52
//: returns true if in geographic coords, linear units are in meters and angular units are in degrees
53
bool
GCS_WGS84_MET_DEG
();
54
55
//: <key> : key id
56
// <value>: a single value or an array of values
57
// <size>: the size of individual key values
58
// <length> : the number of values in the value array
59
// <type>: the type of the key
60
bool
get_key_value
(geokey_t key,
void
** value,
61
int
& size,
int
& length, tagtype_t& type);
62
63
void
print_gtif
(){
if
(
gtif_
) GTIFPrint(
gtif_
,
nullptr
,
nullptr
); }
64
65
private
:
66
67
TIFF*
tif_
;
68
GTIF*
gtif_
;
69
70
// the current version is 1, changes only Tag's key structure is changed
71
unsigned
short
key_directory_version_
;
72
73
// the revision number is key_revision.minor_revision
74
unsigned
short
key_revision_
;
75
unsigned
short
minor_revision_
;
76
77
// the number of keys defined in the rest of the tag
78
int
number_of_geokeys_
;
79
80
modeltype_t
model_type_
;
81
rastertype_t
raster_type_
;
82
geographic_t
geographic_type_
;
83
geounits_t
geounits_
;
84
85
bool
gtif_modeltype
(modeltype_t& type);
86
bool
gtif_rastertype
(rastertype_t&);
87
bool
geounits
(geounits_t&);
88
bool
geographic_type
(geographic_t&);
89
};
90
91
#endif //vil_geotiff_header_h_
vil_geotiff_header::tif_
TIFF * tif_
Definition:
vil_geotiff_header.h:67
vil_geotiff_header::key_revision_
unsigned short key_revision_
Definition:
vil_geotiff_header.h:74
vil_geotiff_header::key_directory_version_
unsigned short key_directory_version_
Definition:
vil_geotiff_header.h:71
vil_geotiff_header::NORTH
Definition:
vil_geotiff_header.h:31
vil_geotiff_header::geographic_type
bool geographic_type(geographic_t &)
vil_geotiff_header::model_type_
modeltype_t model_type_
Definition:
vil_geotiff_header.h:80
vil_geotiff_header::gtif_tiepoints
bool gtif_tiepoints(std::vector< std::vector< double > > &tiepoints)
Definition:
vil_geotiff_header.cxx:31
vil_geotiff_header::gtif_trans_matrix
bool gtif_trans_matrix(double *&trans_matrix)
returns the matrix in the argument.
Definition:
vil_geotiff_header.cxx:72
vil_geotiff_header::UNDEF
Definition:
vil_geotiff_header.h:31
vil_geotiff_header::minor_revision_
unsigned short minor_revision_
Definition:
vil_geotiff_header.h:75
vil_geotiff_header::get_key_value
bool get_key_value(geokey_t key, void **value, int &size, int &length, tagtype_t &type)
<key> : key id.
Definition:
vil_geotiff_header.cxx:251
vil_geotiff_header::vil_geotiff_header
vil_geotiff_header(TIFF *tif)
Definition:
vil_geotiff_header.cxx:14
vil_geotiff_header::geographic_type_
geographic_t geographic_type_
Definition:
vil_geotiff_header.h:82
vil_geotiff_header::gtif_number_of_keys
int gtif_number_of_keys() const
Definition:
vil_geotiff_header.h:37
vil_geotiff_header::raster_type_
rastertype_t raster_type_
Definition:
vil_geotiff_header.h:81
vil_geotiff_header::gtif_pixelscale
bool gtif_pixelscale(double &scale_x, double &scale_y, double &scale_z)
Definition:
vil_geotiff_header.cxx:57
vil_geotiff_header::PCS_WGS84_UTM_zone
bool PCS_WGS84_UTM_zone(int &zone, GTIF_HEMISPH &hemisph)
returns the Zone and the Hemisphere (0 for N, 1 for S);.
Definition:
vil_geotiff_header.cxx:122
vil_geotiff_header::GCS_WGS84_MET_DEG
bool GCS_WGS84_MET_DEG()
returns true if in geographic coords, linear units are in meters and angular units are in degrees.
Definition:
vil_geotiff_header.cxx:171
vil_geotiff_header::GTIF_HEMISPH
GTIF_HEMISPH
Definition:
vil_geotiff_header.h:31
vil_geotiff_header::geounits
bool geounits(geounits_t &)
Definition:
vil_geotiff_header.cxx:109
vil_geotiff_header::SOUTH
Definition:
vil_geotiff_header.h:31
vil_geotiff_header::gtif_modeltype
bool gtif_modeltype(modeltype_t &type)
Definition:
vil_geotiff_header.cxx:83
vil_geotiff_header::gtif_rastertype
bool gtif_rastertype(rastertype_t &)
Definition:
vil_geotiff_header.cxx:96
vil_geotiff_header::geounits_
geounits_t geounits_
Definition:
vil_geotiff_header.h:83
vil_geotiff_header::~vil_geotiff_header
virtual ~vil_geotiff_header()
Definition:
vil_geotiff_header.h:35
vil_geotiff_header::number_of_geokeys_
int number_of_geokeys_
Definition:
vil_geotiff_header.h:78
vil_geotiff_header::gtif_
GTIF * gtif_
Definition:
vil_geotiff_header.h:68
vil_geotiff_header::print_gtif
void print_gtif()
Definition:
vil_geotiff_header.h:63
vil_geotiff_header::PCS_NAD83_UTM_zone
bool PCS_NAD83_UTM_zone(int &zone, GTIF_HEMISPH &hemisph)
returns the Zone and the Hemisphere (0 for N, 1 for S);.
Definition:
vil_geotiff_header.cxx:215
vil_geotiff_header
Definition:
vil_geotiff_header.h:27
Generated by
1.8.15