diff --git a/externals/buildsys/cmake b/externals/buildsys/cmake index 7e658f4..004807b 160000 --- a/externals/buildsys/cmake +++ b/externals/buildsys/cmake @@ -1 +1 @@ -Subproject commit 7e658f4274f8c16c5cce936c7631588c6f03980d +Subproject commit 004807bda3c356abb4e4bcc2faaea5c15824acda diff --git a/externals/buildsys/common b/externals/buildsys/common index 4a237e7..c81bb04 160000 --- a/externals/buildsys/common +++ b/externals/buildsys/common @@ -1 +1 @@ -Subproject commit 4a237e79bc3773ab66874ce9d0f27dff9ce90327 +Subproject commit c81bb045223b907011268aa89ac3e4a0ede6ed0e diff --git a/externals/gdal-drivers b/externals/gdal-drivers index 8270fde..3f4f91d 160000 --- a/externals/gdal-drivers +++ b/externals/gdal-drivers @@ -1 +1 @@ -Subproject commit 8270fde6b1d8d2db31798946f0d5a553aa1362b8 +Subproject commit 3f4f91ddb1384dacc07243e74c5fa7ed13c2771a diff --git a/externals/libdbglog b/externals/libdbglog index ca161f4..a7119d1 160000 --- a/externals/libdbglog +++ b/externals/libdbglog @@ -1 +1 @@ -Subproject commit ca161f42ff44fe86b15d71e48237fd2a9fa3affb +Subproject commit a7119d160140d449dcc15baf475dbf6dc989b33f diff --git a/externals/libgeo b/externals/libgeo index 847e8e0..6ff3630 160000 --- a/externals/libgeo +++ b/externals/libgeo @@ -1 +1 @@ -Subproject commit 847e8e0be6d4c3407849ab4802c3677dc298ed2b +Subproject commit 6ff3630d2767555c1afcecae72257c38dfd7c0a8 diff --git a/externals/libgeometry b/externals/libgeometry index f92d32e..bb4d0b8 160000 --- a/externals/libgeometry +++ b/externals/libgeometry @@ -1 +1 @@ -Subproject commit f92d32e88e9eb5eb828d76be844e31f7579fc32c +Subproject commit bb4d0b8afb22db7d47c1c5159139cc5c16e12933 diff --git a/externals/libhttp b/externals/libhttp index bdcf800..3627605 160000 --- a/externals/libhttp +++ b/externals/libhttp @@ -1 +1 @@ -Subproject commit bdcf800b90c5f1f61da5941fba422976fdb079c3 +Subproject commit 362760551d3605d09878e07716d1f6c33ce62d92 diff --git a/externals/libimgproc b/externals/libimgproc index d0ad209..a206125 160000 --- a/externals/libimgproc +++ b/externals/libimgproc @@ -1 +1 @@ -Subproject commit d0ad209a836fcb23d13c44a2b79368df7e4332a2 +Subproject commit a2061256708361d85e3aa8ac4f02f99e9a337c1b diff --git a/externals/libjsoncpp b/externals/libjsoncpp index bfb4f6c..b4076c4 160000 --- a/externals/libjsoncpp +++ b/externals/libjsoncpp @@ -1 +1 @@ -Subproject commit bfb4f6c58fe7a8bd85bcaf1aa409087410b3ca5a +Subproject commit b4076c43dbd391be82b9b8b6b1dd28ba16993a4d diff --git a/externals/libmath b/externals/libmath index 3fb0e0b..a5cb7fa 160000 --- a/externals/libmath +++ b/externals/libmath @@ -1 +1 @@ -Subproject commit 3fb0e0ba785157d0e6d7fc41767d5c9811b2f216 +Subproject commit a5cb7fa7e7ec2ca76bc93f95b4bd604f90e68f5b diff --git a/externals/libminiball b/externals/libminiball index 53e1e74..7723d09 160000 --- a/externals/libminiball +++ b/externals/libminiball @@ -1 +1 @@ -Subproject commit 53e1e74694520e69ade78ffca673705cef2349ee +Subproject commit 7723d0906640e816de0d886441a113dfc93a8f85 diff --git a/externals/libpydbglog b/externals/libpydbglog index db86fda..74dcab4 160000 --- a/externals/libpydbglog +++ b/externals/libpydbglog @@ -1 +1 @@ -Subproject commit db86fda50582664dee1b2ce957145d85c2a17e7b +Subproject commit 74dcab4c2592bd47e6f352b33c54334d6637a076 diff --git a/externals/libpysupport b/externals/libpysupport index 4e20f30..42f392d 160000 --- a/externals/libpysupport +++ b/externals/libpysupport @@ -1 +1 @@ -Subproject commit 4e20f30c32481299a572dbff87788acccf15361d +Subproject commit 42f392d787286764cdb32aa435c744b02111e30a diff --git a/externals/libsemantic b/externals/libsemantic index 37a4d4f..1a1fed0 160000 --- a/externals/libsemantic +++ b/externals/libsemantic @@ -1 +1 @@ -Subproject commit 37a4d4fac195cf7cf14a33de3290ed85ce4e5159 +Subproject commit 1a1fed0560ca806b55481a8a295e83df54cca79b diff --git a/externals/libservice b/externals/libservice index 554c6e4..c79675c 160000 --- a/externals/libservice +++ b/externals/libservice @@ -1 +1 @@ -Subproject commit 554c6e4d5ea466e5dc6aa2f67325757c61741539 +Subproject commit c79675c2aaa27bbd3dbefbb4640f83e0a3127f3d diff --git a/externals/libshtools b/externals/libshtools index 81c45f7..74734b3 160000 --- a/externals/libshtools +++ b/externals/libshtools @@ -1 +1 @@ -Subproject commit 81c45f710059f8539f12ae124d7dea8bdfc4882e +Subproject commit 74734b3fdce2377f939db71b31c59a6a8b35bb72 diff --git a/externals/libutility b/externals/libutility index 1bc5201..640d02c 160000 --- a/externals/libutility +++ b/externals/libutility @@ -1 +1 @@ -Subproject commit 1bc5201029833d3cc97776a6caa3022bfae9a26f +Subproject commit 640d02ca66d9a8831b9ba4bd03837a9b6f487ca5 diff --git a/externals/vts-libs b/externals/vts-libs index d1df91f..67399ac 160000 --- a/externals/vts-libs +++ b/externals/vts-libs @@ -1 +1 @@ -Subproject commit d1df91f43e49a35084e25ea0cc3e7c14705036bf +Subproject commit 67399ac4b37778e0d374f665f1c4075c0a0aba7d diff --git a/mapproxy/src/calipers/CMakeLists.txt b/mapproxy/src/calipers/CMakeLists.txt index 9613c0c..817d264 100644 --- a/mapproxy/src/calipers/CMakeLists.txt +++ b/mapproxy/src/calipers/CMakeLists.txt @@ -10,7 +10,7 @@ set(mp-calipers_SOURCES add_library(mp-calipers ${mp-calipers_SOURCES}) target_link_libraries(mp-calipers ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mp-calipers ${MODULE_DEFINITIONS}) +target_compile_definitions(mp-calipers PRIVATE ${MODULE_DEFINITIONS}) buildsys_library(mp-calipers) # ------------------------------------------------------------------------ @@ -29,7 +29,7 @@ set(mapproxy-calipers_SOURCES add_executable(mapproxy-calipers ${mapproxy-calipers_SOURCES}) target_link_libraries(mapproxy-calipers mp-calipers ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-calipers ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-calipers PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-calipers) set_target_version(mapproxy-calipers ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/generatevrtwo/CMakeLists.txt b/mapproxy/src/generatevrtwo/CMakeLists.txt index a3246c3..f7b3975 100644 --- a/mapproxy/src/generatevrtwo/CMakeLists.txt +++ b/mapproxy/src/generatevrtwo/CMakeLists.txt @@ -10,7 +10,7 @@ set(mp-generatevrtwo_SOURCES add_library(mp-generatevrtwo ${mp-generatevrtwo_SOURCES}) target_link_libraries(mp-generatevrtwo ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mp-generatevrtwo ${MODULE_DEFINITIONS}) +target_compile_definitions(mp-generatevrtwo PRIVATE ${MODULE_DEFINITIONS}) buildsys_library(mp-generatevrtwo) # ------------------------------------------------------------------------ @@ -29,7 +29,7 @@ set(generatevrtwo_SOURCES add_executable(generatevrtwo ${generatevrtwo_SOURCES}) target_link_libraries(generatevrtwo mp-generatevrtwo ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(generatevrtwo ${MODULE_DEFINITIONS}) +target_compile_definitions(generatevrtwo PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(generatevrtwo) set_target_version(generatevrtwo ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/mapproxy/CMakeLists.txt b/mapproxy/src/mapproxy/CMakeLists.txt index 8ed177c..4ab7b38 100644 --- a/mapproxy/src/mapproxy/CMakeLists.txt +++ b/mapproxy/src/mapproxy/CMakeLists.txt @@ -82,7 +82,7 @@ define_module(LIBRARY mapproxy-core add_library(mapproxy-core STATIC ${mapproxy-core_SOURCES}) buildsys_library(mapproxy-core) target_link_libraries(mapproxy-core ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-core ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-core PRIVATE ${MODULE_DEFINITIONS}) # ------------------------------------------------------------------------ # GDAL machinery @@ -106,7 +106,7 @@ define_module(LIBRARY mapproxy-gdal add_library(mapproxy-gdal STATIC ${mapproxy-gdal_SOURCES}) buildsys_library(mapproxy-gdal) target_link_libraries(mapproxy-gdal ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-gdal ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-gdal PRIVATE ${MODULE_DEFINITIONS}) # ------------------------------------------------------------------------ # Main mapproxy binary @@ -225,7 +225,7 @@ add_executable(mapproxy ${mapproxy_OL_SOURCES} ) target_link_libraries(mapproxy mapproxy-core ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy) set_target_version(mapproxy ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/mapproxy/mapproxy.cpp b/mapproxy/src/mapproxy/mapproxy.cpp index 57f3ad5..e8e668b 100644 --- a/mapproxy/src/mapproxy/mapproxy.cpp +++ b/mapproxy/src/mapproxy/mapproxy.cpp @@ -33,30 +33,30 @@ namespace fs = boost::filesystem; bool Mapproxy::supportsReferenceFrame(const std::string &referenceFrame) { const auto reply - (ctrl_.command("supports-reference-frame", referenceFrame)); + (ctrl_->command("supports-reference-frame", referenceFrame)); if (reply.empty()) { LOGTHROW(err2, std::runtime_error) << "Invalid reply from mapproxy."; } - return ctrl_.parseBoolean(reply.front()); + return ctrl_->parseBoolean(reply.front()); } bool Mapproxy::has(const Resource::Id &resourceId) const { - const auto reply(ctrl_.command("has-resource", resourceId.referenceFrame + const auto reply(ctrl_->command("has-resource", resourceId.referenceFrame , resourceId.group, resourceId.id)); if (reply.empty()) { LOGTHROW(err2, std::runtime_error) << "Invalid reply from mapproxy."; } - return ctrl_.parseBoolean(reply.front()); + return ctrl_->parseBoolean(reply.front()); } bool Mapproxy::isReady(const Resource::Id &resourceId) const { - const auto reply(ctrl_.command("is-resource-ready" + const auto reply(ctrl_->command("is-resource-ready" , resourceId.referenceFrame , resourceId.group, resourceId.id)); if (reply.empty()) { @@ -64,12 +64,12 @@ bool Mapproxy::isReady(const Resource::Id &resourceId) const << "Invalid reply from mapproxy."; } - return ctrl_.parseBoolean(reply.front()); + return ctrl_->parseBoolean(reply.front()); } std::string Mapproxy::url(const Resource::Id &resourceId) const { - const auto reply(ctrl_.command("resource-url", resourceId.referenceFrame + const auto reply(ctrl_->command("resource-url", resourceId.referenceFrame , resourceId.group, resourceId.id)); if (reply.empty()) { LOGTHROW(err2, std::runtime_error) @@ -81,26 +81,26 @@ std::string Mapproxy::url(const Resource::Id &resourceId) const std::uint64_t Mapproxy::updateResources() { - auto reply(ctrl_.command("update-resources")); + auto reply(ctrl_->command("update-resources")); if (reply.size() < 2) { return 0; } return boost::lexical_cast(reply[1]); } bool Mapproxy::updatedSince(std::uint64_t timestamp) const { - const auto reply(ctrl_.command("updated-since", timestamp)); + const auto reply(ctrl_->command("updated-since", timestamp)); if (reply.empty()) { LOGTHROW(err2, std::runtime_error) << "Invalid reply from mapproxy."; } - return ctrl_.parseBoolean(reply.front()); + return ctrl_->parseBoolean(reply.front()); } bool Mapproxy::updatedSince(const Resource::Id &resourceId , std::uint64_t timestamp, bool nothrow) const { - const auto reply(ctrl_.command("updated-since", timestamp + const auto reply(ctrl_->command("updated-since", timestamp , resourceId.referenceFrame , resourceId.group, resourceId.id , nothrow ? "true" : "false")); @@ -109,5 +109,5 @@ bool Mapproxy::updatedSince(const Resource::Id &resourceId << "Invalid reply from mapproxy."; } - return ctrl_.parseBoolean(reply.front()); + return ctrl_->parseBoolean(reply.front()); } diff --git a/mapproxy/src/mapproxy/mapproxy.hpp b/mapproxy/src/mapproxy/mapproxy.hpp index dde39d1..fa1634b 100644 --- a/mapproxy/src/mapproxy/mapproxy.hpp +++ b/mapproxy/src/mapproxy/mapproxy.hpp @@ -40,8 +40,8 @@ */ class Mapproxy { public: - Mapproxy(const boost::filesystem::path &ctrl) - : ctrl_(ctrl) + Mapproxy(const std::string &ctrl) + : ctrl_(service::ctrlClientFactory(ctrl)) {} /** Is given reference frame supported? @@ -77,8 +77,7 @@ class Mapproxy { const; private: - // mutable because we want to mark non-changing functions as const - mutable service::CtrlClient ctrl_; + std::shared_ptr ctrl_; }; diff --git a/mapproxy/src/mapproxy/test/CMakeLists.txt b/mapproxy/src/mapproxy/test/CMakeLists.txt index bd85e94..d1ec452 100644 --- a/mapproxy/src/mapproxy/test/CMakeLists.txt +++ b/mapproxy/src/mapproxy/test/CMakeLists.txt @@ -12,6 +12,6 @@ set(generate-tileindex_SOURCES add_executable(mapproxy-generate-tileindex ${generate-tileindex_SOURCES}) target_link_libraries(mapproxy-generate-tileindex ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-generate-tileindex ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-generate-tileindex PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-generate-tileindex) set_target_version(mapproxy-generate-tileindex ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/rf-mask/CMakeLists.txt b/mapproxy/src/rf-mask/CMakeLists.txt index e9f7b9d..5234f24 100644 --- a/mapproxy/src/rf-mask/CMakeLists.txt +++ b/mapproxy/src/rf-mask/CMakeLists.txt @@ -12,7 +12,7 @@ set(rf-mask_SOURCES add_executable(mapproxy-rf-mask ${rf-mask_SOURCES}) target_link_libraries(mapproxy-rf-mask ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-rf-mask ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-rf-mask PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-rf-mask) set_target_version(mapproxy-rf-mask ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/setup-resource/CMakeLists.txt b/mapproxy/src/setup-resource/CMakeLists.txt index 280f2b4..c17cf1f 100644 --- a/mapproxy/src/setup-resource/CMakeLists.txt +++ b/mapproxy/src/setup-resource/CMakeLists.txt @@ -12,7 +12,7 @@ set(setup-resource_SOURCES add_executable(mapproxy-setup-resource ${setup-resource_SOURCES}) target_link_libraries(mapproxy-setup-resource ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-setup-resource ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-setup-resource PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-setup-resource) set_target_version(mapproxy-setup-resource ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/setup-resource/main.cpp b/mapproxy/src/setup-resource/main.cpp index 2070ddc..050fe32 100644 --- a/mapproxy/src/setup-resource/main.cpp +++ b/mapproxy/src/setup-resource/main.cpp @@ -100,10 +100,14 @@ struct Config { fs::path mapproxyDataRoot; fs::path mapproxyDefinitionDir; - fs::path mapproxyCtrl; + std::string mapproxyCtrl; bool parallel = true; + struct { + boost::optional datasetHome; + } override; + Config() : format(RasterFormat::jpg) , transparent(false) @@ -195,6 +199,10 @@ void SetupResource::configuration(po::options_description &cmdline , "Desired bottom LOD. The actual bottom might be deeper in " "case of more detail dataset.") + ("override.datasetHome", po::value() + , "Dataset home path override if the default is undesirable. " + "Relative to --dataRoot. Use with caution.") + ("background", po::value() , "Optional background. If whole warped tile contains this " "color it is left empty in the output. Solid dataset with this color " @@ -215,7 +223,7 @@ void SetupResource::configuration(po::options_description &cmdline , po::value(&config_.mapproxyDefinitionDir)->required() , "Path to mapproxy resource definition directory.") ("mapproxy.ctrl", po::value(&config_.mapproxyCtrl)->required() - , "Path to mapproxy control socket.") + , "Mapproxy control socket path/CTRL URI.") ; pd.add("dataset", 1) @@ -249,6 +257,11 @@ void SetupResource::configure(const po::variables_map &vars) config_.background = vars["background"].as(); } + if (vars.count("override.datasetHome")) { + config_.override.datasetHome = vars["override.datasetHome"] + .as(); + } + // absolutize destination paths config_.mapproxyDataRoot = fs::absolute(config_.mapproxyDataRoot); config_.mapproxyDefinitionDir @@ -827,8 +840,9 @@ int SetupResource::run() const auto datasetFileName(fs::path(dataset_).filename()); const auto datasetHome - (utility::addExtension(datasetFileName - , "." + md5sum(dataset_))); + (config_.override.datasetHome.value_or + (utility::addExtension(datasetFileName + , "." + md5sum(dataset_)))); const auto rootDir(config.mapproxyDataRoot / datasetHome); const auto baseDatasetPath("original-dataset" / datasetFileName); @@ -851,7 +865,7 @@ int SetupResource::run() if (linkDataset_ == DatasetLink::relative) { // relativize already absolute path - dst = utility::lexically_relative(dst, rootDir); + dst = dst.lexically_relative(rootDir / "."); } // link diff --git a/mapproxy/src/tiling/CMakeLists.txt b/mapproxy/src/tiling/CMakeLists.txt index ad78849..207931f 100644 --- a/mapproxy/src/tiling/CMakeLists.txt +++ b/mapproxy/src/tiling/CMakeLists.txt @@ -10,7 +10,7 @@ set(mp-tiling_SOURCES add_library(mp-tiling ${mp-tiling_SOURCES}) target_link_libraries(mp-tiling ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mp-tiling ${MODULE_DEFINITIONS}) +target_compile_definitions(mp-tiling PRIVATE ${MODULE_DEFINITIONS}) buildsys_library(mp-tiling) # ------------------------------------------------------------------------ @@ -29,7 +29,7 @@ set(mapproxy-tiling_SOURCES add_executable(mapproxy-tiling ${mapproxy-tiling_SOURCES}) target_link_libraries(mapproxy-tiling mp-tiling ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-tiling ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-tiling PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-tiling) set_target_version(mapproxy-tiling ${vts-mapproxy_VERSION}) @@ -39,7 +39,7 @@ set(sub-tiling_SOURCES add_executable(mapproxy-sub-tiling ${sub-tiling_SOURCES}) target_link_libraries(mapproxy-sub-tiling mp-tiling ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-sub-tiling ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-sub-tiling PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-sub-tiling) set_target_version(mapproxy-sub-tiling ${vts-mapproxy_VERSION}) diff --git a/mapproxy/src/tools/CMakeLists.txt b/mapproxy/src/tools/CMakeLists.txt index 3c200aa..3323f66 100644 --- a/mapproxy/src/tools/CMakeLists.txt +++ b/mapproxy/src/tools/CMakeLists.txt @@ -14,7 +14,7 @@ set(mapproxy-ti2mmti_SOURCES add_executable(mapproxy-ti2mmti ${mapproxy-ti2mmti_SOURCES}) target_link_libraries(mapproxy-ti2mmti ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-ti2mmti ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-ti2mmti PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-ti2mmti) set_target_version(mapproxy-ti2mmti ${vts-mapproxy_VERSION}) @@ -26,6 +26,6 @@ set(mapproxy-querymmti_SOURCES add_executable(mapproxy-querymmti ${mapproxy-querymmti_SOURCES}) target_link_libraries(mapproxy-querymmti ${MODULE_LIBRARIES}) -buildsys_target_compile_definitions(mapproxy-querymmti ${MODULE_DEFINITIONS}) +target_compile_definitions(mapproxy-querymmti PRIVATE ${MODULE_DEFINITIONS}) buildsys_binary(mapproxy-querymmti) set_target_version(mapproxy-querymmti ${vts-mapproxy_VERSION})