HiRISE
 PDS_JP2

PDS_Projection_Data.hh
Go to the documentation of this file.
1/* PDS_Projection_Data
2
3HiROC CVS ID: PDS_Projection_Data.hh,v 1.13 2020/05/22 20:59:29 guym Exp
4
5Copyright (C) 2007 Arizona Board of Regents on behalf of the
6Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
7the University of Arizona.
8
9This library is free software; you can redistribute it and/or modify it
10under the terms of the GNU Lesser General Public License, version 2.1,
11as published by the Free Software Foundation.
12
13This library is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License
19along with this library; if not, write to the Free Software Foundation,
20Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21
22*******************************************************************************/
23
24#ifndef _PDS_Projection_Data_
25#define _PDS_Projection_Data_
26
27#include "PDS_Data.hh"
28
29#include "JP2_Box.hh"
30#include "Dimensions.hh"
31
32// GDAL/OGR
33#include <ogr_spatialref.h>
34#include <gdal.h>
35
36
37namespace UA
38{
39namespace HiRISE
40{
41
97: public PDS_Data
98{
99public:
100/*==============================================================================
101 Constants:
102*/
104static const char* const
106
108static const char
111static const char
114static const char
117static const char
120static const char
125static const char
130static const char
133static const char
136static const char
139static const char
142static const char
145static const char
148static const char
151static const char
154static const char
157static const char
160static const char
163static const char
166static const char
169static const char
172static const char
175static const char
177static const char
179static const char
181
211
276
277static const Projection_Definition
279
284static const double
286
288static const unsigned char
290
291/*==============================================================================
292 Constructors:
293*/
300
311PDS_Projection_Data (const PDS_Data& PDS_data);
312
323PDS_Projection_Data (const std::string& pathname);
324
329virtual ~PDS_Projection_Data ();
330
331/*==============================================================================
332 Accessors
333*/
355virtual PDS_Data& parameters (const std::string& pathname);
356
372
489const double* geo_transform () const
490 {return Geo_Transform;}
491
497OGRSpatialReference* spatial_reference () const
498 {return Spatial_Reference ? Spatial_Reference->Clone () : NULL;}
499
513
521
523 definitions} and use the first entry in the Aliases array:
524
525<pre>
526 string
527 formal_projection_name;
528 if (projection_type () != UNKNOWN_PROJECTION)
529 formal_projection_name =
530 Projection_Definitions[projection_type ()].Aliases[0];
531</pre>
532
533 @return A string having the formal name of the applicable projection.
534 If a projection could not be {@link
535 initialize_spatial_reference() initialized} this will be an empty
536 string.
537*/
538std::string projection_name () const
539 {return Projection_Name;}
540
541/*==============================================================================
542 Manipulators
543*/
610
721
722/*==============================================================================
723 JP2 Boxes
724*/
743JP2_Box* JP2_GeoTIFF () const;
744
806 (unsigned int image_width = 0, unsigned int image_height = 0) const;
807
808/*==============================================================================
809 Helpers
810*/
825static bool named_in_list (std::string name, const char* const* aliases);
826
839static Projection_Type projection_type (const std::string& projection_name);
840
841/*==============================================================================
842 Data Members:
843*/
844protected:
845
850std::string
852
859
864OGRSpatialReference
866
871double
873
874}; // End class PDS_Projection_Data
875
876} // namespace HiRISE
877} // namespace UA
878#endif
Projection_Type
Projection types.
Definition PDS_Projection_Data.hh:184
PDS_Projection_Data()
Construct a default identity projection.
Definition PDS_Projection_Data.cc:536
A JP2_Box contains JP2 file format box data.
Definition JP2_Box.hh:40
PDS_Data()
Construct PDS_Data with no parameters.
Definition PDS_Data.cc:98
The PDS_Projection_Data provides geographic projection capabilities between image and real world coor...
Definition PDS_Projection_Data.hh:98
static const char * GDAL_NODATA_PARAMETER_NAME
Definition PDS_Projection_Data.hh:180
static const char * IMAGE_WIDTH_PARAMETER_NAME
Name of the parameter specifying the number of pixels per image line.
Definition PDS_Projection_Data.hh:137
static const char * MINIMUM_LONGITUDE_PARAMETER_NAME
Name of the parameter specifying the image minimum longitude.
Definition PDS_Projection_Data.hh:170
static const char * CENTER_LATITUDE_PARAMETER_NAME
Name of the parameter specifying the projection center latitude.
Definition PDS_Projection_Data.hh:161
static const char * MAXIMUM_LONGITUDE_PARAMETER_NAME
Name of the parameter specifying the image maximum longitude.
Definition PDS_Projection_Data.hh:173
std::string Projection_Name
The projection name specified in the PDS label.
Definition PDS_Projection_Data.hh:851
static const unsigned char GEO_TIFF_UUID[16]
UUID for the GeoTIFF JP2_Box.
Definition PDS_Projection_Data.hh:289
static const char * MISSING_CONSTANT_PARAMETER_NAME
Definition PDS_Projection_Data.hh:178
static const char * PIXELS_PER_DEGREE_PARAMETER_NAME
Name of the parameter specifying the number of pixels per world degree.
Definition PDS_Projection_Data.hh:140
virtual PDS_Data & parameters(const std::string &pathname)
Set the PDS parameters from a source file.
Definition PDS_Projection_Data.cc:586
static const char * MAXIMUM_LATITUDE_PARAMETER_NAME
Name of the parameter specifying the image maximum latitude.
Definition PDS_Projection_Data.hh:167
OGRSpatialReference * Spatial_Reference
The spatial reference object.
Definition PDS_Projection_Data.hh:865
static const char * PIXEL_SIZE_PARAMETER_NAME
Name of the parameter specifying the real world size of a pixel.
Definition PDS_Projection_Data.hh:143
static const char * MINIMUM_LATITUDE_PARAMETER_NAME
Name of the parameter specifying the image minimum latitude.
Definition PDS_Projection_Data.hh:164
static const char * IMAGE_HEIGHT_PARAMETER_NAME
Name of the parameter specifying the number of image lines.
Definition PDS_Projection_Data.hh:134
static const char * CENTER_LONGITUDE_PARAMETER_NAME
Name of the parameter specifying the projection center longitude.
Definition PDS_Projection_Data.hh:158
Projection_Type projection_type() const
Get the projection type.
Definition PDS_Projection_Data.hh:511
PDS_Projection_Data & initialize_spatial_reference()
Initialize the spatial reference information of a new OGRSpatialReference object.
Definition PDS_Projection_Data.cc:782
OGRSpatialReference * spatial_reference() const
Get the OGRSpatialReference.
Definition PDS_Projection_Data.hh:497
static const char * PROJECTION_TYPE_PARAMETER_NAME
Name of the parameter specifying the type of projection.
Definition PDS_Projection_Data.hh:115
Projection_Type
Projection types.
Definition PDS_Projection_Data.hh:184
@ TRANSVERSE_MERCATOR
Definition PDS_Projection_Data.hh:206
@ GNOMONIC
Definition PDS_Projection_Data.hh:197
@ UNKNOWN_PROJECTION
Definition PDS_Projection_Data.hh:185
@ EQUIRECTANGULAR
Definition PDS_Projection_Data.hh:189
@ VANDERGRINTEN
Definition PDS_Projection_Data.hh:207
@ ALBERS
Definition PDS_Projection_Data.hh:194
@ LAMBERT_AZIMUTHAL_EQUAL_AREA
Definition PDS_Projection_Data.hh:198
@ SINUSOIDAL
Definition PDS_Projection_Data.hh:204
@ OBLIQUE_CYLINDRICAL
Definition PDS_Projection_Data.hh:202
@ STEREOGRAPHIC
Definition PDS_Projection_Data.hh:205
@ CYLINDRICAL_EQUAL_AREA
Definition PDS_Projection_Data.hh:196
@ POLAR_STEREOGRAPHIC
Definition PDS_Projection_Data.hh:190
@ BONNE
Definition PDS_Projection_Data.hh:195
@ MOLLWEIDE
Definition PDS_Projection_Data.hh:201
@ MERCATOR
Definition PDS_Projection_Data.hh:200
@ TOTAL_PROJECTION_TYPES
Definition PDS_Projection_Data.hh:209
@ ORTHOGRAPHIC
Definition PDS_Projection_Data.hh:203
@ LAMBERT_CONFORMAL_CONIC
Definition PDS_Projection_Data.hh:199
static const char * PLANET_PARAMETER_NAME
Name of the parameter providing the planet name.
Definition PDS_Projection_Data.hh:109
static const char * SEMI_MINOR_RADIUS_PARAMETER_NAME
Name of the parameter specifying the planet's semi-minor axis radius.
Definition PDS_Projection_Data.hh:149
PDS_Projection_Data & initialize_geo_transform()
Initialized the geo-transform array values from the PDS parameter values.
Definition PDS_Projection_Data.cc:619
Projection_Type Projection_Type_Code
The projection type matching the projection name.
Definition PDS_Projection_Data.hh:858
static const char * IMAGE_MAP_PROJECTION_GROUP_NAME
Name of the parameter group containing projection parameters.
Definition PDS_Projection_Data.hh:112
static const char * LATITUDE_TYPE_PARAMETER_NAME
Name of the parameter specifying the type of coordinate system.
Definition PDS_Projection_Data.hh:121
static const char * PROJECTION_ROTATION_PARAMETER_NAME
Name of the parameter specifying the projection rotation.
Definition PDS_Projection_Data.hh:176
JP2_Box * JP2_GML(unsigned int image_width=0, unsigned int image_height=0) const
Get a JP2_Box with GML data content.
Definition PDS_Projection_Data.cc:1317
static const char * COORDINATE_SYSTEM_PARAMETER_NAME
Name of the parameter specifying the type of coordinate system.
Definition PDS_Projection_Data.hh:118
static const char * VERTICAL_OFFSET_PARAMETER_NAME
Name of the parameter specifying the vertical offset of the projection origin from the image origin.
Definition PDS_Projection_Data.hh:131
std::string projection_name() const
Get the name of the applicable projection.
Definition PDS_Projection_Data.hh:538
PDS_Projection_Data()
Construct a default identity projection.
Definition PDS_Projection_Data.cc:536
const double * geo_transform() const
Get the geo-transform array.
Definition PDS_Projection_Data.hh:489
static const char * SEMI_MAJOR_RADIUS_PARAMETER_NAME
Name of the parameter specifying the planet's semi-major axis radius.
Definition PDS_Projection_Data.hh:146
virtual ~PDS_Projection_Data()
Destructor.
Definition PDS_Projection_Data.cc:576
static const char * HORIZONATAL_OFFSET_PARAMETER_NAME
Name of the parameter specifying the horizontal offset of the projection origin from the image origin...
Definition PDS_Projection_Data.hh:126
double Geo_Transform[6]
The geo-transform array.
Definition PDS_Projection_Data.hh:872
static const char * SECOND_STANDARD_PARALLEL_PARAMETER_NAME
Name of the parameter specifying the projection second standard parallel.
Definition PDS_Projection_Data.hh:155
static const char *const ID
Class identification name with source code version and date.
Definition PDS_Projection_Data.hh:105
static bool named_in_list(std::string name, const char *const *aliases)
Try to match a name against an alias list.
Definition PDS_Projection_Data.cc:1545
static const char * FIRST_STANDARD_PARALLEL_PARAMETER_NAME
Name of the parameter specifying the projection first standard parallel.
Definition PDS_Projection_Data.hh:152
JP2_Box * JP2_GeoTIFF() const
Get a JP2_Box with GeoTIFF data content.
Definition PDS_Projection_Data.cc:1210
static const Projection_Definition Projection_Definitions[TOTAL_PROJECTION_TYPES]
A Projection_Definition is provided for each known Projection_Type.
Definition PDS_Projection_Data.hh:278
static const double DEFAULT_GEO_TIFF_TRANSFORM[6]
The default identity affine transformation matrix.
Definition PDS_Projection_Data.hh:285
std::string name() const
std::string pathname(const Parameter *root=NULL) const
Definition Dimensions.cc:32
Definition Dimensions.cc:30
Projection parameters with default values.
Definition PDS_Projection_Data.hh:266
Parameters that are required to define the projection.
Definition PDS_Projection_Data.hh:250
A Projection_Definition maps GDAL OGRSpatialReference parameter names to their required PDS parameter...
Definition PDS_Projection_Data.hh:216
double Value
The value assigned to the parameter.
Definition PDS_Projection_Data.hh:272
const char * SRS_Parameter_Name
The name with the GDAL OGRSpatialReference::SetNormProjParm method.
Definition PDS_Projection_Data.hh:269
const char * PDS_Parameter_Name
The name of the required PDS parameter.
Definition PDS_Projection_Data.hh:256
const char * SRS_Parameter_Name
The name with the GDAL OGRSpatialReference::SetNormProjParm method.
Definition PDS_Projection_Data.hh:253
A Projection_Definition maps GDAL OGRSpatialReference parameter names to their required PDS parameter...
Definition PDS_Projection_Data.hh:216
static const int MAX_ARRAY_ENTRIES
The maximum number of entries in any array contained in a Projection_Definition.
Definition PDS_Projection_Data.hh:228
const char * Aliases[MAX_ARRAY_ENTRIES]
Projection type name aliases.
Definition PDS_Projection_Data.hh:241
Projection_Type Code
The Projection_Type for the projection being defined.
Definition PDS_Projection_Data.hh:219
struct UA::HiRISE::PDS_Projection_Data::Projection_Definition::Default_Projection_Parameter Default_Parameters[MAX_ARRAY_ENTRIES]
struct UA::HiRISE::PDS_Projection_Data::Projection_Definition::Required_Projection_Parameter Required_Parameters[MAX_ARRAY_ENTRIES]