aboutsummaryrefslogtreecommitdiff
path: root/src/c_api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_api.cpp')
-rw-r--r--src/c_api.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/c_api.cpp b/src/c_api.cpp
index 1720a7a1..fbba0f51 100644
--- a/src/c_api.cpp
+++ b/src/c_api.cpp
@@ -839,7 +839,10 @@ static const char *getOptionValue(const char *option,
* <li>MULTILINE=YES/NO. Defaults to YES, except for WKT1_ESRI</li>
* <li>INDENTATION_WIDTH=number. Defauls to 4 (when multiline output is
* on).</li>
- * <li>OUTPUT_AXIS=YES/NO. Defaults to YES, except for WKT1_ESRI.</li>
+ * <li>OUTPUT_AXIS=AUTO/YES/NO. In AUTO mode, axis will be output for WKT2
+ * variants, for WKT1_GDAL for ProjectedCRS with easting/northing ordering
+ * (otherwise stripped), but not for WKT1_ESRI. Setting to YES will output
+ * them unconditionaly, and to NO will omit them unconditionaly.</li>
* </ul>
* @return a string, or NULL in case of error.
*/
@@ -890,7 +893,12 @@ const char *proj_obj_as_wkt(PJ_OBJ *obj, PJ_WKT_TYPE type,
} else if ((value = getOptionValue(*iter, "INDENTATION_WIDTH="))) {
formatter->setIndentationWidth(std::atoi(value));
} else if ((value = getOptionValue(*iter, "OUTPUT_AXIS="))) {
- formatter->setOutputAxis(ci_equal(value, "YES"));
+ if (!ci_equal(value, "AUTO")) {
+ formatter->setOutputAxis(
+ ci_equal(value, "YES")
+ ? WKTFormatter::OutputAxisRule::YES
+ : WKTFormatter::OutputAxisRule::NO);
+ }
} else {
std::string msg("Unknown option :");
msg += *iter;
@@ -925,7 +933,8 @@ const char *proj_obj_as_wkt(PJ_OBJ *obj, PJ_WKT_TYPE type,
* @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
+ * +proj=etmerc instead of +proj=tmerc (or USE_ETMERC=NO to disable implicit
+ * use of etmerc by utm conversions)
* @return a string, or NULL in case of error.
*/
const char *proj_obj_as_proj_string(PJ_OBJ *obj, PJ_PROJ_STRING_TYPE type,
@@ -960,6 +969,8 @@ const char *proj_obj_as_proj_string(PJ_OBJ *obj, PJ_PROJ_STRING_TYPE type,
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);
}
}
obj->lastPROJString = exportable->exportToPROJString(formatter.get());