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.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index 090d59a1..27a727dc 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -6266,6 +6266,46 @@ PJ *proj_create_conversion_equal_earth(PJ_CONTEXT *ctx, double center_long,
}
return nullptr;
}
+
+// ---------------------------------------------------------------------------
+
+/** \brief Instantiate a conversion based on the Vertical Perspective projection
+ * method.
+ *
+ * See osgeo::proj::operation::Conversion::createVerticalPerspective().
+ *
+ * Linear parameters are expressed in (linear_unit_name,
+ * linear_unit_conv_factor).
+ * Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
+ *
+ * @since 7.0
+ */
+PJ *proj_create_conversion_vertical_perspective(
+ PJ_CONTEXT *ctx, double topo_origin_lat, double topo_origin_long,
+ double topo_origin_height, double view_point_height, double false_easting,
+ double false_northing, const char *ang_unit_name,
+ double ang_unit_conv_factor, const char *linear_unit_name,
+ double linear_unit_conv_factor) {
+ SANITIZE_CTX(ctx);
+ try {
+ UnitOfMeasure linearUnit(
+ createLinearUnit(linear_unit_name, linear_unit_conv_factor));
+ UnitOfMeasure angUnit(
+ createAngularUnit(ang_unit_name, ang_unit_conv_factor));
+ auto conv = Conversion::createVerticalPerspective(
+ PropertyMap(), Angle(topo_origin_lat, angUnit),
+ Angle(topo_origin_long, angUnit),
+ Length(topo_origin_height, linearUnit),
+ Length(view_point_height, linearUnit),
+ Length(false_easting, linearUnit),
+ Length(false_northing, linearUnit));
+ return proj_create_conversion(ctx, conv);
+ } catch (const std::exception &e) {
+ proj_log_error(ctx, __FUNCTION__, e.what());
+ }
+ return nullptr;
+}
+
/* END: Generated by scripts/create_c_api_projections.py*/
// ---------------------------------------------------------------------------