From 19ebc53c80335c10e9cd6128d7e73927b7816d25 Mon Sep 17 00:00:00 2001 From: Serein Pfeiffer Date: Fri, 23 Jan 2026 13:03:51 +0100 Subject: [PATCH 1/2] Default withAttrLayers to true for GeoJsonFolder --- docs/mapget-config.md | 2 +- libs/http-service/src/cli.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/mapget-config.md b/docs/mapget-config.md index d44fddb2..ee94de5a 100644 --- a/docs/mapget-config.md +++ b/docs/mapget-config.md @@ -203,7 +203,7 @@ Required fields: Optional fields: -- `withAttrLayers`: boolean flag. If `true`, nested objects in the GeoJSON `properties` are interpreted as attribute layers; if `false`, only scalar top‑level properties are emitted. +- `withAttrLayers` (default: `true`): boolean flag. If `true`, nested objects in the GeoJSON `properties` are converted to mapget attribute layers; if `false`, only scalar top‑level properties are emitted and nested objects are silently dropped. Example: diff --git a/libs/http-service/src/cli.cpp b/libs/http-service/src/cli.cpp index 7e51c540..58464881 100644 --- a/libs/http-service/src/cli.cpp +++ b/libs/http-service/src/cli.cpp @@ -94,7 +94,9 @@ nlohmann::json geoJsonFolderSchema() }}, {"withAttrLayers", { {"type", "boolean"}, - {"title", "With Attribute Layers"} + {"title", "With Attribute Layers"}, + {"description", "Convert nested GeoJSON property objects to mapget attribute layers. Default: true."}, + {"default", true} }} }}, {"required", nlohmann::json::array({"folder"})}, @@ -233,7 +235,7 @@ void registerDefaultDatasourceTypes() { "GeoJsonFolder", [](YAML::Node const& config) -> DataSource::Ptr { if (auto folder = config["folder"]) { - bool withAttributeLayers = false; + bool withAttributeLayers = true; if (auto withAttributeLayersNode = config["withAttrLayers"]) withAttributeLayers = withAttributeLayersNode.as(); return std::make_shared(folder.as(), withAttributeLayers); From 9008ae00285b79ded5394cbc64a636641e3655e2 Mon Sep 17 00:00:00 2001 From: Serein Pfeiffer Date: Mon, 26 Jan 2026 12:24:43 +0100 Subject: [PATCH 2/2] Add optional mapId config for GeoJsonFolder --- libs/http-service/src/cli.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/http-service/src/cli.cpp b/libs/http-service/src/cli.cpp index 58464881..e305e24d 100644 --- a/libs/http-service/src/cli.cpp +++ b/libs/http-service/src/cli.cpp @@ -92,6 +92,11 @@ nlohmann::json geoJsonFolderSchema() {"title", "Folder"}, {"description", "Path to a folder containing GeoJSON tiles."} }}, + {"mapId", { + {"type", "string"}, + {"title", "Map ID"}, + {"description", "Custom map identifier. If not provided, derived from folder path."} + }}, {"withAttrLayers", { {"type", "boolean"}, {"title", "With Attribute Layers"}, @@ -238,7 +243,10 @@ void registerDefaultDatasourceTypes() { bool withAttributeLayers = true; if (auto withAttributeLayersNode = config["withAttrLayers"]) withAttributeLayers = withAttributeLayersNode.as(); - return std::make_shared(folder.as(), withAttributeLayers); + std::string mapId; + if (auto mapIdNode = config["mapId"]) + mapId = mapIdNode.as(); + return std::make_shared(folder.as(), withAttributeLayers, mapId); } throw std::runtime_error("Missing `folder` field."); },