Ejemplo n.º 1
0
bool CountDataSize(const osmscout::ImportParameter& parameter,
                   osmscout::Progress& progress,
                   double& dataSize)
{
  std::string              fileName;
  osmscout::FileOffset     fileSize=0;
  std::vector<std::string> files;

  files.push_back("types.dat");
  files.push_back("bounding.dat");

  files.push_back("nodes.dat");
  files.push_back("areas.dat");
  files.push_back("ways.dat");

  files.push_back("areasopt.dat");
  files.push_back("waysopt.dat");

  files.push_back("areanode.idx");
  files.push_back("areaarea.idx");
  files.push_back("areaway.idx");

  files.push_back("location.idx");

  files.push_back("water.idx");

  if (!parameter.GetRouter().empty()) {
    files.push_back("intersections.dat");
    files.push_back("intersections.idx");

    for (const auto& router : parameter.GetRouter()) {
      files.push_back(router.GetDataFilename());
      files.push_back(router.GetVariantFilename());
      files.push_back(router.GetIndexFilename());
    }
  }

  dataSize=0;

  for (const auto& filename : files) {
    std::string filePath=osmscout::AppendFileToDir(parameter.GetDestinationDirectory(),
                                                   filename);

    if (!GetFileSize(filePath,
                     fileSize)) {
      return false;
    }

    progress.Info(std::string("File ")+filename+": "+osmscout::ByteSizeToString(fileSize));

    dataSize+=fileSize;
  }

  return true;
}
Ejemplo n.º 2
0
bool DumpDataSize(const osmscout::ImportParameter& parameter,
                  const osmscout::Importer& importer,
                  osmscout::Progress& progress)
{
  osmscout::FileOffset dataSize=0;

  progress.Info("Mandatory files:");

  try {
    for (const auto& filename : importer.GetProvidedFiles()) {
      osmscout::FileOffset fileSize=0;
      std::string          filePath=osmscout::AppendFileToDir(parameter.GetDestinationDirectory(),
                                                              filename);

      fileSize=osmscout::GetFileSize(filePath);

      progress.Info(std::string("File ")+filename+": "+osmscout::ByteSizeToString(fileSize));

      dataSize+=fileSize;
    }

    progress.Info(std::string("=> ")+osmscout::ByteSizeToString(dataSize));

    progress.Info("Optional files:");

    dataSize=0;
    for (const auto& filename : importer.GetProvidedOptionalFiles()) {
      osmscout::FileOffset fileSize=0;
      std::string          filePath=osmscout::AppendFileToDir(parameter.GetDestinationDirectory(),
                                                              filename);

      fileSize=osmscout::GetFileSize(filePath);

      progress.Info(std::string("File ")+filename+": "+osmscout::ByteSizeToString(fileSize));

      dataSize+=fileSize;
    }

    progress.Info(std::string("=> ")+osmscout::ByteSizeToString(dataSize));
  }
  catch (osmscout::IOException& e) {
    progress.Error(e.GetDescription());
    return false;
  }

  return true;
}
Ejemplo n.º 3
0
void DumpHelp(osmscout::ImportParameter& parameter)
{
  std::cout << "Import -h -d -s <start step> -e <end step> [openstreetmapdata.osm|openstreetmapdata.osm.pbf]..." << std::endl;
  std::cout << " -h|--help                            show this help" << std::endl;
  std::cout << " -d                                   show debug output" << std::endl;
  std::cout << " -s <start step>                      set starting step" << std::endl;
  std::cout << " -s <end step>                        set final step" << std::endl;
  std::cout << " --typefile <path>                    path and name of the map.ost file (default: " << parameter.GetTypefile() << ")" << std::endl;
  std::cout << " --destinationDirectory <path>        destination for generated map files (default: " << parameter.GetDestinationDirectory() << ")" << std::endl;

  std::cout << " --router <router description>        definition of a router (default: car,bicycle,foot:router)" << std::endl;

  std::cout << " --strictAreas true|false             assure that areas are simple (default: " << BoolToString(parameter.GetStrictAreas()) << ")" << std::endl;

  std::cout << " --numericIndexPageSize <number>      size of an numeric index page in bytes (default: " << parameter.GetNumericIndexPageSize() << ")" << std::endl;

  std::cout << " --coordDataMemoryMaped true|false    memory maped coord data file access (default: " << BoolToString(parameter.GetCoordDataMemoryMaped()) << ")" << std::endl;

  std::cout << " --rawNodeDataMemoryMaped true|false  memory maped raw node data file access (default: " << BoolToString(parameter.GetRawNodeDataMemoryMaped()) << ")" << std::endl;

  std::cout << " --rawWayIndexMemoryMaped true|false  memory maped raw way index file access (default: " << BoolToString(parameter.GetRawWayIndexMemoryMaped()) << ")" << std::endl;
  std::cout << " --rawWayDataMemoryMaped true|false   memory maped raw way data file access (default: " << BoolToString(parameter.GetRawWayDataMemoryMaped()) << ")" << std::endl;
  std::cout << " --rawWayIndexCacheSize <number>      raw way index cache size (default: " << parameter.GetRawWayIndexCacheSize() << ")" << std::endl;
  std::cout << " --rawWayBlockSize <number>           number of raw ways resolved in block (default: " << parameter.GetRawWayBlockSize() << ")" << std::endl;

  std::cout << " --noSort                             do not sort objects" << std::endl;
  std::cout << " --sortBlockSize <number>             size of one data block during sorting (default: " << parameter.GetSortBlockSize() << ")" << std::endl;

  std::cout << " --areaDataMemoryMaped true|false     memory maped area data file access (default: " << BoolToString(parameter.GetAreaDataMemoryMaped()) << ")" << std::endl;
  std::cout << " --areaDataCacheSize <number>         area data cache size (default: " << parameter.GetAreaDataCacheSize() << ")" << std::endl;

  std::cout << " --wayDataMemoryMaped true|false      memory maped way data file access (default: " << BoolToString(parameter.GetWayDataMemoryMaped()) << ")" << std::endl;
  std::cout << " --wayDataCacheSize <number>          way data cache size (default: " << parameter.GetWayDataCacheSize() << ")" << std::endl;

  std::cout << " --routeNodeBlockSize <number>        number of route nodes resolved in block (default: " << parameter.GetRouteNodeBlockSize() << ")" << std::endl;
}