Ignore:
Timestamp:
06/01/11 09:13:35 (14 years ago)
Author:
jschierm
Message:

KML: Addition of KMLFileRead module and KML_Attribute class, along with many other changes during freeze.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/KML/KML_Placemark.cpp

    r8293 r8461  
    8181        if (geometry->Size())
    8282                for (i=0; i<geometry->Size(); i++) {
    83                         _printf_(flag,"%s      geometry: [%d] begin\n" ,indent,i);
     83                        _printf_(flag,"%s      geometry: -------- begin [%d] --------\n" ,indent,i);
    8484                        ((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2);
    85                         _printf_(flag,"%s      geometry: [%d] end\n"  ,indent,i);
     85                        _printf_(flag,"%s      geometry: --------  end  [%d] --------\n" ,indent,i);
    8686                }
    8787        else
     
    9898        char  indent2[81];
    9999
    100         if (this->id && strlen(this->id))
    101                 fprintf(filout,"%s<Placemark id=\"%s\">\n",indent,this->id);
    102         else
    103                 fprintf(filout,"%s<Placemark>\n",indent);
     100        fprintf(filout,"%s<Placemark",indent);
     101        WriteAttrib(filout," ");
     102        fprintf(filout,">\n");
    104103
    105104        KML_Feature::Write(filout,indent);
     
    125124        KML_Object*  kobj;
    126125
    127 /*  check for id attribute  */
     126/*  get object attributes  */
    128127
    129 //      KML_Object::Read(fid,kstr);
    130         KMLFileTagAttrib( id        ,NULL,KML_OBJECT_ID_LENGTH,
    131                                          kstr,
    132                                          "id");
     128        KMLFileTagAttrib(this,
     129                                         kstr);
    133130
    134131/*  loop over and process fields within opening and closing tags  */
     
    144141                        _error_("KML_Placemark::Read -- Unexpected field \"%s\".\n",kstri);
    145142
     143//              else if (!strncmp(kstri,"<Point", 6)) {
     144//                      kobj=(KML_Object*)new KML_Point();
     145//                      kobj->Read(fid,kstri);
     146//                      geometry  ->AddObject((Object*)kobj);
     147//              }
     148
    146149                else if (!strncmp(kstri,"<LineString",11)) {
    147150                        kobj=(KML_Object*)new KML_LineString();
    148                         kobj->Read(fid,kstr);
     151                        kobj->Read(fid,kstri);
    149152                        geometry  ->AddObject((Object*)kobj);
    150153                }
     
    152155                else if (!strncmp(kstri,"<LinearRing",11)) {
    153156                        kobj=(KML_Object*)new KML_LinearRing();
    154                         kobj->Read(fid,kstr);
     157                        kobj->Read(fid,kstri);
    155158                        geometry  ->AddObject((Object*)kobj);
    156159                }
     
    158161                else if (!strncmp(kstri,"<Polygon", 8)) {
    159162                        kobj=(KML_Object*)new KML_Polygon();
    160                         kobj->Read(fid,kstr);
     163                        kobj->Read(fid,kstri);
    161164                        geometry  ->AddObject((Object*)kobj);
    162165                }
     
    164167                else if (!strncmp(kstri,"<MultiGeometry",14)) {
    165168                        kobj=(KML_Object*)new KML_MultiGeometry();
    166                         kobj->Read(fid,kstr);
     169                        kobj->Read(fid,kstri);
    167170                        geometry  ->AddObject((Object*)kobj);
    168171                }
Note: See TracChangeset for help on using the changeset viewer.