22 #define MAX_LENGTH 1000 76 double proj_param[15] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
77 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
79 int proj_code_found = 0;
80 int utm_zone_found = 0;
81 int sphere_code_found = 0;
93 if (Filename == NULL) {
101 if (Proj_info == NULL) {
109 fp = fopen(Filename,
"r");
119 if (line[0] ==
'#')
continue;
121 if (1 == sscanf(line,
"proj_code = %d",&proj_code)) {
123 }
else if (1 == sscanf(line,
"utm_zone = %d",&utm_zone)) {
125 }
else if (1 == sscanf(line,
"sphere_code = %d",&sphere_code)) {
126 sphere_code_found = 1;
127 }
else if (2 == sscanf(line,
"proj_param(%d) = %lf",&i,&value)) {
128 if (i > 0 && i < 16) {
129 proj_param[i-1] = value;
150 if (!proj_code_found) {
153 if (proj_code == 1 && !utm_zone_found) {
156 if (!sphere_code_found) {
172 *Proj_info = proj_info_tmp;
GCTP projection information.
#define MTK_ERR_CODE_JUMP(code)
MTKt_status MtkGCTPProjInfo(int Proj_code, int Sphere_code, int Zone_code, double Proj_param[15], MTKt_GCTPProjInfo *Proj_info)
Initialize a MTKt_GCTPProjInfo structure.
#define MTK_ERR_CODE_MSG_JUMP(code, msg)
MTKt_status MtkGCTPProjInfoRead(const char *Filename, MTKt_GCTPProjInfo *Proj_info)
Initialize a MTKt_GCTPProjInfo structure using data from an external file.
#define MTK_ERR_COND_JUMP(code)
#define MTKT_GCTPPROJINFO_INIT