diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-29 17:38:23 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-11-29 17:38:23 +0100 |
| commit | 9bb6e214fa121bf4f2d5c4948bdc0dbe24d0c3b6 (patch) | |
| tree | d88481835e63a57941607440cfcdd798e4c16ce5 /src/iso19111/c_api.cpp | |
| parent | f7d17d4450be19251e9bd31f12608a241a6547ef (diff) | |
| download | PROJ-9bb6e214fa121bf4f2d5c4948bdc0dbe24d0c3b6.tar.gz PROJ-9bb6e214fa121bf4f2d5c4948bdc0dbe24d0c3b6.zip | |
Add option to allow export of Geographic/Projected 3D CRS in WKT1_GDAL
as CompoundCRS with a VerticalCRS being an ellipsoidal height, which is
not conformant. But needed for LAS 1.4 that only supports WKT1
This is a partial backport of https://github.com/OSGeo/PROJ/pull/2450,
with only the new ALLOW_ELLIPSOIDAL_HEIGHT_AS_VERTICAL_CRS=YES option
of proj_as_wkt()
Diffstat (limited to 'src/iso19111/c_api.cpp')
| -rw-r--r-- | src/iso19111/c_api.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index 90a414c6..577dae63 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -1418,6 +1418,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. */ @@ -1468,6 +1475,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; |
