6 json j_depths = json::object();
7 for(
const auto& kv : depths) {
8 const std::string& feature_name = kv.first;
10 json j_depth = json::object();
11 if(std::isnan(depth.
depth))
continue;
12 j_depth[
"depth"] = depth.
depth;
14 j_depths[feature_name] = j_depth;
22 for(
auto it = j_depths.begin(); it != j_depths.end(); ++it) {
23 const std::string& feature_name = it.key();
24 const json& j_depth = it.value();
25 if(j_depth.is_number())
json encode_straight_depths(const straight_depths &depths)
straight_depths decode_straight_depths(const json &j_depths)
std::map< std::string, straight_depth > straight_depths
straight_depths straight_depths_arg()
T get_or(const json &j, const std::string &key, const T &default_value)