diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/c_api.cpp | 14 | ||||
| -rw-r--r-- | src/cs2cs.cpp | 8 | ||||
| -rw-r--r-- | src/proj.h | 4 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/c_api.cpp b/src/c_api.cpp index 9d66071b..a1eaf1e7 100644 --- a/src/c_api.cpp +++ b/src/c_api.cpp @@ -6018,13 +6018,19 @@ int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) { * unit conversion factor. or NULL * @param out_unit_name Pointer to a string value to store the axis * unit name. or NULL + * @param out_unit_auth_name Pointer to a string value to store the axis + * unit authority name. or NULL + * @param out_unit_code Pointer to a string value to store the axis + * unit code. or NULL * @return TRUE in case of success */ int proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ_OBJ *cs, int index, const char **out_name, const char **out_abbrev, const char **out_direction, double *out_unit_conv_factor, - const char **out_unit_name) { + const char **out_unit_name, + const char **out_unit_auth_name, + const char **out_unit_code) { SANITIZE_CTX(ctx); assert(cs); auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get()); @@ -6053,5 +6059,11 @@ int proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ_OBJ *cs, int index, if (out_unit_name) { *out_unit_name = axis->unit().name().c_str(); } + if (out_unit_auth_name) { + *out_unit_auth_name = axis->unit().codeSpace().c_str(); + } + if (out_unit_code) { + *out_unit_code = axis->unit().code().c_str(); + } return true; } diff --git a/src/cs2cs.cpp b/src/cs2cs.cpp index a8d126cf..3345bcc6 100644 --- a/src/cs2cs.cpp +++ b/src/cs2cs.cpp @@ -242,7 +242,9 @@ static PJ_OBJ *instanciate_crs(const std::string &definition, nullptr, // abbrev nullptr, // direction &toRadians, - nullptr // unit name + nullptr, // unit name + nullptr, // unit authority + nullptr // unit code ); isLatFirst = NS_PROJ::internal::ci_find(std::string(axisName), "latitude") != @@ -291,7 +293,9 @@ static std::string get_geog_crs_proj_string_from_proj_crs(PJ_OBJ *src, nullptr, // abbrev nullptr, // direction &toRadians, - nullptr // unit name + nullptr, // unit name + nullptr, // unit authority + nullptr // unit code ); isLatFirst = NS_PROJ::internal::ci_find(std::string(axisName), "latitude") != std::string::npos; @@ -838,7 +838,9 @@ int PROJ_DLL proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx, const char **out_abbrev, const char **out_direction, double *out_unit_conv_factor, - const char **out_unit_name); + const char **out_unit_name, + const char **out_unit_auth_name, + const char **out_unit_code); PJ_OBJ PROJ_DLL *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ_OBJ *obj); |
