From 963f12c3c599c4255975ffc3400f850d979e6246 Mon Sep 17 00:00:00 2001 From: Johannes Wolf Date: Wed, 19 Jun 2024 23:48:50 +0200 Subject: [PATCH] conan: Bump simfil to 0.2.1 --- conanfile.py | 2 +- libs/model/src/featurelayer.cpp | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 29626f10..ab27c7c6 100644 --- a/conanfile.py +++ b/conanfile.py @@ -48,7 +48,7 @@ def validate(self): def requirements(self): self.requires("fmt/10.2.1", override=True) - self.requires("simfil/0.1.3", transitive_headers=True) + self.requires("simfil/0.2.1", transitive_headers=True) self.requires("spdlog/[~1]", transitive_headers=True) self.requires("bitsery/[~5]") self.requires("nlohmann_json/3.11.2", transitive_headers=True) diff --git a/libs/model/src/featurelayer.cpp b/libs/model/src/featurelayer.cpp index bb26f0b1..3954c3f3 100644 --- a/libs/model/src/featurelayer.cpp +++ b/libs/model/src/featurelayer.cpp @@ -12,6 +12,42 @@ #include #include "simfil/model/bitsery-traits.h" +#include "geometry.h" + +/** Bitsery serialization traits */ +namespace bitsery +{ + +template +void serialize(S& s, mapget::Point& v) { + s.value4b(v.x); + s.value4b(v.y); + s.value4b(v.z); +} + +template +void serialize(S& s, mapget::Point& v) { + s.value8b(v.x); + s.value8b(v.y); + s.value8b(v.z); +} + +} + +namespace +{ +template +std::unique_ptr makeEnvironment(Args&& ...args) +{ + auto env = std::make_unique(std::forward(args)...); + env->functions["geo"] = &mapget::GeoFn::Fn; + env->functions["point"] = &mapget::PointFn::Fn; + env->functions["bbox"] = &mapget::BBoxFn::Fn; + env->functions["linestring"] = &mapget::LineStringFn::Fn; + + return env; +} +} namespace mapget {