Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)

To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
This commit is contained in:
Konstantin Pastbin
2025-04-13 16:37:30 +07:00
commit e3e4a1985a
12931 changed files with 13195100 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
project(poly_borders_tool)
set(SRC poly_borders_tool.cpp)
omim_add_executable(${PROJECT_NAME} ${SRC})
target_link_libraries(${PROJECT_NAME}
poly_borders
gflags::gflags
)

View File

@@ -0,0 +1,65 @@
#include "poly_borders/borders_data.hpp"
#include "poly_borders/help_structures.hpp"
#include "platform/platform.hpp"
#include "base/assert.hpp"
#include "base/exception.hpp"
#include "base/logging.hpp"
#include <exception>
#include <gflags/gflags.h>
DEFINE_string(borders_path, "", "Path to directory with *.poly files.");
DEFINE_string(output_path, "", "Path to target directory where the output *.poly files will be placed.");
using namespace poly_borders;
int main(int argc, char ** argv)
{
gflags::ParseCommandLineFlags(&argc, &argv, true);
gflags::SetUsageMessage("\n\n\tThe tool is used to process *.poly borders files. We use such files\n"
"\tto cut the planet into mwms in generator. The problem is that we have\n"
"\tempty spaces between neighbouring borders. This tool creates new borders\n"
"\tbased on input data by removing points from borders in such a way that the\n"
"\tchanged area of each border will not be too large.\n"
"\tArguments:\n"
"\t\t--borders_path=/path/to/directory/with/borders\n"
"\t\t--output_path=/path/to/directory/where/new/borders/will/be/placed\n");
if (FLAGS_borders_path.empty() || FLAGS_output_path.empty())
{
gflags::ShowUsageWithFlags("poly_borders_postprocessor");
return 0;
}
CHECK_NOT_EQUAL(FLAGS_borders_path, FLAGS_output_path, ());
CHECK(Platform::IsDirectory(FLAGS_borders_path), ("Cannot find directory:", FLAGS_borders_path));
CHECK(Platform::IsDirectory(FLAGS_output_path), ("Cannot find directory:", FLAGS_output_path));
try
{
BordersData data;
data.Init(FLAGS_borders_path);
data.MarkPoints();
data.RemoveEmptySpaceBetweenBorders();
data.MarkPoints();
data.PrintDiff();
data.DumpPolyFiles(FLAGS_output_path);
}
catch (RootException const & e)
{
LOG(LERROR, ("Core exception:", e.Msg()));
}
catch (std::exception const & e)
{
LOG(LERROR, ("Std exception:", e.what()));
}
catch (...)
{
LOG(LERROR, ("Unknown exception."));
}
return 0;
}