diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-11 16:03:21 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-11 16:27:10 +0100 |
| commit | 189955fbb0c36a81737a40f84e03df323e5f9356 (patch) | |
| tree | 3b716b0820883f2cd1cccbde3ad69220c3b51cd9 /src | |
| parent | c2c2e5d7f22f3c44c188200717236cf23547ac6f (diff) | |
| download | PROJ-189955fbb0c36a81737a40f84e03df323e5f9356.tar.gz PROJ-189955fbb0c36a81737a40f84e03df323e5f9356.zip | |
API: add setters for Laborde Oblique Mercator, and add mapping to WKT1
Diffstat (limited to 'src')
| -rw-r--r-- | src/c_api.cpp | 36 | ||||
| -rw-r--r-- | src/coordinateoperation.cpp | 30 | ||||
| -rw-r--r-- | src/proj_experimental.h | 11 |
3 files changed, 77 insertions, 0 deletions
diff --git a/src/c_api.cpp b/src/c_api.cpp index 496312f7..e5ceca7d 100644 --- a/src/c_api.cpp +++ b/src/c_api.cpp @@ -4265,6 +4265,42 @@ proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin( } // --------------------------------------------------------------------------- +/** \brief Instanciate a ProjectedCRS with a conversion based on the Laborde + * Oblique Mercator projection method. + * + * See + * osgeo::proj::operation::Conversion::createLabordeObliqueMercator(). + * + * Linear parameters are expressed in (linear_unit_name, + * linear_unit_conv_factor). + * Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor). + */ +PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator( + PJ_CONTEXT *ctx, double latitude_projection_centre, + double longitude_projection_centre, double azimuth_initial_line, + double scale, 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::createLabordeObliqueMercator( + PropertyMap(), Angle(latitude_projection_centre, angUnit), + Angle(longitude_projection_centre, angUnit), + Angle(azimuth_initial_line, angUnit), Scale(scale), + Length(false_easting, linearUnit), + Length(false_northing, linearUnit)); + return proj_obj_create_conversion(conv); + } catch (const std::exception &e) { + proj_log_error(ctx, __FUNCTION__, e.what()); + } + return nullptr; +} +// --------------------------------------------------------------------------- + /** \brief Instanciate a ProjectedCRS with a conversion based on the * International Map of the World Polyconic projection method. * diff --git a/src/coordinateoperation.cpp b/src/coordinateoperation.cpp index 654692fb..ac2c4196 100644 --- a/src/coordinateoperation.cpp +++ b/src/coordinateoperation.cpp @@ -3267,6 +3267,36 @@ ConversionNNPtr Conversion::createHotineObliqueMercatorTwoPointNaturalOrigin( // --------------------------------------------------------------------------- +/** \brief Instanciate a conversion based on the [Laborde Oblique Mercator] + *(https://proj4.org/operations/projections/labrd.html) projection method. + * + * This method is defined as [EPSG:9813] + * (https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9813) + * + * @param properties See \ref general_properties of the conversion. If the name + * is not provided, it is automatically set. + * @param latitudeProjectionCentre See \ref latitude_projection_centre + * @param longitudeProjectionCentre See \ref longitude_projection_centre + * @param azimuthInitialLine See \ref azimuth_initial_line + * @param scale See \ref scale_factor_initial_line + * @param falseEasting See \ref false_easting + * @param falseNorthing See \ref false_northing + * @return a new Conversion. + */ +ConversionNNPtr Conversion::createLabordeObliqueMercator( + const util::PropertyMap &properties, + const common::Angle &latitudeProjectionCentre, + const common::Angle &longitudeProjectionCentre, + const common::Angle &azimuthInitialLine, const common::Scale &scale, + const common::Length &falseEasting, const common::Length &falseNorthing) { + return create(properties, EPSG_CODE_METHOD_LABORDE_OBLIQUE_MERCATOR, + createParams(latitudeProjectionCentre, + longitudeProjectionCentre, azimuthInitialLine, + scale, falseEasting, falseNorthing)); +} + +// --------------------------------------------------------------------------- + /** \brief Instanciate a conversion based on the [International Map of the World *Polyconic] *(https://proj4.org/operations/projections/imw_p.html) projection method. diff --git a/src/proj_experimental.h b/src/proj_experimental.h index 698b235b..c24372af 100644 --- a/src/proj_experimental.h +++ b/src/proj_experimental.h @@ -584,6 +584,17 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_two_point_na const char* ang_unit_name, double ang_unit_conv_factor, const char* linear_unit_name, double linear_unit_conv_factor); +PJ_OBJ PROJ_DLL *proj_obj_create_conversion_laborde_oblique_mercator( + PJ_CONTEXT *ctx, + double latitude_projection_centre, + double longitude_projection_centre, + double azimuth_initial_line, + double scale, + 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); + PJ_OBJ PROJ_DLL *proj_obj_create_conversion_international_map_world_polyconic( PJ_CONTEXT *ctx, double center_long, |
