aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/c_api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/iso19111/c_api.cpp')
-rw-r--r--src/iso19111/c_api.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index cbbdcaa8..6bc1f166 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -79,10 +79,10 @@ static void PROJ_NO_INLINE proj_log_error(PJ_CONTEXT *ctx, const char *function,
msg += ": ";
msg += text;
ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str());
- auto previous_errno = pj_ctx_get_errno(ctx);
+ auto previous_errno = proj_context_errno(ctx);
if (previous_errno == 0) {
// only set errno if it wasn't set deeper down the call stack
- pj_ctx_set_errno(ctx, PJD_ERR_GENERIC_ERROR);
+ proj_context_errno_set(ctx, PJD_ERR_GENERIC_ERROR);
}
}
@@ -1421,6 +1421,13 @@ const char *proj_get_id_code(const PJ *obj, int index) {
* variants, for WKT1_GDAL for ProjectedCRS with easting/northing ordering
* (otherwise stripped), but not for WKT1_ESRI. Setting to YES will output
* them unconditionally, and to NO will omit them unconditionally.</li>
+ * <li>STRICT=YES/NO. Default is YES. If NO, a Geographic 3D CRS can be for
+ * example exported as WKT1_GDAL with 3 axes, whereas this is normally not
+ * allowed.</li>
+ * <li>ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS=YES/NO. Default is NO. If set
+ * to YES and type == PJ_WKT1_GDAL, a Geographic 3D CRS or a Projected 3D CRS
+ * will be exported as a compound CRS whose vertical part represents an
+ * ellipsoidal height (for example for use with LAS 1.4 WKT1).</li>
* </ul>
* @return a string, or NULL in case of error.
*/
@@ -1471,6 +1478,11 @@ const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type,
}
} else if ((value = getOptionValue(*iter, "STRICT="))) {
formatter->setStrict(ci_equal(value, "YES"));
+ } else if ((value = getOptionValue(
+ *iter,
+ "ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS="))) {
+ formatter->setAllowEllipsoidalHeightAsVerticalCRS(
+ ci_equal(value, "YES"));
} else {
std::string msg("Unknown option :");
msg += *iter;
@@ -2690,11 +2702,11 @@ proj_get_crs_info_list_from_database(PJ_CONTEXT *ctx, const char *auth_name,
void proj_crs_info_list_destroy(PROJ_CRS_INFO **list) {
if (list) {
for (int i = 0; list[i] != nullptr; i++) {
- pj_dalloc(list[i]->auth_name);
- pj_dalloc(list[i]->code);
- pj_dalloc(list[i]->name);
- pj_dalloc(list[i]->area_name);
- pj_dalloc(list[i]->projection_method_name);
+ free(list[i]->auth_name);
+ free(list[i]->code);
+ free(list[i]->name);
+ free(list[i]->area_name);
+ free(list[i]->projection_method_name);
delete list[i];
}
delete[] list;
@@ -2784,11 +2796,11 @@ PROJ_UNIT_INFO **proj_get_units_from_database(PJ_CONTEXT *ctx,
void proj_unit_list_destroy(PROJ_UNIT_INFO **list) {
if (list) {
for (int i = 0; list[i] != nullptr; i++) {
- pj_dalloc(list[i]->auth_name);
- pj_dalloc(list[i]->code);
- pj_dalloc(list[i]->name);
- pj_dalloc(list[i]->category);
- pj_dalloc(list[i]->proj_short_name);
+ free(list[i]->auth_name);
+ free(list[i]->code);
+ free(list[i]->name);
+ free(list[i]->category);
+ free(list[i]->proj_short_name);
delete list[i];
}
delete[] list;