aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-02-20 22:25:33 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-02-20 22:25:33 +0100
commit4d57661a52a2439e4e83c40847afdb14bea2e87b (patch)
treed48fa1c9159673e0f40231557db4f688b9acccab /src/iso19111/c_api.cpp
parent6963af728ef309bc147fd7448ffdbdca21c636ad (diff)
parentf5a78058c9d8e633e34e6b0979c79cb7d17b1a93 (diff)
downloadPROJ-4d57661a52a2439e4e83c40847afdb14bea2e87b.tar.gz
PROJ-4d57661a52a2439e4e83c40847afdb14bea2e87b.zip
Merge branch 'master' into 6.0
Diffstat (limited to 'src/iso19111/c_api.cpp')
-rw-r--r--src/iso19111/c_api.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index b3f200fe..f7dcd354 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -1950,7 +1950,7 @@ void proj_string_list_destroy(PROJ_STRING_LIST list) {
// ---------------------------------------------------------------------------
-/** \brief Instanciate a default set of parameters to be used by
+/** \brief Instantiate a default set of parameters to be used by
* proj_get_crs_list().
*
* @return a new object to free with proj_get_crs_list_parameters_destroy() */
@@ -1987,7 +1987,7 @@ void proj_get_crs_list_parameters_destroy(PROJ_CRS_LIST_PARAMETERS *params) {
* entry is NULL. This array should be freed with proj_crs_info_list_destroy()
*
* When no filter parameters are set, this is functionnaly equivalent to
- * proj_get_crs_info_list_from_database(), instanciating a PJ* object for each
+ * proj_get_crs_info_list_from_database(), instantiating a PJ* object for each
* of the proj_create_from_database() and retrieving information with the
* various getters. However this function will be much faster.
*
@@ -5734,7 +5734,7 @@ PJ *proj_create_conversion_equal_earth(PJ_CONTEXT *ctx, double center_long,
* @return TRUE or FALSE.
*/
-int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
+int proj_coordoperation_is_instantiable(PJ_CONTEXT *ctx,
const PJ *coordoperation) {
assert(coordoperation);
auto op = dynamic_cast<const CoordinateOperation *>(
@@ -5746,7 +5746,7 @@ int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
}
auto dbContext = getDBcontextNoException(ctx, __FUNCTION__);
try {
- return op->isPROJInstanciable(dbContext) ? 1 : 0;
+ return op->isPROJInstantiable(dbContext) ? 1 : 0;
} catch (const std::exception &) {
return 0;
}
@@ -5754,6 +5754,36 @@ int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
// ---------------------------------------------------------------------------
+/** \brief Return whether a coordinate operation has a "ballpark"
+ * transformation,
+ * that is a very approximate one, due to lack of more accurate transformations.
+ *
+ * Typically a null geographic offset between two horizontal datum, or a
+ * null vertical offset (or limited to unit changes) between two vertical
+ * datum. Errors of several tens to one hundred meters might be expected,
+ * compared to more accurate transformations.
+ *
+ * @param ctx PROJ context, or NULL for default context
+ * @param coordoperation Objet of type CoordinateOperation or derived classes
+ * (must not be NULL)
+ * @return TRUE or FALSE.
+ */
+
+int proj_coordoperation_has_ballpark_transformation(PJ_CONTEXT *ctx,
+ const PJ *coordoperation) {
+ assert(coordoperation);
+ auto op = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
+ if (!op) {
+ proj_log_error(ctx, __FUNCTION__,
+ "Object is not a CoordinateOperation");
+ return 0;
+ }
+ return op->hasBallparkTransformation();
+}
+
+// ---------------------------------------------------------------------------
+
/** \brief Return the number of parameters of a SingleOperation
*
* @param ctx PROJ context, or NULL for default context