Ice Sheet System Model  4.18
Code documentation
Functions
Shp2Kmlx.h File Reference

header file for shp to kml conversion routines. More...

#include "../../classes/classes.h"

Go to the source code of this file.

Functions

int Shp2Kmlx (char *filshp, char *filkml, int sgn)
 
int Shp2Kmlx (char *filshp, char *filkml, int sgn, double cm, double sp)
 

Detailed Description

header file for shp to kml conversion routines.

Definition in file Shp2Kmlx.h.

Function Documentation

◆ Shp2Kmlx() [1/2]

int Shp2Kmlx ( char *  filshp,
char *  filkml,
int  sgn 
)

Definition at line 10 of file Shp2Kmlx.cpp.

10  {
11 
12  #ifdef _HAVE_SHAPELIB_ //only works if Shapelib library has been compiled in.
13 
14  double cm,sp;
15  Xy2lldef(&cm,&sp,sgn);
16 
17  return(Shp2Kmlx(filshp,filkml,sgn,cm,sp));
18 
19  #else //ifdef _HAVE_SHAPELIB_
20  return 0;
21  #endif
22 }

◆ Shp2Kmlx() [2/2]

int Shp2Kmlx ( char *  filshp,
char *  filkml,
int  sgn,
double  cm,
double  sp 
)

Definition at line 24 of file Shp2Kmlx.cpp.

