Changeset 14281
- Timestamp:
- 01/23/13 10:18:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Shp2Expx/Shp2Expx.cpp
r14279 r14281 49 49 50 50 char indent[81]=""; 51 KML_File *kfile = NULL; 52 KML_Document *kdoc = NULL; 53 KML_Style *kstyle = NULL; 54 KML_LineStyle *klsty = NULL; 55 KML_PolyStyle *kpsty = NULL; 51 56 KML_Folder *kfold = NULL; 52 57 KML_Placemark *kplace = NULL; … … 199 204 200 205 SHPClose( hSHP ); 206 207 /* construct kml file */ 208 209 kfile =new KML_File(); 210 kfile->AddAttrib("xmlns","http://www.opengis.net/kml/2.2"); 211 212 /* construct kml document */ 213 214 kdoc =new KML_Document(); 215 sprintf(kdoc->name ,"Shp2Kmlx Module -- %s",ctime(&time0)); 216 kdoc->open =1; 217 218 /* construct style templates for defaults */ 219 220 klsty =new KML_LineStyle(); 221 sprintf(klsty->color ,"ff000000"); 222 sprintf(klsty->colormode ,"normal"); 223 klsty->width =lwidth; 224 kpsty =new KML_PolyStyle(); 225 sprintf(kpsty->color ,"%02xffffff",(int)floor(popac*255+0.5)); 226 sprintf(kpsty->colormode ,"random"); 227 kstyle=new KML_Style(); 228 kstyle->AddAttrib("id","BlackLineRandomPoly"); 229 kstyle->line =klsty; 230 kstyle->poly =kpsty; 231 (kdoc->style )->AddObject((Object*)kstyle); 232 233 klsty =new KML_LineStyle(); 234 sprintf(klsty->color ,"ff000000"); 235 sprintf(klsty->colormode ,"normal"); 236 klsty->width ,lwidth; 237 kpsty =new KML_PolyStyle(); 238 sprintf(kpsty->color ,"00ffffff"); 239 sprintf(kpsty->colormode ,"random"); 240 kstyle=new KML_Style(); 241 kstyle->AddAttrib("id","BlackLineEmptyPoly"); 242 kstyle->line =klsty; 243 kstyle->poly =kpsty; 244 (kdoc->style )->AddObject((Object*)kstyle); 245 246 klsty =new KML_LineStyle(); 247 sprintf(klsty->color ,"%02xffffff",(int)floor(popac*255+0.5)); 248 sprintf(klsty->colormode ,"random"); 249 klsty->width =lwidth*2; 250 kpsty =new KML_PolyStyle(); 251 sprintf(kpsty->color ,"00ffffff"); 252 sprintf(kpsty->colormode ,"random"); 253 kstyle=new KML_Style(); 254 kstyle->AddAttrib("id","RandomLineEmptyPoly"); 255 kstyle->line =klsty; 256 kstyle->poly =kpsty; 257 (kdoc->style )->AddObject((Object*)kstyle); 201 258 202 259 /* construct kml folder for shapes */ … … 507 564 } 508 565 566 /* assemble the rest of the kml hierarchy */ 567 568 (kdoc ->feature )->AddObject((Object*)kfold); 569 kfold=NULL; 570 (kfile->kmlobj )->AddObject((Object*)kdoc); 571 kdoc =NULL; 572 509 573 /* open exp file */ 510 574 511 512 575 _pprintLine_("Writing exp profiles to file."); 576 fid=fopen(filexp,"w"); 513 577 514 578 /* write the polygons and linestrings */ 515 579 516 kfold->WriteExp(fid,"",sgn,cm,sp);580 kfile->WriteExp(fid,"",sgn,cm,sp); 517 581 518 582 /* close exp file */ 519 583 520 521 522 delete kf old;584 fclose(fid); 585 586 delete kfile; 523 587 for (i=nshape-1; i>=0; i--) { 524 588 xDelete<double>((pshapm[i]));
Note:
See TracChangeset
for help on using the changeset viewer.