From 8b6dbc7c9adeb09aaa02d4c4c7823086d1c7838f Mon Sep 17 00:00:00 2001 From: program-- Date: Thu, 13 Jul 2023 07:29:56 -0700 Subject: [PATCH] rev: update cmakelists; feature exhaustive case changes per https://github.com/NOAA-OWP/ngen/pull/522#discussion_r1258973951 and https://github.com/NOAA-OWP/ngen/pull/522#discussion_r1261903562 --- src/geopackage/CMakeLists.txt | 14 +++++++------- src/geopackage/feature.cpp | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/geopackage/CMakeLists.txt b/src/geopackage/CMakeLists.txt index 14a8f1324d..acc592bac1 100644 --- a/src/geopackage/CMakeLists.txt +++ b/src/geopackage/CMakeLists.txt @@ -12,13 +12,13 @@ if (NOT _cmp) set_source_files_properties(wkb.cpp PROPERTIES COMPILE_FLAGS -O0) endif() -add_library(geopackage STATIC geometry.cpp - properties.cpp - feature.cpp - read.cpp - wkb.cpp - sqlite/iterator.cpp - sqlite/database.cpp +add_library(geopackage geometry.cpp + properties.cpp + feature.cpp + read.cpp + wkb.cpp + sqlite/iterator.cpp + sqlite/database.cpp ) add_library(NGen::geopackage ALIAS geopackage) target_include_directories(geopackage PUBLIC ${PROJECT_SOURCE_DIR}/include/geopackage) diff --git a/src/geopackage/feature.cpp b/src/geopackage/feature.cpp index 76b95378de..8b51e4d495 100644 --- a/src/geopackage/feature.cpp +++ b/src/geopackage/feature.cpp @@ -67,12 +67,14 @@ geojson::Feature geopackage::build_feature( properties, bounding_box ); - default: + case geojson::FeatureType::GeometryCollection: return std::make_shared( std::vector{geometry}, id, properties, bounding_box ); + default: + throw std::runtime_error("invalid WKB feature type. Received: " + std::to_string(geometry.which() + 1)); } }