int main(int argc, char ** argv)
{
  google::SetUsageMessage("This tool extracts some staticstics about features and its altitudes.");
  google::ParseCommandLineFlags(&argc, &argv, true);

  LOG(LINFO, ("srtm_dir_path =", FLAGS_srtm_dir_path));
  LOG(LINFO, ("mwm_file_path =", FLAGS_mwm_file_path));

  classificator::Load();
  generator::SrtmTileManager manager(FLAGS_srtm_dir_path);

  Processor processor(manager);
  feature::ForEachFromDat(FLAGS_mwm_file_path, processor);

  cout << endl << "Road feature count = " << processor.m_roadCount << endl;
  cout << "Empty road feature count = " << processor.m_emptyRoadCount << endl;
  cout << "Unique road points count = " << processor.m_uniqueRoadPoints.size() << endl;
  cout << "All road point count = " << processor.m_roadPointCount << endl;
  cout << "Not road feature count = " << processor.m_notRoadCount << endl;

  PrintCont(processor.m_altitudeDiffs, "Altitude difference between start and end of features.",
            " feature(s) with altitude difference ", " meter(s)");
  WriteCSV(processor.m_altitudeDiffs, "altitude_difference.csv");

  PrintCont(processor.m_featureLength, "Feature length.", " feature(s) with length ", " meter(s)");
  WriteCSV(processor.m_featureLength, "feature_length.csv");

  PrintCont(processor.m_segLength, "Feature segment length.", " segment(s) with length ",
            " meter(s)");

  PrintCont(processor.m_featureWave, "Wave factor", " feature(s) with wave factor ", "");
  WriteCSV(processor.m_featureWave, "feature_wave.csv");

  PrintCont(processor.m_featureUp, "Feature go up in meters", " feature(s) go up ", " meter(s)");
  WriteCSV(processor.m_featureUp, "feature_up.csv");

  PrintCont(processor.m_featureDown, "Feature go down in meters", " feature(s) go down ", " meter(s)");
  WriteCSV(processor.m_featureDown, "feature_down.csv");

  PrintCont(processor.m_diffFromLinear, "Altitude deviation of internal feature points from linear model.",
            " internal feature point(s) deviate from linear model with ", " meter(s)");
  return 0;
}
Esempio n. 2
0
bool FDBFile::WriteToFile(const char* filename, FDBPackage::e_export_format e)
{
    if (e==FDBPackage::EX_NONE) e = DefaultFormat();

    assert(ExportFormatIsValid(e));

    bool res=false;
    switch (e)
    {
        case FDBPackage::EX_RAW:
            res = WriteRAW(filename);
            break;

        case FDBPackage::EX_INI:
            res = WriteINI(filename);
            break;

        case FDBPackage::EX_LUA:
            res = WriteLUA(filename);
            break;

        case FDBPackage::EX_CSV:
            res = WriteCSV( GetTargetName( filename, e).c_str());
            break;

        case FDBPackage::EX_SQLITE:
            res = WriteSQLITE(GetTargetName( filename, e).c_str());
            break;

        case FDBPackage::EX_MYSQL:
            res = WriteMySQL(GetTargetName( filename, e).c_str());
            break;
    }

    return res;
}
Esempio n. 3
0
void EvalFileWriteCSV(const void *mode, qCtx *ctx, qStr *out, qArgAry *args)
{
	WriteCSV(mode, false, ctx, out, args);
}