24  {
25 
26  #ifdef _HAVE_SHAPELIB_ //only works if Shapelib library has been compiled in.
27 
28  int i,j,k,iret=0;
29  int lwidth=1;
30  double popac=0.50;
31  int nshape,ncoord;
32  double cpsum;
33  int *pstype = NULL, *pnpart=NULL,**ppstrt=NULL,**pptype=NULL,*pnvert=NULL;
34  double **pshapx = NULL,**pshapy=NULL,**pshapz=NULL,**pshapm=NULL;
35  double *lat = NULL, *lon=NULL;
36 
37  SHPHandle hSHP;
38  int nShapeType, nEntities, iPart, bValidate = 0,nInvalidCount=0;
39  const char *pszPlus;
40  double adfMinBound[4], adfMaxBound[4];
41 
42  char indent[81]="";
43  KML_File *kfile = NULL;
44  KML_Document *kdoc = NULL;
45  KML_Style *kstyle = NULL;
46  KML_LineStyle *klsty = NULL;
47  KML_PolyStyle *kpsty = NULL;
48  KML_Folder *kfold = NULL;
49  KML_Placemark *kplace = NULL;
50  KML_MultiGeometry *kmulti = NULL;
51  KML_Polygon *kpoly = NULL;
52  KML_LinearRing *kring = NULL;
53  KML_LineString *kline = NULL;
54  KML_Point *kpoint = NULL;
55  FILE *fid = NULL;
56 
57  clock_t clock0,clock1;
58  time_t time0, time1;
59 
60  clock0=clock();
61  time0 =time(NULL);
62  _printf0_("\nShp2Kmlx Module -- " << ctime(&time0));
63 
64 /* note that much of the following code is taken from shpdump.c in shapelib. */
65 
66 /* open shp/shx files */
67 
68  hSHP = SHPOpen( filshp, "rb" );
69  if (!hSHP) _error_("Error opening shp/shx files.");
70 
71 /* read header and print out file bounds */
72 
73  SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
74 
75  printf( "Shapefile Type: %s # of Shapes: %d\n\n",
76  SHPTypeName( nShapeType ), nEntities );
77 
78  printf( "File Bounds: (%12.3f,%12.3f,%g,%g)\n"
79  " to (%12.3f,%12.3f,%g,%g)\n",
80  adfMinBound[0],
81  adfMinBound[1],
82  adfMinBound[2],
83  adfMinBound[3],
84  adfMaxBound[0],
85  adfMaxBound[1],
86  adfMaxBound[2],
87  adfMaxBound[3] );
88 
89  nshape=nEntities;
90  pstype=xNew<int>(nshape);
91  pnpart=xNew<int>(nshape);
92  ppstrt=xNew<int*>(nshape);
93  pptype=xNew<int*>(nshape);
94  pnvert=xNew<int>(nshape);
95  pshapx=xNew<double*>(nshape);
96  pshapy=xNew<double*>(nshape);
97  pshapz=xNew<double*>(nshape);
98  pshapm=xNew<double*>(nshape);
99 
100  /* loop over the list of shapes */
101  for(i=0;i<nEntities;i++ ){
102  SHPObject *psShape;
103 
104  psShape = SHPReadObject( hSHP, i );
105 
106  printf( "\nShape:%d (%s) nVertices=%d, nParts=%d\n"
107  " Bounds:(%12.3f,%12.3f, %g, %g)\n"
108  " to (%12.3f,%12.3f, %g, %g)\n",
109  i, SHPTypeName(psShape->nSHPType),
110  psShape->nVertices, psShape->nParts,
111  psShape->dfXMin, psShape->dfYMin,
112  psShape->dfZMin, psShape->dfMMin,
113  psShape->dfXMax, psShape->dfYMax,
114  psShape->dfZMax, psShape->dfMMax );
115 
116  pstype[i]=psShape->nSHPType;
117  pnpart[i]=psShape->nParts;
118  if (pnpart[i]) {
119  ppstrt[i]=xNew<int>(pnpart[i]);
120  pptype[i]=xNew<int>(pnpart[i]);
121  }
122  else {
123  ppstrt[i]=NULL;
124  pptype[i]=NULL;
125  }
126  pnvert[i]=psShape->nVertices;
127  if (pnvert[i]) {
128  pshapx[i]=xNew<double>(pnvert[i]);
129  pshapy[i]=xNew<double>(pnvert[i]);
130  pshapz[i]=xNew<double>(pnvert[i]);
131  pshapm[i]=xNew<double>(pnvert[i]);
132  }
133  else {
134  pshapx[i]=NULL;
135  pshapy[i]=NULL;
136  pshapz[i]=NULL;
137  pshapm[i]=NULL;
138  }
139 
140  for( j = 0, iPart = 1; j < psShape->nVertices; j++ )
141  {
142  const char *pszPartType = "";
143 
144  if( j == 0 && psShape->nParts > 0 )
145  {
146  pszPartType = SHPPartTypeName( psShape->panPartType[0] );
147  ppstrt[i][0]=psShape->panPartStart[0];
148  pptype[i][0]=psShape->panPartType[0];
149  }
150 
151  if( iPart < psShape->nParts
152  && psShape->panPartStart[iPart] == j )
153  {
154  pszPartType = SHPPartTypeName( psShape->panPartType[iPart] );
155  ppstrt[i][iPart]=psShape->panPartStart[iPart];
156  pptype[i][iPart]=psShape->panPartType[iPart];
157  iPart++;
158  pszPlus = "+";
159  }
160  else
161  pszPlus = " ";
162 
163 // printf(" %s (%12.3f,%12.3f, %g, %g) %s \n",
164 // pszPlus,
165 // psShape->padfX[j],
166 // psShape->padfY[j],
167 // psShape->padfZ[j],
168 // psShape->padfM[j],
169 // pszPartType );
170 
171  pshapx[i][j]=psShape->padfX[j];
172  pshapy[i][j]=psShape->padfY[j];
173  pshapz[i][j]=psShape->padfZ[j];
174  pshapm[i][j]=psShape->padfM[j];
175  }
176 
177  if( bValidate )
178  {
179  int nAltered = SHPRewindObject( hSHP, psShape );
180 
181  if( nAltered > 0 )
182  {
183  printf( " %d rings wound in the wrong direction.\n",
184  nAltered );
185  nInvalidCount++;
186  }
187  }
188 
189  SHPDestroyObject( psShape );
190  }
191 
192 /* close shp/shx files */
193 
194  SHPClose( hSHP );
195 
196 /* construct kml file */
197 
198  kfile =new KML_File();
199  kfile->AddAttrib("xmlns","http://www.opengis.net/kml/2.2");
200 
201 /* construct kml document */
202 
203  kdoc =new KML_Document();
204  sprintf(kdoc->name ,"Shp2Kmlx Module -- %s",ctime(&time0));
205  kdoc->open =1;
206 
207 /* construct style templates for defaults */
208 
209  klsty =new KML_LineStyle();
210  sprintf(klsty->color ,"ff000000");
211  sprintf(klsty->colormode ,"normal");
212  klsty->width =lwidth;
213  kpsty =new KML_PolyStyle();
214  sprintf(kpsty->color ,"%02xffffff",(int)floor(popac*255+0.5));
215  sprintf(kpsty->colormode ,"random");
216  kstyle=new KML_Style();
217  kstyle->AddAttrib("id","BlackLineRandomPoly");
218  kstyle->line =klsty;
219  kstyle->poly =kpsty;
220  (kdoc->style )->AddObject((Object*)kstyle);
221 
222  klsty =new KML_LineStyle();
223  sprintf(klsty->color ,"ff000000");
224  sprintf(klsty->colormode ,"normal");
225  klsty->width =lwidth;
226  kpsty =new KML_PolyStyle();
227  sprintf(kpsty->color ,"00ffffff");
228  sprintf(kpsty->colormode ,"random");
229  kstyle=new KML_Style();
230  kstyle->AddAttrib("id","BlackLineEmptyPoly");
231  kstyle->line =klsty;
232  kstyle->poly =kpsty;
233  (kdoc->style )->AddObject((Object*)kstyle);
234 
235  klsty =new KML_LineStyle();
236  sprintf(klsty->color ,"%02xffffff",(int)floor(popac*255+0.5));
237  sprintf(klsty->colormode ,"random");
238  klsty->width =lwidth*2;
239  kpsty =new KML_PolyStyle();
240  sprintf(kpsty->color ,"00ffffff");
241  sprintf(kpsty->colormode ,"random");
242  kstyle=new KML_Style();
243  kstyle->AddAttrib("id","RandomLineEmptyPoly");
244  kstyle->line =klsty;
245  kstyle->poly =kpsty;
246  (kdoc->style )->AddObject((Object*)kstyle);
247 
248 /* construct kml folder for shapes */
249 
250  kfold =new KML_Folder();
251  sprintf(kfold->name ,"Shapefile: %s Type: %s nShapes: %d",
252  filshp, SHPTypeName( nShapeType ), nEntities );
253  kfold->open =1;
254 
255 /* loop over the list of shapes */
256 
257  for (i=0; i<nshape; i++) {
258 
259 /* null type */
260 
261  if (pstype[i] == SHPT_NULL) {
262  ;
263  }
264 
265 /* point types */
266 
267  else if (pstype[i] == SHPT_POINT ||
268  pstype[i] == SHPT_POINTZ ||
269  pstype[i] == SHPT_POINTM) {
270  kplace=new KML_Placemark();
271 
272  sprintf(kplace->name ,"Shape:%d (%s) nVertices=%d, nParts=%d",
273  i,SHPTypeName(pstype[i]),pnvert[i],pnpart[i]);
274  kplace->visibility=true;
275  sprintf(kplace->styleurl ,"#RandomLineEmptyPoly");
276 
277  if (pnpart[i] > 0)
278  _printf_("Warning -- Shape "<< i << " of type \"" << SHPTypeName( pstype[i] ) << "\" should not have " << pnpart[i] << " > 0 parts.\n\n");
279  if (pnvert[i] > 1)
280  _printf_("Warning -- Shape " << i << " of type \"" << SHPTypeName( pstype[i] ) << "\" should not have " << pnpart[i] << " > 1 vertices.\n\n");
281 
282  kpoint=new KML_Point();
283 
284  lat=xNew<double>(pnvert[i]);
285  lon=xNew<double>(pnvert[i]);
286  if (sgn) {
287  Xy2llx(lat,lon,pshapx[i],pshapy[i],pnvert[i],sgn,cm,sp);
288  }
289  else {
290  memcpy(lon,pshapx[i],pnvert[i]*sizeof(double));
291  memcpy(lat,pshapy[i],pnvert[i]*sizeof(double));
292  }
293 
294  kpoint->coords[0]=lon [0];
295  kpoint->coords[1]=lat [0];
296  kpoint->coords[2]=pshapz[i][0];
297 
298  xDelete<double>(lon);
299  xDelete<double>(lat);
300 
301  (kplace->geometry )->AddObject((Object*)kpoint);
302  kpoint=NULL;
303  (kfold ->feature )->AddObject((Object*)kplace);
304  kplace=NULL;
305  }
306 
307 /* polyline types */
308 
309  else if (pstype[i] == SHPT_ARC ||
310  pstype[i] == SHPT_ARCZ ||
311  pstype[i] == SHPT_ARCM) {
312  kplace=new KML_Placemark();
313 
314  sprintf(kplace->name ,"Shape:%d (%s) nVertices=%d, nParts=%d",
315  i,SHPTypeName(pstype[i]),pnvert[i],pnpart[i]);
316  kplace->visibility=true;
317  sprintf(kplace->styleurl ,"#RandomLineEmptyPoly");
318 
319 /* create a multigeometry to hold all the lines */
320 
321  kmulti=new KML_MultiGeometry();
322 
323 /* convert to lat/lon, if necessary */
324 
325  lat=xNew<double>(pnvert[i]);
326  lon=xNew<double>(pnvert[i]);
327  if (sgn) {
328  Xy2llx(lat,lon,pshapx[i],pshapy[i],pnvert[i],sgn,cm,sp);
329  }
330  else {
331  memcpy(lon,pshapx[i],pnvert[i]*sizeof(double));
332  memcpy(lat,pshapy[i],pnvert[i]*sizeof(double));
333  }
334 
335 /* loop over the lines */
336 
337  for (j=0; j<pnpart[i]; j++) {
338  kline =new KML_LineString();
339 
340  kline->ncoord =(j<pnpart[i]-1 ? ppstrt[i][j+1]-ppstrt[i][j] : pnvert[i]-ppstrt[i][j]);
341  kline->coords =xNew<double>(kline->ncoord*3);
342  for (k=0; k<kline->ncoord; k++) {
343  kline->coords[3*k+0]=lon [ppstrt[i][j]+k];
344  kline->coords[3*k+1]=lat [ppstrt[i][j]+k];
345  kline->coords[3*k+2]=pshapz[i][ppstrt[i][j]+k];
346  }
347  (kmulti->geometry )->AddObject((Object*)kline);
348  kline = NULL;
349  }
350 
351  xDelete<double>(lon);
352  xDelete<double>(lat);
353 
354  (kplace->geometry)->AddObject((Object*)kmulti);
355  kmulti=NULL;
356  (kfold ->feature )->AddObject((Object*)kplace);
357  kplace=NULL;
358  }
359 
360 /* polygon types */
361 
362  else if (pstype[i] == SHPT_POLYGON ||
363  pstype[i] == SHPT_POLYGONZ ||
364  pstype[i] == SHPT_POLYGONM) {
365 
366 /* the shp format specifies that outer rings are cw, while inner rings are ccw. there
367  may be multiple outer rings and inner rings in any order. the kml format specifies
368  all rings are ccw (right-hand rule). there may be only one outer ring with multiple
369  inner rings, and rings are differentiated by keyword.
370 
371  at least for now, assume that each cw ring forms a new kml polygon, and each ccw
372  ring forms an inner ring for the most recent outer ring. a more elaborate solution
373  would be for each inner ring to search in which outer ring it occurs. */
374 
375  kplace=new KML_Placemark();
376 
377  sprintf(kplace->name ,"Shape:%d (%s) nVertices=%d, nParts=%d",
378  i,SHPTypeName(pstype[i]),pnvert[i],pnpart[i]);
379  kplace->visibility=true;
380  sprintf(kplace->styleurl ,"#BlackLineRandomPoly");
381 
382 /* create a multigeometry to hold all the polygons */
383 
384  kmulti=new KML_MultiGeometry();
385 
386 /* convert to lat/lon, if necessary */
387 
388  lat=xNew<double>(pnvert[i]);
389  lon=xNew<double>(pnvert[i]);
390  if (sgn) {
391  Xy2llx(lat,lon,pshapx[i],pshapy[i],pnvert[i],sgn,cm,sp);
392  }
393  else {
394  memcpy(lon,pshapx[i],pnvert[i]*sizeof(double));
395  memcpy(lat,pshapy[i],pnvert[i]*sizeof(double));
396  }
397 
398 /* loop over the polygons */
399 
400  for (j=0; j<pnpart[i]; j++) {
401 
402 /* check if polygon is ccw or cw by computing sum of cross products (twice the area) */
403 
404  ncoord=(j<pnpart[i]-1 ? ppstrt[i][j+1]-ppstrt[i][j] : pnvert[i]-ppstrt[i][j]);
405  cpsum =0.;
406 
407  for (k=ppstrt[i][j]; k<ppstrt[i][j]+ncoord-1; k++)
408  cpsum +=pshapx[i][k]*pshapy[i][k+1 ]-pshapy[i][k]*pshapx[i][k+1 ];
409  cpsum +=pshapx[i][k]*pshapy[i][ppstrt[i][j]]-pshapy[i][k]*pshapx[i][ppstrt[i][j]];
410 
411 /* outer ring (cw) (allow exception for single-part shapes) */
412 
413  if (cpsum < 0 || pnpart[i] == 1) {
414  if (kpoly) {
415  (kmulti->geometry )->AddObject((Object*)kpoly);
416  kpoly =NULL;
417  }
418 
419 /* create a new polygon from the outer ring (reversing cw to ccw) */
420 
421  kpoly =new KML_Polygon();
422  kring =new KML_LinearRing();
423 
424  kring->ncoord =(j<pnpart[i]-1 ? ppstrt[i][j+1]-ppstrt[i][j] : pnvert[i]-ppstrt[i][j]);
425  kring->coords =xNew<double>(kring->ncoord*3);
426  if (cpsum < 0)
427  for (k=0; k<kring->ncoord; k++) {
428  kring->coords[3*(kring->ncoord-1-k)+0]=lon [ppstrt[i][j]+k];
429  kring->coords[3*(kring->ncoord-1-k)+1]=lat [ppstrt[i][j]+k];
430  kring->coords[3*(kring->ncoord-1-k)+2]=pshapz[i][ppstrt[i][j]+k];
431  }
432  else
433  for (k=0; k<kring->ncoord; k++) {
434  kring->coords[3*k+0]=lon [ppstrt[i][j]+k];
435  kring->coords[3*k+1]=lat [ppstrt[i][j]+k];
436  kring->coords[3*k+2]=pshapz[i][ppstrt[i][j]+k];
437  }
438 
439  (kpoly ->outer )->AddObject((Object*)kring);
440  kring =NULL;
441  }
442 
443 /* inner ring (ccw) */
444 
445  else {
446  if (!kpoly) {
447  _printf_("Warning -- Shape " << i << " of type \"" << SHPTypeName( pstype[i] ) << "\", part " << j << ", expected to be outer loop (cw).\n\n");
448  continue;
449  }
450 
451 /* add the inner ring to the current polygon */
452 
453  kring =new KML_LinearRing();
454 
455  kring->ncoord =(j<pnpart[i]-1 ? ppstrt[i][j+1]-ppstrt[i][j] : pnvert[i]-ppstrt[i][j]);
456  kring->coords =xNew<double>(kring->ncoord*3);
457  for (k=0; k<kring->ncoord; k++) {
458  kring->coords[3*k+0]=lon [ppstrt[i][j]+k];
459  kring->coords[3*k+1]=lat [ppstrt[i][j]+k];
460  kring->coords[3*k+2]=pshapz[i][ppstrt[i][j]+k];
461  }
462 
463  (kpoly ->inner )->AddObject((Object*)kring);
464  kring =NULL;
465  }
466  }
467 
468  if (kpoly) {
469  (kmulti->geometry )->AddObject((Object*)kpoly);
470  kpoly =NULL;
471  }
472 
473  xDelete<double>(lon);
474  xDelete<double>(lat);
475 
476  (kplace->geometry )->AddObject((Object*)kmulti);
477  kmulti=NULL;
478  (kfold ->feature )->AddObject((Object*)kplace);
479  kplace=NULL;
480  }
481 
482 /* multipoint types */
483 
484  else if (pstype[i] == SHPT_MULTIPOINT ||
485  pstype[i] == SHPT_MULTIPOINTZ ||
486  pstype[i] == SHPT_MULTIPOINTM) {
487  kplace=new KML_Placemark();
488 
489  sprintf(kplace->name ,"Shape:%d (%s) nVertices=%d, nParts=%d",
490  i,SHPTypeName(pstype[i]),pnvert[i],pnpart[i]);
491  kplace->visibility=true;
492  sprintf(kplace->styleurl ,"#RandomLineEmptyPoly");
493 
494  if (pnpart[i] > 0)
495  _printf_("Warning -- Shape " << i << " of type \"" << SHPTypeName( pstype[i] ) << "\" should not have " << pnpart[i] << " > 0 parts.\n\n");
496 
497 /* create a multigeometry to hold all the points */
498 
499  kmulti=new KML_MultiGeometry();
500 
501 /* convert to lat/lon, if necessary */
502 
503  lat=xNew<double>(pnvert[i]);
504  lon=xNew<double>(pnvert[i]);
505  if (sgn) {
506  Xy2llx(lat,lon,pshapx[i],pshapy[i],pnvert[i],sgn,cm,sp);
507  }
508  else {
509  memcpy(lon,pshapx[i],pnvert[i]*sizeof(double));
510  memcpy(lat,pshapy[i],pnvert[i]*sizeof(double));
511  }
512 
513 /* loop over the points */
514 
515  for (j=0; j<pnvert[i]; j++) {
516  kpoint=new KML_Point();
517 
518  kpoint->coords[0]=lon [j];
519  kpoint->coords[1]=lat [j];
520  kpoint->coords[2]=pshapz[i][j];
521 
522  (kmulti->geometry )->AddObject((Object*)kpoint);
523  kpoint=NULL;
524  }
525 
526  xDelete<double>(lon);
527  xDelete<double>(lat);
528 
529  (kplace->geometry )->AddObject((Object*)kmulti);
530  kmulti=NULL;
531  (kfold ->feature )->AddObject((Object*)kplace);
532  kplace=NULL;
533  }
534 
535 /* multipatch types */
536 
537  else if (pstype[i] == SHPT_MULTIPATCH) {
538  _printf_("Warning -- Shape " << i << " of type \"" << SHPTypeName( pstype[i] ) << "\" will be ignored.\n\n");
539  continue;
540  }
541 
542 /* unknown type */
543 
544  else {
545  _printf_("Warning -- Shape " << i << " of type \"" << SHPTypeName( pstype[i] ) << "\" will be ignored.\n\n");
546  }
547  }
548 
549 /* assemble the rest of the kml hierarchy */
550 
551  (kdoc ->feature )->AddObject((Object*)kfold);
552  kfold=NULL;
553  (kfile->kmlobj )->AddObject((Object*)kdoc);
554  kdoc =NULL;
555 
556 /* write kml file */
557 
558  _printf0_("Writing kml document to file.\n");
559  fid=fopen(filkml,"w");
560  fprintf(fid,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
561  kfile->Write(fid,indent);
562  fclose(fid);
563 
564  delete kfile;
565  for (i=nshape-1; i>=0; i--) {
566  xDelete<double>((pshapm[i]));
567  xDelete<double>((pshapz[i]));
568  xDelete<double>((pshapy[i]));
569  xDelete<double>((pshapx[i]));
570  }
571  xDelete<double*>(pshapm);
572  xDelete<double*>(pshapz);
573  xDelete<double*>(pshapy);
574  xDelete<double*>(pshapx);
575  xDelete<int>(pnvert);
576  for (i=nshape-1; i>=0; i--) {
577  xDelete<int>((pptype[i]));
578  xDelete<int>((ppstrt[i]));
579  }
580  xDelete<int*>(pptype);
581  xDelete<int*>(ppstrt);
582  xDelete<int>(pnpart);
583  xDelete<int>(pstype);
584 
585  clock1=clock();
586  time1 =time(NULL);
587  _printf_("Shp2Kmlx Module -- " << ((double)(clock1-clock0))/CLOCKS_PER_SEC << " CPU seconds; " << difftime(time1,time0) << " elapsed seconds.\n\n\n");
588 
589  return(iret);
590 
591  #else //ifdef _HAVE_SHAPELIB_
592  return 0;
593  #endif
594 }
KML_Document
Definition: KML_Document.h:15
KML_Feature::name
char name[KML_FEATURE_NAME_LENGTH+1]
Definition: KML_Feature.h:25
_printf0_
#define _printf0_(StreamArgs)
Definition: Print.h:29
KML_LineString::coords
double * coords
Definition: KML_LineString.h:24
KML_LinearRing::coords
double * coords
Definition: KML_LinearRing.h:24
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
KML_LineStyle::width
float width
Definition: KML_LineStyle.h:18
KML_Container::feature
DataSet * feature
Definition: KML_Container.h:19
KML_Placemark::geometry
DataSet * geometry
Definition: KML_Placemark.h:20
KML_Polygon::outer
DataSet * outer
Definition: KML_Polygon.h:25
KML_Point::coords
double coords[3]
Definition: KML_Point.h:22
KML_ColorStyle::colormode
char colormode[KML_COLORSTYLE_COLORMODE_LENGTH+1]
Definition: KML_ColorStyle.h:22
KML_File::Write
void Write(FILE *fid, const char *indent)
Definition: KML_File.cpp:63
KML_Feature::style
DataSet * style
Definition: KML_Feature.h:31
KML_Feature::open
bool open
Definition: KML_Feature.h:27
KML_Folder
Definition: KML_Folder.h:15
KML_Style::line
KML_LineStyle * line
Definition: KML_Style.h:22
KML_Object::kmlobj
DataSet * kmlobj
Definition: KML_Object.h:19
Object
Definition: Object.h:13
KML_Feature::styleurl
char styleurl[KML_FEATURE_STYLEURL_LENGTH+1]
Definition: KML_Feature.h:30
KML_Polygon
Definition: KML_Polygon.h:18
KML_Placemark
Definition: KML_Placemark.h:16
KML_Style
Definition: KML_Style.h:16
KML_MultiGeometry::geometry
DataSet * geometry
Definition: KML_MultiGeometry.h:20
KML_File
Definition: KML_File.h:16
KML_Point
Definition: KML_Point.h:16
KML_LinearRing
Definition: KML_LinearRing.h:16
KML_LinearRing::ncoord
int ncoord
Definition: KML_LinearRing.h:23
KML_Object::AddAttrib
virtual void AddAttrib(const char *name, const char *value)
Definition: KML_Object.cpp:277
Xy2llx
int Xy2llx(double *lat, double *lon, double *x, double *y, int ncoord, int sgn)
Definition: Xy2llx.cpp:8
KML_Feature::visibility
bool visibility
Definition: KML_Feature.h:26
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
KML_LineStyle
Definition: KML_LineStyle.h:14
KML_Polygon::inner
DataSet * inner
Definition: KML_Polygon.h:26
KML_MultiGeometry
Definition: KML_MultiGeometry.h:16
KML_LineString
Definition: KML_LineString.h:16
Xy2lldef
void Xy2lldef(double *pdelta, double *pslat, int sgn)
Definition: Xy2llx.cpp:100
KML_PolyStyle
Definition: KML_PolyStyle.h:14
KML_Style::poly
KML_PolyStyle * poly
Definition: KML_Style.h:23
KML_LineString::ncoord
int ncoord
Definition: KML_LineString.h:23
Shp2Kmlx
int Shp2Kmlx(char *filshp, char *filkml, int sgn)
Definition: Shp2Kmlx.cpp:10
KML_ColorStyle::color
char color[KML_COLORSTYLE_COLOR_LENGTH+1]
Definition: KML_ColorStyle.h:21