/usr/include/geotranz/dtcc/DatumLibrary.h is in libgeotranz3-dev 3.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | // CLASSIFICATION: UNCLASSIFIED
#ifndef DatumLibrary_H
#define DatumLibrary_H
/***************************************************************************/
/* RSC IDENTIFIER: Datum Library
*
* ABSTRACT
*
* This component provides datum shifts for a large collection of local
* datums, WGS72, and WGS84. A particular datum can be accessed by using its
* standard 5-letter code to find its index in the datum table. The index
* can then be used to retrieve the name, type, ellipsoid code, and datum
* shift parameters, and to perform shifts to or from that datum.
*
* By sequentially retrieving all of the datum codes and/or names, a menu
* of the available datums can be constructed. The index values resulting
* from selections from this menu can then be used to access the parameters
* of the selected datum, or to perform datum shifts involving that datum.
*
* This component supports both 3-parameter local datums, for which only X,
* Y, and Z translations relative to WGS 84 have been defined, and
* 7-parameter local datums, for which X, Y, and Z rotations, and a scale
* factor, are also defined. It also includes entries for WGS 84 (with an
* index of 0), and WGS 72 (with an index of 1), but no shift parameter
* values are defined for these.
*
* This component provides datum shift functions for both geocentric and
* geodetic coordinates. WGS84 is used as an intermediate state when
* shifting from one local datum to another. When geodetic coordinates are
* given Molodensky's method is used, except near the poles where the 3-step
* step method is used instead. Specific algorithms are used for shifting
* between WGS72 and WGS84.
*
* This component depends on two data files, named 3_param.dat and
* 7_param.dat, which contain the datum parameter values. Copies of these
* files must be located in the directory specified by the value of the
* environment variable "MSPCCS_DATA", if defined, or else in the current
* directory whenever a program containing this component is executed.
*
* Additional datums can be added to these files, either manually or using
* the Create_Datum function. However, if a large number of datums are
* added, the datum table array sizes in this component will have to be
* increased.
*
* This component depends on two other components: the Ellipsoid component
* for access to ellipsoid parameters; and the Geocentric component for
* conversions between geodetic and geocentric coordinates.
*
* ERROR HANDLING
*
* This component checks for input file errors and input parameter errors.
* If an invalid value is found, the error code is combined with the current
* error code using the bitwise or. This combining allows multiple error
* codes to be returned. The possible error codes are:
*
* DATUM_NO_ERROR : No errors occurred in function
* DATUM_NOT_INITIALIZED_ERROR : Datum module has not been initialized
* DATUM_7PARAM_FILE_OPEN_ERROR : 7 parameter file opening error
* DATUM_7PARAM_FILE_PARSING_ERROR : 7 parameter file structure error
* DATUM_7PARAM_OVERFLOW_ERROR : 7 parameter table overflow
* DATUM_3PARAM_FILE_OPEN_ERROR : 3 parameter file opening error
* DATUM_3PARAM_FILE_PARSING_ERROR : 3 parameter file structure error
* DATUM_3PARAM_OVERFLOW_ERROR : 3 parameter table overflow
* DATUM_INVALID_INDEX_ERROR : Index out of valid range (less than one
* or more than Number_of_Datums)
* DATUM_INVALID_SRC_INDEX_ERROR : Source datum index invalid
* DATUM_INVALID_DEST_INDEX_ERROR : Destination datum index invalid
* DATUM_INVALID_CODE_ERROR : Datum code not found in table
* DATUM_LAT_ERROR : Latitude out of valid range (-90 to 90)
* DATUM_LON_ERROR : Longitude out of valid range (-180 to
* 360)
* DATUM_SIGMA_ERROR : Standard error values must be positive
* (or -1 if unknown)
* DATUM_DOMAIN_ERROR : Domain of validity not well defined
* DATUM_ELLIPSE_ERROR : Error in ellipsoid module
* DATUM_NOT_USERDEF_ERROR : Datum code is not user defined - cannot
* be deleted
*
*
* REUSE NOTES
*
* Datum is intended for reuse by any application that needs access to
* datum shift parameters relative to WGS 84.
*
*
* REFERENCES
*
* Further information on Datum can be found in the Reuse Manual.
*
* Datum originated from : U.S. Army Topographic Engineering Center (USATEC)
* Geospatial Information Division (GID)
* 7701 Telegraph Road
* Alexandria, VA 22310-3864
*
* LICENSES
*
* None apply to this component.
*
* RESTRICTIONS
*
* Datum has no restrictions.
*
* ENVIRONMENT
*
* Datum was tested and certified in the following environments:
*
* 1. Solaris 2.5 with GCC 2.8.1
* 2. MS Windows 95 with MS Visual C++ 6
*
* MODIFICATIONS
*
* Date Description
* ---- -----------
* 11/20/08 Original Code
* 05/26/10 S. Gillis, BAEts26674, Added Validate Datum to the API
* in MSP Geotrans 3.0
* 07/01/10 S. Gillis, BAEts26676, Fixed the error always returned
* when calling CCS API getDatumParamters
*/
#include "DatumType.h"
#include "DtccApi.h"
namespace MSP
{
namespace CCS
{
class DatumLibraryImplementation;
class MSP_DTCC_API DatumLibrary
{
public:
/*
* The constructor creates an empty list to store the datum information
* contained in two external files, 3_param.dat and 7_param.dat.
*/
DatumLibrary( DatumLibraryImplementation* __datumLibraryImplementation );
DatumLibrary( const DatumLibrary &d );
DatumLibrary& operator=( const DatumLibrary &d );
~DatumLibrary( void );
/* The function defineDatum creates a new local (3 or 7-parameter) datum with the
* specified code, name, shift values, and standard error values or rotation and scale factor values.
* If the datum table has not been initialized, the specified code is already in use,
* or a new version of the 3-param.dat or 7-param.dat file cannot be created, an
* exception is thrown. Note that the indexes
* of all datums in the datum table may be changed by this function.
*
* datumType : Specifies 3 parameter or 7 parameter datum (input)
* datumCode : 5-letter new datum code. (input)
* datumName : Name of the new datum (input)
* ellipsoidCode : 2-letter code for the associated ellipsoid (input)
* deltaX : X translation to WGS84 in meters (input)
* deltaY : Y translation to WGS84 in meters (input)
* deltaZ : Z translation to WGS84 in meters (input)
* sigmaX : Standard error in X in meters (input)
* sigmaY : Standard error in Y in meters (input)
* sigmaZ : Standard error in Z in meters (input)
* westLongitude : Western edge of validity rectangle in radians (input)
* eastLongitude : Eastern edge of validity rectangle in radians (input)
* southLatitude : Southern edge of validity rectangle in radians(input)
* northLatitude : Northern edge of validity rectangle in radians(input)
* rotationX : X rotation to WGS84 in arc seconds (input)
* rotationY : Y rotation to WGS84 in arc seconds (input)
* rotationZ : Z rotation to WGS84 in arc seconds (input)
* scalefactor : Scale factor (input)
*
*/
void defineDatum( const int datumType, const char *datumCode, const char *datumName, const char *ellipsoidCode,
double deltaX, double deltaY, double deltaZ,
double sigmaX, double sigmaY, double sigmaZ,
double westLongitude, double eastLongitude, double southLatitude, double northLatitude,
double rotationX, double rotationY, double rotationZ, double scaleFactor);
/*
* The function removeDatum deletes a local (3-parameter) datum with the
* specified code. If the datum table has not been initialized or a new
* version of the 3-param.dat file cannot be created, an exception is thrown.
* Note that the indexes of all datums
* in the datum table may be changed by this function.
*
* code : 5-letter datum code. (input)
*
*/
void removeDatum( const char* code );
/*
* The function datumCode returns the 5-letter code of the datum
* referenced by index.
*
* index : The index of a given datum in the datum table. (input)
* code : The datum Code of the datum referenced by Index. (output)
*/
void datumCode( const long index, char *code );
/*
* The function getDatumCount returns the number of Datums in the table
* if the table was initialized without error.
*
* count : number of datums in the datum table (output)
*/
void getDatumCount( long *count );
/*
* The function getDatumIndex returns the index of the datum with the
* specified code.
*
* code : The datum code being searched for. (input)
* index : The index of the datum in the table with the (output)
* specified code.
*/
void getDatumIndex( const char *code, long *index );
/*
* The function getDatumInfo returns the 5-letter code, name and
* 2-letter ellipsoid code of the datum referenced by index.
*
* index : The index of a given datum in the datum table. (input)
* code : The datum Code of the datum referenced by Index. (output)
* name : The datum Name of the datum referenced by Index. (output)
* ellipsoidCode : The ellipsoid code for the ellipsoid associated with (output)
* the datum referenced by index.
*/
void getDatumInfo( const long index, char *code, char *name, char *ellipsoidCode );
/*
* The function getDatumParameters returns the following datum parameters
* (specified as output parameters below): datumType, deltaX, deltaY,
* deltaZ, sigmaX, sigmaY, sigmaZ, westLongitude, eastLongitude,
* southLatitude, northLatitude, rotationX, rotationY, rotationZ, and
* scaleFactor.
*
* sigmaX, sigmaY, and sigmaZ only apply to 3 parameter datum and will be
* set to 0 if the datum type is a 7 parameter datum.
*
* rotationX, rotationY, rotationZ, and scaleFactor only apply to 7
* parameter datum and will be set to 0 if the datum type is a 3
* parameter datum.
*
* If the datum type is neither a 3 parameter datum nor a 7 parameter
* datum, a CoordinateConversionException will be thrown.
*
* index : The index of a given datum in the datum table (input)
* datumType : Specifies datum type (output)
* deltaX : X translation to WGS84 in meters (output)
* deltaY : Y translation to WGS84 in meters (output)
* deltaZ : Z translation to WGS84 in meters (output)
* sigmaX : Standard error in X in meters (output)
* sigmaY : Standard error in Y in meters (output)
* sigmaZ : Standard error in Z in meters (output)
* westLongitude : Western edge of validity rectangle in radians (output)
* eastLongitude : Eastern edge of validity rectangle in radians (output)
* southLatitude : Southern edge of validity rectangle in radians (output)
* northLatitude : Northern edge of validity rectangle in radians (output)
* rotationX : X rotation to WGS84 in arc seconds (output)
* rotationY : Y rotation to WGS84 in arc seconds (output)
* rotationZ : Z rotation to WGS84 in arc seconds (output)
* scaleFactor : Scale factor (output)
*/
void getDatumParameters( const long index, DatumType::Enum *datumType, double *deltaX, double *deltaY, double *deltaZ,
double *sigmaX, double *sigmaY, double *sigmaZ,
double *westLongitude, double *eastLongitude, double *southLatitude, double *northLatitude,
double *rotationX, double *rotationY, double *rotationZ, double *scaleFactor );
/*
* The function datumValidRectangle returns the edges of the validity
* rectangle for the datum referenced by index.
*
* index : The index of a given datum in the datum table (input)
* westLongitude : Western edge of validity rectangle in radians (output)
* eastLongitude : Eastern edge of validity rectangle in radians (output)
* southLatitude : Southern edge of validity rectangle in radians (output)
* northLatitude : Northern edge of validity rectangle in radians (output)
*
*/
void getDatumValidRectangle( const long index, double *westLongitude, double *eastLongitude, double *southLatitude, double *northLatitude );
/*
* The function validDatum checks whether or not the specified location
* is within the validity rectangle for the specified datum. It returns
* zero if the specified location is NOT within the validity rectangle,
* and returns 1 otherwise.
*
* index : The index of a given datum in the datum table (input)
* latitude : Latitude of the location to be checked in radians (input)
* longitude : Longitude of the location to be checked in radians (input)
* result : Indicates whether location is inside (1) or outside (0)
* of the validity rectangle of the specified datum (output)
*/
void validDatum( const long index, double longitude, double latitude,
long *result );
private:
DatumLibraryImplementation* _datumLibraryImplementation;
};
}
}
#endif
// CLASSIFICATION: UNCLASSIFIED
|