Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Application::TagsLife::Tag::readGeo ( string  xmlFile  )  [inline, private]

Definition at line 156 of file Tag.h.

References Impala::atof(), Impala::atoi(), Impala::Util::XmlDoc::GetAttributeValue(), Impala::Util::XmlDoc::GetChildNode(), Impala::Util::XmlDoc::GetChildNodes(), ILOG_ERROR, ILOG_INFO, Impala::Persistency::XmlFileReader::Read(), and weekStats.

Referenced by Tag().

00156                                  {
00157         Persistency::XmlFileReader reader;
00158         ILOG_INFO("reading XML file: " + xmlFile);
00159         DOMDocument* doc = reader.Read(xmlFile, false);
00160         if(doc == 0) {
00161                 ILOG_ERROR("Failed to read XML file: " + xmlFile);
00162                 return;
00163         }
00164                 DOMNode* root = GetChildNode(doc, "geodata", true);
00165 
00166                 vector<DOMNode*> weekstats = GetChildNodes(root, "weekstats");
00167                 ILOG_INFO("GEO: weekstats.size = " << weekstats.size());
00168                 for(uint i=0; i < weekstats.size(); i++) {
00169                         uint flickrWeek = atoi(GetAttributeValue(weekstats[i], "flickrweek"));
00170 
00171                         vector<DOMNode*> bboxes = GetChildNodes(weekstats[i], "bbox");
00172                         geoDataType boxes;
00173                         for(uint j=0; j < bboxes.size(); j++) {
00174                                 uint count = atoi(GetAttributeValue(bboxes[j], "count"));
00175                                 if(count == 0) continue;
00176                                 string boxid = GetAttributeValue(bboxes[j], "boxid");
00177                                 float left = atof(GetAttributeValue(bboxes[j], "left"));
00178                                 float right = atof(GetAttributeValue(bboxes[j], "right"));
00179                                 float top = atof(GetAttributeValue(bboxes[j], "top"));
00180                                 float bottom = atof(GetAttributeValue(bboxes[j], "bottom"));
00181 
00182                                 boxes[boxid] = new BoundingBox(boxid, count, left, right, top, bottom);
00183                         }
00184                         if(boxes.size() > 0) weekStats[flickrWeek]->geoData = boxes;
00185                 }
00186     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:51:40 2010 for ImpalaSrc by  doxygen 1.5.1