HiRISE
 PDS_JP2

PDS_Projection_Data.hh
Go to the documentation of this file.
1 /* PDS_Projection_Data
2 
3 HiROC CVS ID: PDS_Projection_Data.hh,v 1.13 2020/05/22 20:59:29 guym Exp
4 
5 Copyright (C) 2007 Arizona Board of Regents on behalf of the
6 Planetary Image Research Laboratory, Lunar and Planetary Laboratory at
7 the University of Arizona.
8 
9 This library is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License, version 2.1,
11 as published by the Free Software Foundation.
12 
13 This library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License
19 along with this library; if not, write to the Free Software Foundation,
20 Inc., 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 
37 namespace UA
38 {
39 namespace HiRISE
40 {
41 
97 : public PDS_Data
98 {
99 public:
100 /*==============================================================================
101  Constants:
102 */
104 static const char* const
105  ID;
106 
108 static const char
111 static const char
114 static const char
117 static const char
120 static const char
125 static const char
130 static const char
133 static const char
136 static const char
139 static const char
142 static const char
145 static const char
148 static const char
151 static const char
154 static const char
157 static const char
160 static const char
163 static const char
166 static const char
169 static const char
172 static const char
175 static const char
177 static const char
179 static const char
181 
184  {
186  /*
187  Well known projections are placed first in the list.
188  */
191  /*
192  The remaining projections are listed alphabetically.
193  */
208 
210  };
211 
216  {
220 
227  static const int
229 
240  const char*
242 
250  {
252  const char*
255  const char*
257  }
259 
266  {
268  const char*
271  double
273  }
275  };
277 static const Projection_Definition
279 
284 static const double
286 
288 static const unsigned char
290 
291 /*==============================================================================
292  Constructors:
293 */
300 
311 PDS_Projection_Data (const PDS_Data& PDS_data);
312 
323 PDS_Projection_Data (const std::string& pathname);
324 
329 virtual ~PDS_Projection_Data ();
330 
331 /*==============================================================================
332  Accessors
333 */
355 virtual PDS_Data& parameters (const std::string& pathname);
356 
372 
489 const double* geo_transform () const
490  {return Geo_Transform;}
491 
497 OGRSpatialReference* spatial_reference () const
498  {return Spatial_Reference ? Spatial_Reference->Clone () : NULL;}
499 
512  {return Projection_Type_Code;}
513 
538 std::string projection_name () const
539  {return Projection_Name;}
540 
541 /*==============================================================================
542  Manipulators
543 */
610 
721 
722 /*==============================================================================
723  JP2 Boxes
724 */
743 JP2_Box* JP2_GeoTIFF () const;
744 
806  (unsigned int image_width = 0, unsigned int image_height = 0) const;
807 
808 /*==============================================================================
809  Helpers
810 */
825 static bool named_in_list (std::string name, const char* const* aliases);
826 
839 static Projection_Type projection_type (const std::string& projection_name);
840 
841 /*==============================================================================
842  Data Members:
843 */
844 protected:
845 
850 std::string
852 
859 
864 OGRSpatialReference
866 
871 double
873 
874 }; // End class PDS_Projection_Data
875 
876 } // namespace HiRISE
877 } // namespace UA
878 #endif
A JP2_Box contains JP2 file format box data.
Definition: JP2_Box.hh:40
PDS_Data contains PDS label PVL parameters.
Definition: PDS_Data.hh:52
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:764
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:1299
static const char * COORDINATE_SYSTEM_PARAMETER_NAME
Name of the parameter specifying the type of coordinate system.
Definition: PDS_Projection_Data.hh:118
const double * geo_transform() const
Get the geo-transform array.
Definition: PDS_Projection_Data.hh:489
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
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:1527
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:1192
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:30
Projection parameters with default values.
Definition: PDS_Projection_Data.hh:266
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
Parameters that are required to define the projection.
Definition: PDS_Projection_Data.hh:250
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]