Ice Sheet System Model  4.18
Code documentation
Functions
Kml2Expx.cpp File Reference
#include "./Kml2Expx.h"
#include "../../shared/shared.h"
#include "../../toolkits/toolkits.h"
#include "../KMLFileReadx/KMLFileReadx.h"

Go to the source code of this file.

Functions

int Kml2Expx (char *filkml, char *filexp, int sgn)
 
int Kml2Expx (char *filkml, char *filexp, int sgn, double cm, double sp)
 

Function Documentation

◆ Kml2Expx() [1/2]

int Kml2Expx ( char *  filkml,
char *  filexp,
int  sgn 
)

Definition at line 10 of file Kml2Expx.cpp.

10  {
11 
12  double cm,sp;
13  Ll2xydef(&cm,&sp,sgn);
14 
15  return(Kml2Expx(filkml,filexp,sgn,cm,sp));
16 }

◆ Kml2Expx() [2/2]

int Kml2Expx ( char *  filkml,
char *  filexp,
int  sgn,
double  cm,
double  sp 
)

Definition at line 18 of file Kml2Expx.cpp.

18  {
19 
20  int iret = 0;
21  KML_Object *kobj = NULL;
22  FILE *fidi = NULL;
23  FILE *fido = NULL;
24  clock_t clock0,clock1;
25  time_t time0 ,time1;
26 
27  clock0=clock();
28  time0 =time(NULL);
29  _printf0_("\nKml2Expx Module -- " << ctime(&time0));
30 
31  /*read kml file*/
32  fidi=fopen(filkml,"r");
33  if (!(kobj=KMLFileReadx(fidi)))
34  _error_("Error reading kml file.");
35  fclose(fidi);
36 
37  /*open exp file*/
38  _printf0_("Writing exp profiles to file.\n");
39  fido=fopen(filexp,"w");
40 
41  /*write the polygons and linestrings */
42  kobj->WriteExp(fido,"",sgn,cm,sp);
43 
44  /*close exp file */
45  fclose(fido);
46  delete kobj;
47 
48  clock1=clock();
49  time1 =time(NULL);
50  _printf_("Kml2Expx Module -- " << ((double)(clock1-clock0))/CLOCKS_PER_SEC << " CPU seconds; " << difftime(time1,time0) << " elapsed seconds.\n\n\n");
51 
52  return(iret);
53 }
KML_Object
Definition: KML_Object.h:13
_printf0_
#define _printf0_(StreamArgs)
Definition: Print.h:29
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
Ll2xydef
void Ll2xydef(double *pdelta, double *pslat, int sgn)
Definition: Ll2xyx.cpp:93
Kml2Expx
int Kml2Expx(char *filkml, char *filexp, int sgn)
Definition: Kml2Expx.cpp:10
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
KMLFileReadx
KML_Object * KMLFileReadx(FILE *fid)
Definition: KMLFileReadx.cpp:8
KML_Object::WriteExp
virtual void WriteExp(FILE *fid, const char *nstr, int sgn, double cm, double sp)
Definition: KML_Object.cpp:270