Skip to content

Commit

Permalink
Merge GH-2024 (any authority for transforms)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Jan 24, 2022
2 parents c4f4fbf + 40cddb1 commit 69783a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/core/georeferencing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ ProjTransform::ProjTransform(const QString& crs_spec)
// Cf. https://github.com/OSGeo/PROJ/pull/1573
crs_spec_utf8.replace("+datum=potsdam", "+ellps=bessel +nadgrids=@BETA2007.gsb");
#endif
#if defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) || (PROJ_VERSION_MAJOR) < 8
pj = proj_create_crs_to_crs(PJ_DEFAULT_CTX, geographic_crs_spec_utf8, crs_spec_utf8, nullptr);
#else
static auto const geographic_crs = crs(Georeferencing::geographic_crs_spec);
auto const projected_crs = crs(crs_spec);
static const char* const options[] = {"AUTHORITY=any", nullptr};
pj = proj_create_crs_to_crs_from_pj(PJ_DEFAULT_CTX, geographic_crs.pj, projected_crs.pj, nullptr, options);
#endif
if (pj)
operator=({proj_normalize_for_visualization(PJ_DEFAULT_CTX, pj)});
}
Expand Down
6 changes: 2 additions & 4 deletions test/template_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@

#ifdef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
# include <proj_api.h>
#else
# include <proj.h>
#endif

#include "test_config.h"
Expand Down Expand Up @@ -446,7 +444,7 @@ private slots:
QVERIFY(map.getTemplate(template_index)->loadTemplateFile());
QCOMPARE(temp->getTemplateState(), Template::Loaded);

#if (!defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) && (PROJ_VERSION_MAJOR)*100+(PROJ_VERSION_MINOR) < 802) || PJ_VERSION >= 600
#if !defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) || PJ_VERSION >= 600
QEXPECT_FAIL("TemplateTrack from v0.8.4", "Unsupported WGS 84 -> NAD 83 transformation", Continue);
#else
QEXPECT_FAIL("TemplateTrack NAD83", "Unsupported WGS 84 -> NAD 83 transformation", Continue);
Expand Down Expand Up @@ -569,7 +567,7 @@ private slots:
ogr_template_center = center(temp);
}

#if (!defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) && (PROJ_VERSION_MAJOR)*100+(PROJ_VERSION_MINOR) < 802) || PJ_VERSION >= 600
#if !defined(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H) || PJ_VERSION >= 600
QEXPECT_FAIL("TemplateTrack NAD83", "Unsupported WGS 84 -> NAD 83 transformation", Continue);
QEXPECT_FAIL("OgrTemplate NAD83", "Unsupported WGS 84 -> NAD 83 transformation", Continue);
#endif
Expand Down

0 comments on commit 69783a5

Please sign in to comment.