OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfNameConversionTables.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2004 Garrett Potts.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*******************************************************************
11 // $Id: ossimNitfNameConversionTables.cpp 13219 2008-07-23 19:27:49Z dburken $
12 
13 #include <cstddef>
15 #include <ossim/base/ossimString.h>
16 
18 {
19  const char* nitfProjCode; // nitf code name
20  const char* projectionName; // ossim projection name
21 };
22 
24 {
25  const char* nitfProjCode; // nitf code name
26  const char* projectionName; // ossim projection name
27 };
28 
29 static const ossimNitfMapProjectionCodeToOssimName mapProjectiontable[]=
30 {
31  {"AC", "ossimAlbersProjection"},
32  {"AL", "ossimAzimEquDistProjection"},
33  {"BF", "ossimBonneProjection"},
34  {"CP", "ossimEquDistCylProjection"},
35  {"CP", "ossimLlxyProjection"},
36  {"CS", "ossimCassiniProjection"},
37  {"ED", "ossimEckert6Projection"},
38  {"EF", "ossimEckert4Projection"},
39  {"GN", "ossimGnomonicProjection"},
40  {"LE", "ossimLambertConformalConicProjection"},
41  {"LI", "ossimCylEquAreaProjection"},
42  {"MC", "ossimMercatorProjection"},
43  {"MH", "ossimMillerProjection"},
44  {"MP", "ossimMollweidProjection"},
45  {"NT", "ossimNewZealandMapGridProjection"},
46  {"OD", "ossimOrthoGraphicProjection"},
47  {"PG", "ossimPolarStereoProjection"},
48  {"PH", "ossimPolyconicProjection"},
49  {"SA", "ossimSinusoidalProjection"},
50  {"SX", "ossimSpaceObliqueMercatorProjection"},
51  {"TC", "ossimTransMercatorProjection"},
52  {"TX", "ossimTransCylEquAreaProjection"},
53  {"VA", "ossimVanDerGrintenProjection"},
54  { 0, 0 }
55 };
56 
57 static const ossimNitfMapProjectionCodeToNitfName nitfMapProjectiontable[]=
58 {
59  {"AC", "Albers Equal-Area Conic"},
60  {"AK", "(Lambert) Azimuthal Equal-Area"},
61  {"AL", "Azimuthal Equidistant"},
62  {"BF", "Bonne"},
63  {"CC", "Equidistant Conic with 1 Standard Parallel"},
64  {"CP", "Equirectangular"},
65  {"CS", "Cassini-Soldner"},
66  {"ED", "Eckert VI"},
67  {"EF", "Eckert IV"},
68  {"GN", "Gnomonic"},
69  {"HX", "Hotine Oblique Mercator based on 2 Points"},
70  {"KA", " Equidistant Conic with 2 Standard Parallels"},
71  {"LA", "Laborde"},
72  {"LE", "Lambert Conformal Conic"},
73  {"LI", "Cylindrical Equal Area"},
74  {"LJ", " Lambert Equal-Area Meridional"},
75  {"MC", "Mercator"},
76  {"MH", "Miller Cylindrical"},
77  {"MJ", "French Lambert"},
78  {"MP", "Mollweide"},
79  {"NT", "New Zealand Map Grid"},
80  {"OC", "Oblique Mercator"},
81  {"OD", "Orthographic"},
82  {"PG", "Polar Stereographic"},
83  {"PH", "Polyconic"},
84  {"RS", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
85  {"RB", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
86  {"RX", "Robinson"},
87  {"SA", "Sinusoidal"},
88  {"SD", "Oblique Stereographic"},
89  {"SX", "Space Oblique Mercator"},
90  {"TC", " Transverse Mercator"},
91  {"TX", "Transverse Cylindrical Equal Area"},
92  {"VA", "Van der Grinten"},
93  {"VX", "General Vertical NearSide Perspective"},
94  { 0, 0 }
95 };
96 
98 {
99 }
100 
102 {
103  ossim_uint32 idx = 0;
104 
105  while(mapProjectiontable[idx].nitfProjCode)
106  {
107  if(mapProjectionName == mapProjectiontable[idx].projectionName)
108  {
109  return mapProjectiontable[idx].nitfProjCode;
110  }
111  ++idx;
112  }
113 
114  return "";
115 }
116 
118 {
119  ossim_uint32 idx = 0;
120 
121  while(mapProjectiontable[idx].nitfProjCode)
122  {
123  if(nitfProjectionCode == mapProjectiontable[idx].nitfProjCode)
124  {
125  return mapProjectiontable[idx].projectionName;
126  }
127  ++idx;
128  }
129 
130  return "";
131 }
132 
134 {
135  ossim_uint32 idx = 0;
136 
137  while(nitfMapProjectiontable[idx].nitfProjCode)
138  {
139  if(nitfProjectionCode == nitfMapProjectiontable[idx].nitfProjCode)
140  {
141  return nitfMapProjectiontable[idx].projectionName;
142  }
143  ++idx;
144  }
145 
146  return "";
147 }
148 
150 {
151  ossim_uint32 idx = 0;
152 
153  while(nitfMapProjectiontable[idx].nitfProjCode)
154  {
155  if(nitfProjectionName == nitfMapProjectiontable[idx].projectionName)
156  {
157  return nitfMapProjectiontable[idx].nitfProjCode;
158  }
159  ++idx;
160  }
161 
162  return "";
163 }
ossimString convertNitfProjectionNameToNitfCode(const ossimString &nitfProjectionName) const
ossimString convertNitfCodeToOssimProjectionName(const ossimString &nitfProjectionCode) const
ossimString convertMapProjectionNameToNitfCode(const ossimString &mapProjectionName) const
unsigned int ossim_uint32
ossimString convertNitfCodeToNitfProjectionName(const ossimString &nitfProjectionCode) const