aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/c_api.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2019-02-11 23:58:16 +0100
committerGitHub <noreply@github.com>2019-02-11 23:58:16 +0100
commit5141b3908e59a26c9fe66de94bb7388bff741b58 (patch)
tree9cf9a136c9dd72e2732ed38470b6c84b558f4b73 /src/iso19111/c_api.cpp
parent593fcc4b57d0f5c3a46134add142ee8d9316aec6 (diff)
downloadPROJ-5141b3908e59a26c9fe66de94bb7388bff741b58.tar.gz
PROJ-5141b3908e59a26c9fe66de94bb7388bff741b58.zip
Make tmerc an alias for etmerc. (#1234)
* Make tmerc an alias for etmerc This switches the algorithm used in tmerc to the Poder/Engsager tmerc algorithm. The original tmerc algorithm of Evenden/Snyder origin can still be accessed by adding the +approx flag when initializing a tmerc projection. The +approx flag can also be used when initializing UTM projections, in which case the Evenden/Snyder algorithm is used as well. If a tmerc projection is instantiated on a spherical earth the Evenden/Snyder algorithm is used as well since the Poder/Engsager algorithm is only defined on the ellipsoid. +proj=etmerc can still be instantiated for backwards compatibility reasons. Co-authored-by: Kristian Evers <kristianevers@gmail.com> Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Diffstat (limited to 'src/iso19111/c_api.cpp')
-rw-r--r--src/iso19111/c_api.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index 6fafa2c8..240d11b3 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -1207,9 +1207,8 @@ const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type,
* @param type PROJ String version.
* @param options NULL-terminated list of strings with "KEY=VALUE" format. or
* NULL.
- * The currently recognized option is USE_ETMERC=YES to use
- * +proj=etmerc instead of +proj=tmerc (or USE_ETMERC=NO to disable implicit
- * use of etmerc by utm conversions)
+ * The currently recognized option is USE_APPROX_TMERC=YES to add the +approx
+ * flag to +proj=tmerc or +proj=utm
* @return a string, or NULL in case of error.
*/
const char *proj_as_proj_string(PJ_CONTEXT *ctx, const PJ *obj,
@@ -1243,10 +1242,8 @@ const char *proj_as_proj_string(PJ_CONTEXT *ctx, const PJ *obj,
try {
auto formatter = PROJStringFormatter::create(convention, dbContext);
if (options != nullptr && options[0] != nullptr) {
- if (ci_equal(options[0], "USE_ETMERC=YES")) {
- formatter->setUseETMercForTMerc(true);
- } else if (ci_equal(options[0], "USE_ETMERC=NO")) {
- formatter->setUseETMercForTMerc(false);
+ if (ci_equal(options[0], "USE_APPROX_TMERC=YES")) {
+ formatter->setUseApproxTMerc(true);
}
}
obj->lastPROJString = exportable->exportToPROJString(formatter.get());