aboutsummaryrefslogtreecommitdiff
path: root/src/transformations/tinshift.hpp
diff options
context:
space:
mode:
authorJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>2021-10-16 15:38:17 +0200
committerJohannes Schauer Marin Rodrigues <josch@mister-muffin.de>2021-10-21 22:18:29 +0200
commitf5aed82fc6eee896606e95dc15e578cd9f058a2c (patch)
tree94ed60520c61a765cb2515aaea4f3d21183d6b74 /src/transformations/tinshift.hpp
parent576a075d309056382cadc26ddf04c9eb779114a0 (diff)
downloadPROJ-f5aed82fc6eee896606e95dc15e578cd9f058a2c.tar.gz
PROJ-f5aed82fc6eee896606e95dc15e578cd9f058a2c.zip
Add fallback_strategy to tinshift transform
- this bumps format_version of tinshift JSON to 1.1 for the new field fallback_strategy - the default behaviour without that field is retained - if fallback_strategy is set to "nearest_side", then points that do not fall into any of the triangles will be transformed according to the nearest triangle - if fallback_centroid is set to "nearest_side", then points that do not fall into any of the triangles will be transformed according to the triangle with the nearest centroid
Diffstat (limited to 'src/transformations/tinshift.hpp')
-rw-r--r--src/transformations/tinshift.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/transformations/tinshift.hpp b/src/transformations/tinshift.hpp
index cc8771b3..f826e08a 100644
--- a/src/transformations/tinshift.hpp
+++ b/src/transformations/tinshift.hpp
@@ -53,6 +53,12 @@
namespace TINSHIFT_NAMESPACE {
+enum FallbackStrategy {
+ FALLBACK_NONE,
+ FALLBACK_NEAREST_SIDE,
+ FALLBACK_NEAREST_CENTROID,
+};
+
using json = nlohmann::json;
// ---------------------------------------------------------------------------
@@ -93,6 +99,10 @@ class TINShiftFile {
*/
const std::string &publicationDate() const { return mPublicationDate; }
+ const enum FallbackStrategy &fallbackStrategy() const {
+ return mFallbackStrategy;
+ }
+
/** Basic information on the agency responsible for the model. */
struct Authority {
std::string name{};
@@ -204,6 +214,7 @@ class TINShiftFile {
std::string mLicense{};
std::string mDescription{};
std::string mPublicationDate{};
+ enum FallbackStrategy mFallbackStrategy {};
Authority mAuthority{};
std::vector<Link> mLinks{};
std::string mInputCRS{};