Пример #1
0
CountryInfoGetter::CountryInfoGetter(ModelReaderPtr polyR, ModelReaderPtr countryR)
  : m_reader(polyR), m_cache(3)
{
  ReaderSource<ModelReaderPtr> src(m_reader.GetReader(PACKED_POLYGONS_INFO_TAG));
  rw::Read(src, m_countries);

  string buffer;
  countryR.ReadAsString(buffer);
  LoadCountryFile2CountryInfo(buffer, m_id2info);
}
Пример #2
0
  CountryInfoGetter::CountryInfoGetter(ModelReaderPtr polyR, ModelReaderPtr countryR)
    : m_reader(polyR), m_cache(3)
  {
    ReaderSource<ModelReaderPtr> src(m_reader.GetReader(PACKED_POLYGONS_INFO_TAG));
    rw::Read(src, m_countries);

/*
    // We can't change the order of countries.
#ifdef DEBUG
    LessCountryDef check;
    for (size_t i = 0; i < m_countries.size() - 1; ++i)
      ASSERT ( !check(m_countries[i+1], m_countries[i]),
               (m_countries[i].m_name, m_countries[i+1].m_name) );
#endif
*/

    string buffer;
    countryR.ReadAsString(buffer);
    LoadCountryFile2CountryInfo(buffer, m_id2info);
  }