aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/c_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2018-12-31 11:37:51 +0100
committerGitHub <noreply@github.com>2018-12-31 11:37:51 +0100
commit32f3ef47e55c38b0eabb6d781fee3944d3239414 (patch)
treeba2850500ee732559bada055dbab281ceff49a22 /src/iso19111/c_api.cpp
parent5c41d3a1078895ed096b416db15c91108bccad87 (diff)
parent0e0e0e475414ddeb75e0e140d8a3381a431036d9 (diff)
downloadPROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.tar.gz
PROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.zip
Merge pull request #1208 from rouault/merge_PJ_and_PJ_OBJ
Unify PJ_OBJ and PJ structures
Diffstat (limited to 'src/iso19111/c_api.cpp')
-rw-r--r--src/iso19111/c_api.cpp1625
1 files changed, 842 insertions, 783 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index d0b5d720..7f51e613 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -50,10 +50,9 @@
// PROJ include order is sensitive
// clang-format off
-#include "proj_internal.h"
#include "proj.h"
+#include "proj_internal.h"
#include "proj_experimental.h"
-#include "projects.h"
// clang-format on
#include "proj_constants.h"
@@ -90,49 +89,6 @@ static void PROJ_NO_INLINE proj_log_debug(PJ_CONTEXT *ctx, const char *function,
// ---------------------------------------------------------------------------
-/** \brief Opaque object representing a Ellipsoid, Datum, CRS or Coordinate
- * Operation. Should be used by at most one thread at a time. */
-struct PJ_OBJ {
- //! @cond Doxygen_Suppress
- IdentifiedObjectNNPtr obj;
-
- // cached results
- mutable std::string lastWKT{};
- mutable std::string lastPROJString{};
- mutable bool gridsNeededAsked = false;
- mutable std::vector<GridDescription> gridsNeeded{};
-
- explicit PJ_OBJ(const IdentifiedObjectNNPtr &objIn) : obj(objIn) {}
- static PJ_OBJ *create(const IdentifiedObjectNNPtr &objIn);
-
- PJ_OBJ(const PJ_OBJ &) = delete;
- PJ_OBJ &operator=(const PJ_OBJ &) = delete;
- //! @endcond
-};
-
-//! @cond Doxygen_Suppress
-PJ_OBJ *PJ_OBJ::create(const IdentifiedObjectNNPtr &objIn) {
- return new PJ_OBJ(objIn);
-}
-//! @endcond
-
-// ---------------------------------------------------------------------------
-
-/** \brief Opaque object representing a set of operation results. */
-struct PJ_OBJ_LIST {
- //! @cond Doxygen_Suppress
- std::vector<IdentifiedObjectNNPtr> objects;
-
- explicit PJ_OBJ_LIST(std::vector<IdentifiedObjectNNPtr> &&objectsIn)
- : objects(std::move(objectsIn)) {}
-
- PJ_OBJ_LIST(const PJ_OBJ_LIST &) = delete;
- PJ_OBJ_LIST &operator=(const PJ_OBJ_LIST &) = delete;
- //! @endcond
-};
-
-// ---------------------------------------------------------------------------
-
//! @cond Doxygen_Suppress
/** Auxiliary structure to PJ_CONTEXT storing C++ context stuff. */
@@ -168,15 +124,6 @@ void proj_context_delete_cpp_context(struct projCppContext *cppContext) {
//! @cond Doxygen_Suppress
-#define SANITIZE_CTX(ctx) \
- do { \
- if (ctx == nullptr) { \
- ctx = pj_get_default_ctx(); \
- } \
- } while (0)
-
-// ---------------------------------------------------------------------------
-
static PROJ_NO_INLINE const DatabaseContextNNPtr &
getDBcontext(PJ_CONTEXT *ctx) {
if (ctx->cpp_context == nullptr) {
@@ -196,6 +143,57 @@ getDBcontextNoException(PJ_CONTEXT *ctx, const char *function) {
return nullptr;
}
}
+// ---------------------------------------------------------------------------
+
+static PJ *pj_obj_create(PJ_CONTEXT *ctx, const IdentifiedObjectNNPtr &objIn) {
+ auto coordop = dynamic_cast<const CoordinateOperation *>(objIn.get());
+ if (coordop) {
+ auto dbContext = getDBcontextNoException(ctx, __FUNCTION__);
+ try {
+ auto formatter = PROJStringFormatter::create(
+ PROJStringFormatter::Convention::PROJ_5, dbContext);
+ auto pj = proj_create(
+ ctx, coordop->exportToPROJString(formatter.get()).c_str());
+ if (pj) {
+ pj->iso_obj = objIn;
+ return pj;
+ }
+ } catch (const std::exception &e) {
+ proj_log_debug(ctx, __FUNCTION__, e.what());
+ }
+ }
+ auto pj = new PJ();
+ pj->descr = "ISO-19111 object";
+ pj->iso_obj = objIn;
+ return pj;
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+/** \brief Opaque object representing a set of operation results. */
+struct PJ_OBJ_LIST {
+ //! @cond Doxygen_Suppress
+ std::vector<IdentifiedObjectNNPtr> objects;
+
+ explicit PJ_OBJ_LIST(std::vector<IdentifiedObjectNNPtr> &&objectsIn)
+ : objects(std::move(objectsIn)) {}
+
+ PJ_OBJ_LIST(const PJ_OBJ_LIST &) = delete;
+ PJ_OBJ_LIST &operator=(const PJ_OBJ_LIST &) = delete;
+ //! @endcond
+};
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
+
+#define SANITIZE_CTX(ctx) \
+ do { \
+ if (ctx == nullptr) { \
+ ctx = pj_get_default_ctx(); \
+ } \
+ } while (0)
//! @endcond
@@ -313,20 +311,23 @@ static const char *getOptionValue(const char *option,
/** \brief "Clone" an object.
*
* Technically this just increases the reference counter on the object, since
- * PJ_OBJ objects are immutable.
+ * PJ objects are immutable.
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Object to clone. Must not be NULL.
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_clone(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
try {
- return PJ_OBJ::create(obj->obj);
+ return pj_obj_create(ctx, NN_NO_CHECK(obj->iso_obj));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -341,7 +342,7 @@ PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
*
* This function calls osgeo::proj::io::createFromUserInput()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
@@ -357,11 +358,11 @@ PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* Orientated projection). In that mode, the epsg:XXXX syntax will be also
* interprated the same way.</li>
* </ul>
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
- const char *const *options) {
+PJ *proj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(text);
(void)options;
@@ -382,7 +383,7 @@ PJ_OBJ *proj_obj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
auto identifiedObject = nn_dynamic_pointer_cast<IdentifiedObject>(
createFromUserInput(text, dbContext, usePROJ4InitRules));
if (identifiedObject) {
- return PJ_OBJ::create(NN_NO_CHECK(identifiedObject));
+ return pj_obj_create(ctx, NN_NO_CHECK(identifiedObject));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -418,7 +419,7 @@ template <class T> static PROJ_STRING_LIST to_string_list(T &&set) {
*
* This function calls osgeo::proj::io::WKTParser::createFromWKT()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
@@ -436,13 +437,13 @@ template <class T> static PROJ_STRING_LIST to_string_list(T &&set) {
* @param out_grammar_errors Pointer to a PROJ_STRING_LIST object, or NULL.
* If provided, *out_grammar_errors will contain a list of errors regarding the
* WKT grammaer. It must be freed with proj_string_list_destroy().
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
- const char *const *options,
- PROJ_STRING_LIST *out_warnings,
- PROJ_STRING_LIST *out_grammar_errors) {
+PJ *proj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
+ const char *const *options,
+ PROJ_STRING_LIST *out_warnings,
+ PROJ_STRING_LIST *out_grammar_errors) {
SANITIZE_CTX(ctx);
assert(wkt);
@@ -501,7 +502,7 @@ PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
}
if (obj) {
- return PJ_OBJ::create(NN_NO_CHECK(obj));
+ return pj_obj_create(ctx, NN_NO_CHECK(obj));
}
} catch (const std::exception &e) {
if (out_grammar_errors) {
@@ -524,18 +525,17 @@ PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
*
* This function calls osgeo::proj::io::PROJStringParser::createFromPROJString()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param proj_string PROJ string (must not be NULL)
* @param options should be set to NULL for now
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
- const char *proj_string,
- const char *const *options) {
+PJ *proj_create_from_proj_string(PJ_CONTEXT *ctx, const char *proj_string,
+ const char *const *options) {
SANITIZE_CTX(ctx);
(void)options;
assert(proj_string);
@@ -548,7 +548,7 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
auto identifiedObject = nn_dynamic_pointer_cast<IdentifiedObject>(
parser.createFromPROJString(proj_string));
if (identifiedObject) {
- return PJ_OBJ::create(NN_NO_CHECK(identifiedObject));
+ return pj_obj_create(ctx, NN_NO_CHECK(identifiedObject));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -560,7 +560,7 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
/** \brief Instanciate an object from a database lookup.
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx Context, or NULL for default context.
@@ -571,14 +571,13 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
* should be substituted to the official grid names. Only used on
* transformations
* @param options should be set to NULL for now
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
- const char *code,
- PJ_OBJ_CATEGORY category,
- int usePROJAlternativeGridNames,
- const char *const *options) {
+PJ *proj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
+ const char *code, PJ_CATEGORY category,
+ int usePROJAlternativeGridNames,
+ const char *const *options) {
assert(auth_name);
assert(code);
(void)options;
@@ -588,27 +587,27 @@ PJ_OBJ *proj_obj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
auto factory = AuthorityFactory::create(getDBcontext(ctx), auth_name);
IdentifiedObjectPtr obj;
switch (category) {
- case PJ_OBJ_CATEGORY_ELLIPSOID:
+ case PJ_CATEGORY_ELLIPSOID:
obj = factory->createEllipsoid(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_PRIME_MERIDIAN:
+ case PJ_CATEGORY_PRIME_MERIDIAN:
obj = factory->createPrimeMeridian(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_DATUM:
+ case PJ_CATEGORY_DATUM:
obj = factory->createDatum(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_CRS:
+ case PJ_CATEGORY_CRS:
obj =
factory->createCoordinateReferenceSystem(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_COORDINATE_OPERATION:
+ case PJ_CATEGORY_COORDINATE_OPERATION:
obj = factory
->createCoordinateOperation(
codeStr, usePROJAlternativeGridNames != 0)
.as_nullable();
break;
}
- return PJ_OBJ::create(NN_NO_CHECK(obj));
+ return pj_obj_create(ctx, NN_NO_CHECK(obj));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -701,13 +700,13 @@ int proj_uom_get_info_from_database(PJ_CONTEXT *ctx, const char *auth_name,
* @param datum_code Datum code (must not be NULL)
* @param crs_type "geographic 2D", "geographic 3D", "geocentric" or NULL
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_auth_name,
- const char *datum_auth_name,
- const char *datum_code,
- const char *crs_type) {
+PJ_OBJ_LIST *proj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
+ const char *crs_auth_name,
+ const char *datum_auth_name,
+ const char *datum_code,
+ const char *crs_type) {
assert(datum_auth_name);
assert(datum_code);
SANITIZE_CTX(ctx);
@@ -729,114 +728,103 @@ PJ_OBJ_LIST *proj_obj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
// ---------------------------------------------------------------------------
-/** \brief Drops a reference on an object.
- *
- * This method should be called one and exactly one for each function
- * returning a PJ_OBJ*
- *
- * @param obj Object, or NULL.
- */
-void proj_obj_destroy(PJ_OBJ *obj) { delete obj; }
-
-// ---------------------------------------------------------------------------
-
//! @cond Doxygen_Suppress
static AuthorityFactory::ObjectType
-convertPJObjectTypeToObjectType(PJ_OBJ_TYPE type, bool &valid) {
+convertPJObjectTypeToObjectType(PJ_TYPE type, bool &valid) {
valid = true;
AuthorityFactory::ObjectType cppType = AuthorityFactory::ObjectType::CRS;
switch (type) {
- case PJ_OBJ_TYPE_ELLIPSOID:
+ case PJ_TYPE_ELLIPSOID:
cppType = AuthorityFactory::ObjectType::ELLIPSOID;
break;
- case PJ_OBJ_TYPE_PRIME_MERIDIAN:
+ case PJ_TYPE_PRIME_MERIDIAN:
cppType = AuthorityFactory::ObjectType::PRIME_MERIDIAN;
break;
- case PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME:
- case PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME:
+ case PJ_TYPE_GEODETIC_REFERENCE_FRAME:
+ case PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME:
cppType = AuthorityFactory::ObjectType::GEODETIC_REFERENCE_FRAME;
break;
- case PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME:
- case PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME:
+ case PJ_TYPE_VERTICAL_REFERENCE_FRAME:
+ case PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME:
cppType = AuthorityFactory::ObjectType::VERTICAL_REFERENCE_FRAME;
break;
- case PJ_OBJ_TYPE_DATUM_ENSEMBLE:
+ case PJ_TYPE_DATUM_ENSEMBLE:
cppType = AuthorityFactory::ObjectType::DATUM;
break;
- case PJ_OBJ_TYPE_CRS:
+ case PJ_TYPE_CRS:
cppType = AuthorityFactory::ObjectType::CRS;
break;
- case PJ_OBJ_TYPE_GEODETIC_CRS:
+ case PJ_TYPE_GEODETIC_CRS:
cppType = AuthorityFactory::ObjectType::GEODETIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOCENTRIC_CRS:
+ case PJ_TYPE_GEOCENTRIC_CRS:
cppType = AuthorityFactory::ObjectType::GEOCENTRIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_CRS:
+ case PJ_TYPE_GEOGRAPHIC_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS:
+ case PJ_TYPE_GEOGRAPHIC_2D_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_2D_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS:
+ case PJ_TYPE_GEOGRAPHIC_3D_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_3D_CRS;
break;
- case PJ_OBJ_TYPE_VERTICAL_CRS:
+ case PJ_TYPE_VERTICAL_CRS:
cppType = AuthorityFactory::ObjectType::VERTICAL_CRS;
break;
- case PJ_OBJ_TYPE_PROJECTED_CRS:
+ case PJ_TYPE_PROJECTED_CRS:
cppType = AuthorityFactory::ObjectType::PROJECTED_CRS;
break;
- case PJ_OBJ_TYPE_COMPOUND_CRS:
+ case PJ_TYPE_COMPOUND_CRS:
cppType = AuthorityFactory::ObjectType::COMPOUND_CRS;
break;
- case PJ_OBJ_TYPE_ENGINEERING_CRS:
+ case PJ_TYPE_ENGINEERING_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_TEMPORAL_CRS:
+ case PJ_TYPE_TEMPORAL_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_BOUND_CRS:
+ case PJ_TYPE_BOUND_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_OTHER_CRS:
+ case PJ_TYPE_OTHER_CRS:
cppType = AuthorityFactory::ObjectType::CRS;
break;
- case PJ_OBJ_TYPE_CONVERSION:
+ case PJ_TYPE_CONVERSION:
cppType = AuthorityFactory::ObjectType::CONVERSION;
break;
- case PJ_OBJ_TYPE_TRANSFORMATION:
+ case PJ_TYPE_TRANSFORMATION:
cppType = AuthorityFactory::ObjectType::TRANSFORMATION;
break;
- case PJ_OBJ_TYPE_CONCATENATED_OPERATION:
+ case PJ_TYPE_CONCATENATED_OPERATION:
cppType = AuthorityFactory::ObjectType::CONCATENATED_OPERATION;
break;
- case PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION:
+ case PJ_TYPE_OTHER_COORDINATE_OPERATION:
cppType = AuthorityFactory::ObjectType::COORDINATE_OPERATION;
break;
- case PJ_OBJ_TYPE_UNKNOWN:
+ case PJ_TYPE_UNKNOWN:
valid = false;
break;
}
@@ -860,14 +848,14 @@ convertPJObjectTypeToObjectType(PJ_OBJ_TYPE type, bool &valid) {
* Or 0 for unlimited.
* @param options should be set to NULL for now
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
- const char *searchedName,
- const PJ_OBJ_TYPE *types,
- size_t typesCount, int approximateMatch,
- size_t limitResultCount,
- const char *const *options) {
+PJ_OBJ_LIST *proj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
+ const char *searchedName,
+ const PJ_TYPE *types, size_t typesCount,
+ int approximateMatch,
+ size_t limitResultCount,
+ const char *const *options) {
assert(searchedName);
assert((types != nullptr && typesCount > 0) ||
(types == nullptr && typesCount == 0));
@@ -905,40 +893,43 @@ PJ_OBJ_LIST *proj_obj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
* @param obj Object (must not be NULL)
* @return its type.
*/
-PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
+PJ_TYPE proj_get_type(const PJ *obj) {
assert(obj);
- auto ptr = obj->obj.get();
+ if (!obj->iso_obj) {
+ return PJ_TYPE_UNKNOWN;
+ }
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<Ellipsoid *>(ptr)) {
- return PJ_OBJ_TYPE_ELLIPSOID;
+ return PJ_TYPE_ELLIPSOID;
}
if (dynamic_cast<PrimeMeridian *>(ptr)) {
- return PJ_OBJ_TYPE_PRIME_MERIDIAN;
+ return PJ_TYPE_PRIME_MERIDIAN;
}
if (dynamic_cast<DynamicGeodeticReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME;
+ return PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME;
}
if (dynamic_cast<GeodeticReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME;
+ return PJ_TYPE_GEODETIC_REFERENCE_FRAME;
}
if (dynamic_cast<DynamicVerticalReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME;
+ return PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME;
}
if (dynamic_cast<VerticalReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME;
+ return PJ_TYPE_VERTICAL_REFERENCE_FRAME;
}
if (dynamic_cast<DatumEnsemble *>(ptr)) {
- return PJ_OBJ_TYPE_DATUM_ENSEMBLE;
+ return PJ_TYPE_DATUM_ENSEMBLE;
}
{
auto crs = dynamic_cast<GeographicCRS *>(ptr);
if (crs) {
if (crs->coordinateSystem()->axisList().size() == 2) {
- return PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS;
+ return PJ_TYPE_GEOGRAPHIC_2D_CRS;
} else {
- return PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS;
+ return PJ_TYPE_GEOGRAPHIC_3D_CRS;
}
}
}
@@ -947,49 +938,49 @@ PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
auto crs = dynamic_cast<GeodeticCRS *>(ptr);
if (crs) {
if (crs->isGeocentric()) {
- return PJ_OBJ_TYPE_GEOCENTRIC_CRS;
+ return PJ_TYPE_GEOCENTRIC_CRS;
} else {
- return PJ_OBJ_TYPE_GEODETIC_CRS;
+ return PJ_TYPE_GEODETIC_CRS;
}
}
}
if (dynamic_cast<VerticalCRS *>(ptr)) {
- return PJ_OBJ_TYPE_VERTICAL_CRS;
+ return PJ_TYPE_VERTICAL_CRS;
}
if (dynamic_cast<ProjectedCRS *>(ptr)) {
- return PJ_OBJ_TYPE_PROJECTED_CRS;
+ return PJ_TYPE_PROJECTED_CRS;
}
if (dynamic_cast<CompoundCRS *>(ptr)) {
- return PJ_OBJ_TYPE_COMPOUND_CRS;
+ return PJ_TYPE_COMPOUND_CRS;
}
if (dynamic_cast<TemporalCRS *>(ptr)) {
- return PJ_OBJ_TYPE_TEMPORAL_CRS;
+ return PJ_TYPE_TEMPORAL_CRS;
}
if (dynamic_cast<EngineeringCRS *>(ptr)) {
- return PJ_OBJ_TYPE_ENGINEERING_CRS;
+ return PJ_TYPE_ENGINEERING_CRS;
}
if (dynamic_cast<BoundCRS *>(ptr)) {
- return PJ_OBJ_TYPE_BOUND_CRS;
+ return PJ_TYPE_BOUND_CRS;
}
if (dynamic_cast<CRS *>(ptr)) {
- return PJ_OBJ_TYPE_OTHER_CRS;
+ return PJ_TYPE_OTHER_CRS;
}
if (dynamic_cast<Conversion *>(ptr)) {
- return PJ_OBJ_TYPE_CONVERSION;
+ return PJ_TYPE_CONVERSION;
}
if (dynamic_cast<Transformation *>(ptr)) {
- return PJ_OBJ_TYPE_TRANSFORMATION;
+ return PJ_TYPE_TRANSFORMATION;
}
if (dynamic_cast<ConcatenatedOperation *>(ptr)) {
- return PJ_OBJ_TYPE_CONCATENATED_OPERATION;
+ return PJ_TYPE_CONCATENATED_OPERATION;
}
if (dynamic_cast<CoordinateOperation *>(ptr)) {
- return PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION;
+ return PJ_TYPE_OTHER_COORDINATE_OPERATION;
}
- return PJ_OBJ_TYPE_UNKNOWN;
+ return PJ_TYPE_UNKNOWN;
}
// ---------------------------------------------------------------------------
@@ -999,9 +990,12 @@ PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
* @param obj Object (must not be NULL)
* @return TRUE if it is deprecated, FALSE otherwise
*/
-int proj_obj_is_deprecated(const PJ_OBJ *obj) {
+int proj_is_deprecated(const PJ *obj) {
assert(obj);
- return obj->obj->isDeprecated();
+ if (!obj->iso_obj) {
+ return false;
+ }
+ return obj->iso_obj->isDeprecated();
}
// ---------------------------------------------------------------------------
@@ -1012,12 +1006,12 @@ int proj_obj_is_deprecated(const PJ_OBJ *obj) {
* @param obj Object (of type CRS for now) for which non-deprecated objects
* must be searched. Must not be NULL
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ_OBJ_LIST *proj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ *obj) {
assert(obj);
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -1043,10 +1037,16 @@ PJ_OBJ_LIST *proj_obj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* @param criterion Comparison criterion
* @return TRUE if they are equivalent
*/
-int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
- PJ_COMPARISON_CRITERION criterion) {
+int proj_is_equivalent_to(const PJ *obj, const PJ *other,
+ PJ_COMPARISON_CRITERION criterion) {
assert(obj);
assert(other);
+ if (!obj->iso_obj) {
+ return false;
+ }
+ if (!other->iso_obj) {
+ return false;
+ }
// Make sure that the C and C++ enumerations match
static_assert(static_cast<int>(PJ_COMP_STRICT) ==
@@ -1071,7 +1071,7 @@ int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
}
const IComparable::Criterion cppCriterion =
static_cast<IComparable::Criterion>(criterion);
- return obj->obj->isEquivalentTo(other->obj.get(), cppCriterion);
+ return obj->iso_obj->isEquivalentTo(other->iso_obj.get(), cppCriterion);
}
// ---------------------------------------------------------------------------
@@ -1080,9 +1080,9 @@ int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
*
* @param obj Object (must not be NULL)
*/
-int proj_obj_is_crs(const PJ_OBJ *obj) {
+int proj_is_crs(const PJ *obj) {
assert(obj);
- return dynamic_cast<CRS *>(obj->obj.get()) != nullptr;
+ return dynamic_cast<CRS *>(obj->iso_obj.get()) != nullptr;
}
// ---------------------------------------------------------------------------
@@ -1094,9 +1094,12 @@ int proj_obj_is_crs(const PJ_OBJ *obj) {
* @param obj Object (must not be NULL)
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_name(const PJ_OBJ *obj) {
+const char *proj_get_name(const PJ *obj) {
assert(obj);
- const auto &desc = obj->obj->name()->description();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &desc = obj->iso_obj->name()->description();
if (!desc.has_value()) {
return nullptr;
}
@@ -1115,9 +1118,12 @@ const char *proj_obj_get_name(const PJ_OBJ *obj) {
* @param index Index of the identifier. 0 = first identifier
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_id_auth_name(const PJ_OBJ *obj, int index) {
+const char *proj_get_id_auth_name(const PJ *obj, int index) {
assert(obj);
- const auto &ids = obj->obj->identifiers();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &ids = obj->iso_obj->identifiers();
if (static_cast<size_t>(index) >= ids.size()) {
return nullptr;
}
@@ -1140,9 +1146,12 @@ const char *proj_obj_get_id_auth_name(const PJ_OBJ *obj, int index) {
* @param index Index of the identifier. 0 = first identifier
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
+const char *proj_get_id_code(const PJ *obj, int index) {
assert(obj);
- const auto &ids = obj->obj->identifiers();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &ids = obj->iso_obj->identifiers();
if (static_cast<size_t>(index) >= ids.size()) {
return nullptr;
}
@@ -1154,7 +1163,7 @@ const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
/** \brief Get a WKT representation of an object.
*
* The returned string is valid while the input obj parameter is valid,
- * and until a next call to proj_obj_as_wkt() with the same input object.
+ * and until a next call to proj_as_wkt() with the same input object.
*
* This function calls osgeo::proj::io::IWKTExportable::exportToWKT().
*
@@ -1177,10 +1186,13 @@ const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
* </ul>
* @return a string, or NULL in case of error.
*/
-const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- PJ_WKT_TYPE type, const char *const *options) {
+const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(obj);
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
// Make sure that the C and C++ enumerations match
static_assert(static_cast<int>(PJ_WKT2_2015) ==
@@ -1239,7 +1251,7 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
return nullptr;
}
}
- obj->lastWKT = obj->obj->exportToWKT(formatter.get());
+ obj->lastWKT = obj->iso_obj->exportToWKT(formatter.get());
return obj->lastWKT.c_str();
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -1252,7 +1264,7 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
/** \brief Get a PROJ string representation of an object.
*
* The returned string is valid while the input obj parameter is valid,
- * and until a next call to proj_obj_as_proj_string() with the same input
+ * and until a next call to proj_as_proj_string() with the same input
* object.
*
* This function calls
@@ -1271,13 +1283,13 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* use of etmerc by utm conversions)
* @return a string, or NULL in case of error.
*/
-const char *proj_obj_as_proj_string(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- PJ_PROJ_STRING_TYPE type,
- const char *const *options) {
+const char *proj_as_proj_string(PJ_CONTEXT *ctx, const PJ *obj,
+ PJ_PROJ_STRING_TYPE type,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(obj);
auto exportable =
- dynamic_cast<const IPROJStringExportable *>(obj->obj.get());
+ dynamic_cast<const IPROJStringExportable *>(obj->iso_obj.get());
if (!exportable) {
proj_log_error(ctx, __FUNCTION__, "Object type not exportable to PROJ");
return nullptr;
@@ -1339,17 +1351,17 @@ const char *proj_obj_as_proj_string(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @return TRUE in case of success, FALSE in case of error or if the area
* of use is unknown.
*/
-int proj_obj_get_area_of_use(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- double *out_west_lon_degree,
- double *out_south_lat_degree,
- double *out_east_lon_degree,
- double *out_north_lat_degree,
- const char **out_area_name) {
+int proj_get_area_of_use(PJ_CONTEXT *ctx, const PJ *obj,
+ double *out_west_lon_degree,
+ double *out_south_lat_degree,
+ double *out_east_lon_degree,
+ double *out_north_lat_degree,
+ const char **out_area_name) {
(void)ctx;
if (out_area_name) {
*out_area_name = nullptr;
}
- auto objectUsage = dynamic_cast<const ObjectUsage *>(obj->obj.get());
+ auto objectUsage = dynamic_cast<const ObjectUsage *>(obj->iso_obj.get());
if (!objectUsage) {
return false;
}
@@ -1403,10 +1415,10 @@ int proj_obj_get_area_of_use(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
// ---------------------------------------------------------------------------
-static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
+static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ *crs,
const char *fname) {
assert(crs);
- auto l_crs = dynamic_cast<const CRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const CRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, fname, "Object is not a CRS");
return nullptr;
@@ -1422,30 +1434,31 @@ static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
/** \brief Get the geodeticCRS / geographicCRS from a CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type CRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
auto geodCRS = extractGeodeticCRS(ctx, crs, __FUNCTION__);
if (!geodCRS) {
return nullptr;
}
- return PJ_OBJ::create(NN_NO_CHECK(nn_dynamic_pointer_cast<IdentifiedObject>(
- geodCRS->shared_from_this())));
+ return pj_obj_create(ctx,
+ NN_NO_CHECK(nn_dynamic_pointer_cast<IdentifiedObject>(
+ geodCRS->shared_from_this())));
}
// ---------------------------------------------------------------------------
/** \brief Get a CRS component from a CompoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1453,14 +1466,13 @@ PJ_OBJ *proj_obj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @param crs Objet of type CRS (must not be NULL)
* @param index Index of the CRS component (typically 0 = horizontal, 1 =
* vertical)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
- int index) {
+PJ *proj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ *crs, int index) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<CompoundCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<CompoundCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CompoundCRS");
return nullptr;
@@ -1469,14 +1481,14 @@ PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
if (static_cast<size_t>(index) >= components.size()) {
return nullptr;
}
- return PJ_OBJ::create(components[index]);
+ return pj_obj_create(ctx, components[index]);
}
// ---------------------------------------------------------------------------
/** \brief Returns a BoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1484,36 +1496,36 @@ PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
* @param base_crs Base CRS (must not be NULL)
* @param hub_crs Hub CRS (must not be NULL)
* @param transformation Transformation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
- const PJ_OBJ *hub_crs,
- const PJ_OBJ *transformation) {
+PJ *proj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ *base_crs,
+ const PJ *hub_crs, const PJ *transformation) {
SANITIZE_CTX(ctx);
assert(base_crs);
assert(hub_crs);
assert(transformation);
- auto l_base_crs = util::nn_dynamic_pointer_cast<CRS>(base_crs->obj);
+ auto l_base_crs = std::dynamic_pointer_cast<CRS>(base_crs->iso_obj);
if (!l_base_crs) {
proj_log_error(ctx, __FUNCTION__, "base_crs is not a CRS");
return nullptr;
}
- auto l_hub_crs = util::nn_dynamic_pointer_cast<CRS>(hub_crs->obj);
+ auto l_hub_crs = std::dynamic_pointer_cast<CRS>(hub_crs->iso_obj);
if (!l_hub_crs) {
proj_log_error(ctx, __FUNCTION__, "hub_crs is not a CRS");
return nullptr;
}
auto l_transformation =
- util::nn_dynamic_pointer_cast<Transformation>(transformation->obj);
+ std::dynamic_pointer_cast<Transformation>(transformation->iso_obj);
if (!l_transformation) {
proj_log_error(ctx, __FUNCTION__, "transformation is not a CRS");
return nullptr;
}
try {
- return PJ_OBJ::create(BoundCRS::create(NN_NO_CHECK(l_base_crs),
- NN_NO_CHECK(l_hub_crs),
- NN_NO_CHECK(l_transformation)));
+ return pj_obj_create(ctx,
+ BoundCRS::create(NN_NO_CHECK(l_base_crs),
+ NN_NO_CHECK(l_hub_crs),
+ NN_NO_CHECK(l_transformation)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -1525,7 +1537,7 @@ PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
/** \brief Returns potentially
* a BoundCRS, with a transformation to EPSG:4326, wrapping this CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1541,15 +1553,14 @@ PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
* intermediate CRS may be considered when computing the possible
* tranformations. Slower.</li>
* </ul>
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
- const PJ_OBJ *crs,
- const char *const *options) {
+PJ *proj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx, const PJ *crs,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const CRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const CRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CRS");
return nullptr;
@@ -1568,8 +1579,8 @@ PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
return nullptr;
}
}
- return PJ_OBJ::create(l_crs->createBoundCRSToWGS84IfPossible(
- dbContext, allowIntermediateCRS));
+ return pj_obj_create(ctx, l_crs->createBoundCRSToWGS84IfPossible(
+ dbContext, allowIntermediateCRS));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -1580,27 +1591,27 @@ PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
/** \brief Get the ellipsoid from a CRS or a GeodeticReferenceFrame.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type CRS or GeodeticReferenceFrame (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<const CRS *>(ptr)) {
auto geodCRS = extractGeodeticCRS(ctx, obj, __FUNCTION__);
if (geodCRS) {
- return PJ_OBJ::create(geodCRS->ellipsoid());
+ return pj_obj_create(ctx, geodCRS->ellipsoid());
}
} else {
auto datum = dynamic_cast<const GeodeticReferenceFrame *>(ptr);
if (datum) {
- return PJ_OBJ::create(datum->ellipsoid());
+ return pj_obj_create(ctx, datum->ellipsoid());
}
}
proj_log_error(ctx, __FUNCTION__,
@@ -1612,16 +1623,16 @@ PJ_OBJ *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
/** \brief Get the horizontal datum from a CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type CRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
auto geodCRS = extractGeodeticCRS(ctx, crs, __FUNCTION__);
if (!geodCRS) {
@@ -1629,12 +1640,12 @@ PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
}
const auto &datum = geodCRS->datum();
if (datum) {
- return PJ_OBJ::create(NN_NO_CHECK(datum));
+ return pj_obj_create(ctx, NN_NO_CHECK(datum));
}
const auto &datumEnsemble = geodCRS->datumEnsemble();
if (datumEnsemble) {
- return PJ_OBJ::create(NN_NO_CHECK(datumEnsemble));
+ return pj_obj_create(ctx, NN_NO_CHECK(datumEnsemble));
}
proj_log_error(ctx, __FUNCTION__, "CRS has no datum");
return nullptr;
@@ -1660,14 +1671,15 @@ PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* flattening. or NULL
* @return TRUE in case of success.
*/
-int proj_obj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ_OBJ *ellipsoid,
- double *out_semi_major_metre,
- double *out_semi_minor_metre,
- int *out_is_semi_minor_computed,
- double *out_inv_flattening) {
+int proj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ *ellipsoid,
+ double *out_semi_major_metre,
+ double *out_semi_minor_metre,
+ int *out_is_semi_minor_computed,
+ double *out_inv_flattening) {
SANITIZE_CTX(ctx);
assert(ellipsoid);
- auto l_ellipsoid = dynamic_cast<const Ellipsoid *>(ellipsoid->obj.get());
+ auto l_ellipsoid =
+ dynamic_cast<const Ellipsoid *>(ellipsoid->iso_obj.get());
if (!l_ellipsoid) {
proj_log_error(ctx, __FUNCTION__, "Object is not a Ellipsoid");
return FALSE;
@@ -1694,28 +1706,28 @@ int proj_obj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ_OBJ *ellipsoid,
/** \brief Get the prime meridian of a CRS or a GeodeticReferenceFrame.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type CRS or GeodeticReferenceFrame (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<CRS *>(ptr)) {
auto geodCRS = extractGeodeticCRS(ctx, obj, __FUNCTION__);
if (geodCRS) {
- return PJ_OBJ::create(geodCRS->primeMeridian());
+ return pj_obj_create(ctx, geodCRS->primeMeridian());
}
} else {
auto datum = dynamic_cast<const GeodeticReferenceFrame *>(ptr);
if (datum) {
- return PJ_OBJ::create(datum->primeMeridian());
+ return pj_obj_create(ctx, datum->primeMeridian());
}
}
proj_log_error(ctx, __FUNCTION__,
@@ -1737,14 +1749,15 @@ PJ_OBJ *proj_obj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* or NULL
* @return TRUE in case of success.
*/
-int proj_obj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
- const PJ_OBJ *prime_meridian,
- double *out_longitude,
- double *out_unit_conv_factor,
- const char **out_unit_name) {
+int proj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
+ const PJ *prime_meridian,
+ double *out_longitude,
+ double *out_unit_conv_factor,
+ const char **out_unit_name) {
SANITIZE_CTX(ctx);
assert(prime_meridian);
- auto l_pm = dynamic_cast<const PrimeMeridian *>(prime_meridian->obj.get());
+ auto l_pm =
+ dynamic_cast<const PrimeMeridian *>(prime_meridian->iso_obj.get());
if (!l_pm) {
proj_log_error(ctx, __FUNCTION__, "Object is not a PrimeMeridian");
return false;
@@ -1768,32 +1781,32 @@ int proj_obj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
/** \brief Return the base CRS of a BoundCRS or a DerivedCRS/ProjectedCRS, or
* the source CRS of a CoordinateOperation.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type BoundCRS or CoordinateOperation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error, or missing source CRS.
*/
-PJ_OBJ *proj_obj_get_source_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_source_crs(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
assert(obj);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto boundCRS = dynamic_cast<const BoundCRS *>(ptr);
if (boundCRS) {
- return PJ_OBJ::create(boundCRS->baseCRS());
+ return pj_obj_create(ctx, boundCRS->baseCRS());
}
auto derivedCRS = dynamic_cast<const DerivedCRS *>(ptr);
if (derivedCRS) {
- return PJ_OBJ::create(derivedCRS->baseCRS());
+ return pj_obj_create(ctx, derivedCRS->baseCRS());
}
auto co = dynamic_cast<const CoordinateOperation *>(ptr);
if (co) {
auto sourceCRS = co->sourceCRS();
if (sourceCRS) {
- return PJ_OBJ::create(NN_NO_CHECK(sourceCRS));
+ return pj_obj_create(ctx, NN_NO_CHECK(sourceCRS));
}
return nullptr;
}
@@ -1807,28 +1820,28 @@ PJ_OBJ *proj_obj_get_source_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
/** \brief Return the hub CRS of a BoundCRS or the target CRS of a
* CoordinateOperation.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type BoundCRS or CoordinateOperation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error, or missing target CRS.
*/
-PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_target_crs(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
assert(obj);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto boundCRS = dynamic_cast<const BoundCRS *>(ptr);
if (boundCRS) {
- return PJ_OBJ::create(boundCRS->hubCRS());
+ return pj_obj_create(ctx, boundCRS->hubCRS());
}
auto co = dynamic_cast<const CoordinateOperation *>(ptr);
if (co) {
auto targetCRS = co->targetCRS();
if (targetCRS) {
- return PJ_OBJ::create(NN_NO_CHECK(targetCRS));
+ return pj_obj_create(ctx, NN_NO_CHECK(targetCRS));
}
return nullptr;
}
@@ -1867,22 +1880,21 @@ PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* @param out_confidence Output parameter. Pointer to an array of integers that
* will be allocated by the function and filled with the confidence values
* (0-100). There are as many elements in this array as
- * proj_obj_list_get_count()
+ * proj_list_get_count()
* returns on the return value of this function. *confidence should be
* released with proj_int_list_destroy().
* @return a list of matching reference CRS, or nullptr in case of error.
*/
-PJ_OBJ_LIST *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *auth_name,
- const char *const *options,
- int **out_confidence) {
+PJ_OBJ_LIST *proj_identify(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *auth_name, const char *const *options,
+ int **out_confidence) {
SANITIZE_CTX(ctx);
assert(obj);
(void)options;
if (out_confidence) {
*out_confidence = nullptr;
}
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto crs = dynamic_cast<const CRS *>(ptr);
if (!crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CRS");
@@ -1960,7 +1972,7 @@ PROJ_STRING_LIST proj_get_authorities_from_database(PJ_CONTEXT *ctx) {
*/
PROJ_STRING_LIST proj_get_codes_from_database(PJ_CONTEXT *ctx,
const char *auth_name,
- PJ_OBJ_TYPE type,
+ PJ_TYPE type,
int allow_deprecated) {
assert(auth_name);
SANITIZE_CTX(ctx);
@@ -1997,25 +2009,25 @@ void proj_string_list_destroy(PROJ_STRING_LIST list) {
/** \brief Return the Conversion of a DerivedCRS (such as a ProjectedCRS),
* or the Transformation from the baseCRS to the hubCRS of a BoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type DerivedCRS or BoundCRSs (must not be NULL)
* @return Object of type SingleOperation that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
SingleOperationPtr co;
- auto derivedCRS = dynamic_cast<const DerivedCRS *>(crs->obj.get());
+ auto derivedCRS = dynamic_cast<const DerivedCRS *>(crs->iso_obj.get());
if (derivedCRS) {
co = derivedCRS->derivingConversion().as_nullable();
} else {
- auto boundCRS = dynamic_cast<const BoundCRS *>(crs->obj.get());
+ auto boundCRS = dynamic_cast<const BoundCRS *>(crs->iso_obj.get());
if (boundCRS) {
co = boundCRS->transformation().as_nullable();
} else {
@@ -2025,7 +2037,7 @@ PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
}
}
- return PJ_OBJ::create(NN_NO_CHECK(co));
+ return pj_obj_create(ctx, NN_NO_CHECK(co));
}
// ---------------------------------------------------------------------------
@@ -2044,7 +2056,7 @@ PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @return TRUE in case of success.
*/
int proj_coordoperation_get_method_info(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char **out_method_name,
const char **out_method_auth_name,
const char **out_method_code) {
@@ -2052,7 +2064,7 @@ int proj_coordoperation_get_method_info(PJ_CONTEXT *ctx,
assert(coordoperation);
auto singleOp =
- dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!singleOp) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a DerivedCRS or BoundCRS");
@@ -2197,7 +2209,7 @@ static GeodeticReferenceFrameNNPtr createGeodeticReferenceFrame(
/** \brief Create a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2218,17 +2230,19 @@ static GeodeticReferenceFrameNNPtr createGeodeticReferenceFrame(
* @param ellipsoidal_cs Coordinate system. Must not be NULL.
*
* @return Object of type GeographicCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geographic_crs(
- PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
- const char *ellps_name, double semi_major_metre, double inv_flattening,
- const char *prime_meridian_name, double prime_meridian_offset,
- const char *pm_angular_units, double pm_angular_units_conv,
- PJ_OBJ *ellipsoidal_cs) {
+PJ *proj_create_geographic_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const char *datum_name, const char *ellps_name,
+ double semi_major_metre, double inv_flattening,
+ const char *prime_meridian_name,
+ double prime_meridian_offset,
+ const char *pm_angular_units,
+ double pm_angular_units_conv,
+ PJ *ellipsoidal_cs) {
SANITIZE_CTX(ctx);
- auto cs = util::nn_dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->obj);
+ auto cs = std::dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->iso_obj);
if (!cs) {
return nullptr;
}
@@ -2239,7 +2253,7 @@ PJ_OBJ *proj_obj_create_geographic_crs(
pm_angular_units_conv);
auto geogCRS = GeographicCRS::create(createPropertyMapName(crs_name),
datum, NN_NO_CHECK(cs));
- return PJ_OBJ::create(geogCRS);
+ return pj_obj_create(ctx, geogCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2250,7 +2264,7 @@ PJ_OBJ *proj_obj_create_geographic_crs(
/** \brief Create a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2260,22 +2274,20 @@ PJ_OBJ *proj_obj_create_geographic_crs(
* @param ellipsoidal_cs Coordinate system. Must not be NULL.
*
* @return Object of type GeographicCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_name,
- PJ_OBJ *datum,
- PJ_OBJ *ellipsoidal_cs) {
+PJ *proj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
+ PJ *datum, PJ *ellipsoidal_cs) {
SANITIZE_CTX(ctx);
auto l_datum =
- util::nn_dynamic_pointer_cast<GeodeticReferenceFrame>(datum->obj);
+ std::dynamic_pointer_cast<GeodeticReferenceFrame>(datum->iso_obj);
if (!l_datum) {
proj_log_error(ctx, __FUNCTION__,
"datum is not a GeodeticReferenceFrame");
return nullptr;
}
- auto cs = util::nn_dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->obj);
+ auto cs = std::dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->iso_obj);
if (!cs) {
return nullptr;
}
@@ -2283,7 +2295,7 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
auto geogCRS =
GeographicCRS::create(createPropertyMapName(crs_name),
NN_NO_CHECK(l_datum), NN_NO_CHECK(cs));
- return PJ_OBJ::create(geogCRS);
+ return pj_obj_create(ctx, geogCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2294,7 +2306,7 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
/** \brief Create a GeodeticCRS of geocentric type.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2316,9 +2328,9 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type GeodeticCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geocentric_crs(
+PJ *proj_create_geocentric_crs(
PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
const char *ellps_name, double semi_major_metre, double inv_flattening,
const char *prime_meridian_name, double prime_meridian_offset,
@@ -2337,7 +2349,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
auto geodCRS =
GeodeticCRS::create(createPropertyMapName(crs_name), datum,
cs::CartesianCS::createGeocentric(linearUnit));
- return PJ_OBJ::create(geodCRS);
+ return pj_obj_create(ctx, geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2348,7 +2360,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
/** \brief Create a GeodeticCRS of geocentric type.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2360,19 +2372,18 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type GeodeticCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_name,
- const PJ_OBJ *datum,
- const char *linear_units,
- double linear_units_conv) {
+PJ *proj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
+ const PJ *datum,
+ const char *linear_units,
+ double linear_units_conv) {
SANITIZE_CTX(ctx);
try {
const UnitOfMeasure linearUnit(
createLinearUnit(linear_units, linear_units_conv));
auto l_datum =
- util::nn_dynamic_pointer_cast<GeodeticReferenceFrame>(datum->obj);
+ std::dynamic_pointer_cast<GeodeticReferenceFrame>(datum->iso_obj);
if (!l_datum) {
proj_log_error(ctx, __FUNCTION__,
"datum is not a GeodeticReferenceFrame");
@@ -2381,7 +2392,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
auto geodCRS = GeodeticCRS::create(
createPropertyMapName(crs_name), NN_NO_CHECK(l_datum),
cs::CartesianCS::createGeocentric(linearUnit));
- return PJ_OBJ::create(geodCRS);
+ return pj_obj_create(ctx, geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2392,7 +2403,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
/** \brief Create a VerticalCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2404,12 +2415,11 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type VerticalCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
- const char *datum_name,
- const char *linear_units,
- double linear_units_conv) {
+PJ *proj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const char *datum_name, const char *linear_units,
+ double linear_units_conv) {
SANITIZE_CTX(ctx);
try {
@@ -2420,7 +2430,7 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
auto vertCRS = VerticalCRS::create(
createPropertyMapName(crs_name), datum,
cs::VerticalCS::createGravityRelatedHeight(linearUnit));
- return PJ_OBJ::create(vertCRS);
+ return pj_obj_create(ctx, vertCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2431,7 +2441,7 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
/** \brief Create a CompoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2441,19 +2451,19 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
* @param vert_crs Vertical CRS. must not be NULL.
*
* @return Object of type CompoundCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
- PJ_OBJ *horiz_crs, PJ_OBJ *vert_crs) {
+PJ *proj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ PJ *horiz_crs, PJ *vert_crs) {
assert(horiz_crs);
assert(vert_crs);
SANITIZE_CTX(ctx);
- auto l_horiz_crs = util::nn_dynamic_pointer_cast<CRS>(horiz_crs->obj);
+ auto l_horiz_crs = std::dynamic_pointer_cast<CRS>(horiz_crs->iso_obj);
if (!l_horiz_crs) {
return nullptr;
}
- auto l_vert_crs = util::nn_dynamic_pointer_cast<CRS>(vert_crs->obj);
+ auto l_vert_crs = std::dynamic_pointer_cast<CRS>(vert_crs->iso_obj);
if (!l_vert_crs) {
return nullptr;
}
@@ -2461,7 +2471,7 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
auto compoundCRS = CompoundCRS::create(
createPropertyMapName(crs_name),
{NN_NO_CHECK(l_horiz_crs), NN_NO_CHECK(l_vert_crs)});
- return PJ_OBJ::create(compoundCRS);
+ return pj_obj_create(ctx, compoundCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2474,7 +2484,7 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
*
* Currently, only implemented on CRS objects.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2483,17 +2493,16 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
* @param name New name. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *name) {
+PJ PROJ_DLL *proj_alter_name(PJ_CONTEXT *ctx, const PJ *obj, const char *name) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
try {
- return PJ_OBJ::create(crs->alterName(name));
+ return pj_obj_create(ctx, crs->alterName(name));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2506,7 +2515,7 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* Currently, only implemented on CRS objects.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2516,17 +2525,17 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param code Code. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *auth_name, const char *code) {
+PJ PROJ_DLL *proj_alter_id(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *auth_name, const char *code) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
try {
- return PJ_OBJ::create(crs->alterId(auth_name, code));
+ return pj_obj_create(ctx, crs->alterId(auth_name, code));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2543,7 +2552,7 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* CRS with new_geod_crs.
* In other cases, it returns a clone of obj.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2552,27 +2561,27 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param new_geod_crs Object of type GeodeticCRS. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const PJ_OBJ *new_geod_crs) {
+PJ *proj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ *obj,
+ const PJ *new_geod_crs) {
SANITIZE_CTX(ctx);
auto l_new_geod_crs =
- util::nn_dynamic_pointer_cast<GeodeticCRS>(new_geod_crs->obj);
+ std::dynamic_pointer_cast<GeodeticCRS>(new_geod_crs->iso_obj);
if (!l_new_geod_crs) {
proj_log_error(ctx, __FUNCTION__, "new_geod_crs is not a GeodeticCRS");
return nullptr;
}
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
proj_log_error(ctx, __FUNCTION__, "obj is not a CRS");
return nullptr;
}
try {
- return PJ_OBJ::create(
- crs->alterGeodeticCRS(NN_NO_CHECK(l_new_geod_crs)));
+ return pj_obj_create(
+ ctx, crs->alterGeodeticCRS(NN_NO_CHECK(l_new_geod_crs)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2585,7 +2594,7 @@ PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2598,42 +2607,43 @@ PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param unit_code Unit code. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *angular_units,
- double angular_units_conv,
- const char *unit_auth_name,
- const char *unit_code) {
+PJ *proj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *angular_units,
+ double angular_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code) {
SANITIZE_CTX(ctx);
- auto geodCRS = proj_obj_crs_get_geodetic_crs(ctx, obj);
+ auto geodCRS = proj_crs_get_geodetic_crs(ctx, obj);
if (!geodCRS) {
return nullptr;
}
- auto geogCRS = dynamic_cast<const GeographicCRS *>(geodCRS->obj.get());
+ auto geogCRS = dynamic_cast<const GeographicCRS *>(geodCRS->iso_obj.get());
if (!geogCRS) {
- proj_obj_destroy(geodCRS);
+ proj_destroy(geodCRS);
return nullptr;
}
- PJ_OBJ *geogCRSAltered = nullptr;
+ PJ *geogCRSAltered = nullptr;
try {
const UnitOfMeasure angUnit(createAngularUnit(
angular_units, angular_units_conv, unit_auth_name, unit_code));
- geogCRSAltered = PJ_OBJ::create(GeographicCRS::create(
- createPropertyMapName(proj_obj_get_name(geodCRS)), geogCRS->datum(),
- geogCRS->datumEnsemble(),
- geogCRS->coordinateSystem()->alterAngularUnit(angUnit)));
- proj_obj_destroy(geodCRS);
+ geogCRSAltered = pj_obj_create(
+ ctx, GeographicCRS::create(
+ createPropertyMapName(proj_get_name(geodCRS)),
+ geogCRS->datum(), geogCRS->datumEnsemble(),
+ geogCRS->coordinateSystem()->alterAngularUnit(angUnit)));
+ proj_destroy(geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
- proj_obj_destroy(geodCRS);
+ proj_destroy(geodCRS);
return nullptr;
}
- auto ret = proj_obj_crs_alter_geodetic_crs(ctx, obj, geogCRSAltered);
- proj_obj_destroy(geogCRSAltered);
+ auto ret = proj_crs_alter_geodetic_crs(ctx, obj, geogCRSAltered);
+ proj_destroy(geogCRSAltered);
return ret;
}
@@ -2644,7 +2654,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a ProjectedCRS, VerticalCRS or a GeocentricCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2657,15 +2667,15 @@ PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param unit_code Unit code. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *linear_units,
- double linear_units_conv,
- const char *unit_auth_name,
- const char *unit_code) {
+PJ *proj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *linear_units,
+ double linear_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -2673,7 +2683,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
try {
const UnitOfMeasure linearUnit(createLinearUnit(
linear_units, linear_units_conv, unit_auth_name, unit_code));
- return PJ_OBJ::create(crs->alterCSLinearUnit(linearUnit));
+ return pj_obj_create(ctx, crs->alterCSLinearUnit(linearUnit));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2687,7 +2697,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a ProjectedCRS, VerticalCRS or a GeocentricCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2704,14 +2714,16 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* equivalent to the original one for reprojection purposes).
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
- PJ_CONTEXT *ctx, const PJ_OBJ *obj, const char *linear_units,
- double linear_units_conv, const char *unit_auth_name, const char *unit_code,
- int convert_to_new_unit) {
+PJ *proj_crs_alter_parameters_linear_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *linear_units,
+ double linear_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code,
+ int convert_to_new_unit) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const ProjectedCRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const ProjectedCRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -2719,8 +2731,8 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
try {
const UnitOfMeasure linearUnit(createLinearUnit(
linear_units, linear_units_conv, unit_auth_name, unit_code));
- return PJ_OBJ::create(crs->alterParametersLinearUnit(
- linearUnit, convert_to_new_unit == TRUE));
+ return pj_obj_create(ctx, crs->alterParametersLinearUnit(
+ linearUnit, convert_to_new_unit == TRUE));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2731,7 +2743,7 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
/** \brief Instanciate a EngineeringCRS with just a name
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2739,16 +2751,17 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
* @param crs_name CRS name. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_create_engineering_crs(PJ_CONTEXT *ctx,
- const char *crs_name) {
+PJ PROJ_DLL *proj_create_engineering_crs(PJ_CONTEXT *ctx,
+ const char *crs_name) {
SANITIZE_CTX(ctx);
try {
- return PJ_OBJ::create(EngineeringCRS::create(
- createPropertyMapName(crs_name),
- EngineeringDatum::create(PropertyMap()),
- CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)));
+ return pj_obj_create(
+ ctx, EngineeringCRS::create(
+ createPropertyMapName(crs_name),
+ EngineeringDatum::create(PropertyMap()),
+ CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2830,7 +2843,7 @@ static void setSingleOperationElements(
/** \brief Instanciate a Conversion
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2845,15 +2858,15 @@ static void setSingleOperationElements(
* @param params Parameter descriptions (array of size param_count)
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
- const char *auth_name, const char *code,
- const char *method_name,
- const char *method_auth_name,
- const char *method_code, int param_count,
- const PJ_PARAM_DESCRIPTION *params) {
+PJ *proj_create_conversion(PJ_CONTEXT *ctx, const char *name,
+ const char *auth_name, const char *code,
+ const char *method_name,
+ const char *method_auth_name,
+ const char *method_code, int param_count,
+ const PJ_PARAM_DESCRIPTION *params) {
SANITIZE_CTX(ctx);
try {
PropertyMap propSingleOp;
@@ -2865,8 +2878,8 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
name, auth_name, code, method_name, method_auth_name, method_code,
param_count, params, propSingleOp, propMethod, parameters, values);
- return PJ_OBJ::create(
- Conversion::create(propSingleOp, propMethod, parameters, values));
+ return pj_obj_create(ctx, Conversion::create(propSingleOp, propMethod,
+ parameters, values));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2877,7 +2890,7 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
/** \brief Instanciate a Transformation
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2900,26 +2913,28 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
* values means unknown.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_transformation(
- PJ_CONTEXT *ctx, const char *name, const char *auth_name, const char *code,
- PJ_OBJ *source_crs, PJ_OBJ *target_crs, PJ_OBJ *interpolation_crs,
- const char *method_name, const char *method_auth_name,
- const char *method_code, int param_count,
- const PJ_PARAM_DESCRIPTION *params, double accuracy) {
+PJ *proj_create_transformation(PJ_CONTEXT *ctx, const char *name,
+ const char *auth_name, const char *code,
+ PJ *source_crs, PJ *target_crs,
+ PJ *interpolation_crs, const char *method_name,
+ const char *method_auth_name,
+ const char *method_code, int param_count,
+ const PJ_PARAM_DESCRIPTION *params,
+ double accuracy) {
SANITIZE_CTX(ctx);
assert(source_crs);
assert(target_crs);
- auto l_sourceCRS = util::nn_dynamic_pointer_cast<CRS>(source_crs->obj);
+ auto l_sourceCRS = std::dynamic_pointer_cast<CRS>(source_crs->iso_obj);
if (!l_sourceCRS) {
proj_log_error(ctx, __FUNCTION__, "source_crs is not a CRS");
return nullptr;
}
- auto l_targetCRS = util::nn_dynamic_pointer_cast<CRS>(target_crs->obj);
+ auto l_targetCRS = std::dynamic_pointer_cast<CRS>(target_crs->iso_obj);
if (!l_targetCRS) {
proj_log_error(ctx, __FUNCTION__, "target_crs is not a CRS");
return nullptr;
@@ -2928,7 +2943,7 @@ PJ_OBJ *proj_obj_create_transformation(
CRSPtr l_interpolationCRS;
if (interpolation_crs) {
l_interpolationCRS =
- util::nn_dynamic_pointer_cast<CRS>(interpolation_crs->obj);
+ std::dynamic_pointer_cast<CRS>(interpolation_crs->iso_obj);
if (!l_interpolationCRS) {
proj_log_error(ctx, __FUNCTION__, "interpolation_crs is not a CRS");
return nullptr;
@@ -2951,9 +2966,11 @@ PJ_OBJ *proj_obj_create_transformation(
PositionalAccuracy::create(toString(accuracy)));
}
- return PJ_OBJ::create(Transformation::create(
- propSingleOp, NN_NO_CHECK(l_sourceCRS), NN_NO_CHECK(l_targetCRS),
- l_interpolationCRS, propMethod, parameters, values, accuracies));
+ return pj_obj_create(
+ ctx,
+ Transformation::create(propSingleOp, NN_NO_CHECK(l_sourceCRS),
+ NN_NO_CHECK(l_targetCRS), l_interpolationCRS,
+ propMethod, parameters, values, accuracies));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2984,13 +3001,14 @@ PJ_OBJ *proj_obj_create_transformation(
* @param new_method_name EPSG or PROJ target method name. Or nullptr (in which
* case new_method_epsg_code must be specified).
* @return new conversion that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_convert_conversion_to_other_method(
- PJ_CONTEXT *ctx, const PJ_OBJ *conversion, int new_method_epsg_code,
- const char *new_method_name) {
+PJ *proj_convert_conversion_to_other_method(PJ_CONTEXT *ctx,
+ const PJ *conversion,
+ int new_method_epsg_code,
+ const char *new_method_name) {
SANITIZE_CTX(ctx);
- auto conv = dynamic_cast<const Conversion *>(conversion->obj.get());
+ auto conv = dynamic_cast<const Conversion *>(conversion->iso_obj.get());
if (!conv) {
proj_log_error(ctx, __FUNCTION__, "not a Conversion");
return nullptr;
@@ -3019,7 +3037,7 @@ PJ_OBJ *proj_obj_convert_conversion_to_other_method(
auto new_conv = conv->convertToOtherMethod(new_method_epsg_code);
if (!new_conv)
return nullptr;
- return PJ_OBJ::create(NN_NO_CHECK(new_conv));
+ return pj_obj_create(ctx, NN_NO_CHECK(new_conv));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -3072,7 +3090,7 @@ static CoordinateSystemAxisNNPtr createAxis(const PJ_AXIS_DESCRIPTION &axis) {
/** \brief Instanciate a CoordinateSystem.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3082,11 +3100,11 @@ static CoordinateSystemAxisNNPtr createAxis(const PJ_AXIS_DESCRIPTION &axis) {
* @param axis Axis description (array of size axis_count)
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
- int axis_count, const PJ_AXIS_DESCRIPTION *axis) {
+PJ *proj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
+ int axis_count, const PJ_AXIS_DESCRIPTION *axis) {
try {
switch (type) {
case PJ_CS_TYPE_UNKNOWN:
@@ -3094,31 +3112,37 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
case PJ_CS_TYPE_CARTESIAN: {
if (axis_count == 2) {
- return PJ_OBJ::create(CartesianCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1])));
+ return pj_obj_create(
+ ctx, CartesianCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1])));
} else if (axis_count == 3) {
- return PJ_OBJ::create(CartesianCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, CartesianCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]),
+ createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_ELLIPSOIDAL: {
if (axis_count == 2) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1])));
+ return pj_obj_create(
+ ctx,
+ EllipsoidalCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1])));
} else if (axis_count == 3) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::create(
+ PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]), createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_VERTICAL: {
if (axis_count == 1) {
- return PJ_OBJ::create(
+ return pj_obj_create(
+ ctx,
VerticalCS::create(PropertyMap(), createAxis(axis[0])));
}
break;
@@ -3126,16 +3150,18 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
case PJ_CS_TYPE_SPHERICAL: {
if (axis_count == 3) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::create(
+ PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]), createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_PARAMETRIC: {
if (axis_count == 1) {
- return PJ_OBJ::create(
+ return pj_obj_create(
+ ctx,
ParametricCS::create(PropertyMap(), createAxis(axis[0])));
}
break;
@@ -3147,29 +3173,33 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
axisVector.emplace_back(createAxis(axis[i]));
}
- return PJ_OBJ::create(OrdinalCS::create(PropertyMap(), axisVector));
+ return pj_obj_create(ctx,
+ OrdinalCS::create(PropertyMap(), axisVector));
}
case PJ_CS_TYPE_DATETIMETEMPORAL: {
if (axis_count == 1) {
- return PJ_OBJ::create(DateTimeTemporalCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, DateTimeTemporalCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
case PJ_CS_TYPE_TEMPORALCOUNT: {
if (axis_count == 1) {
- return PJ_OBJ::create(TemporalCountCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, TemporalCountCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
case PJ_CS_TYPE_TEMPORALMEASURE: {
if (axis_count == 1) {
- return PJ_OBJ::create(TemporalMeasureCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, TemporalMeasureCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
@@ -3187,7 +3217,7 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
/** \brief Instanciate a CartesiansCS 2D
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3197,36 +3227,38 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
* @param unit_conv_factor Unit conversion factor to SI.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
- PJ_CARTESIAN_CS_2D_TYPE type,
- const char *unit_name,
- double unit_conv_factor) {
+PJ *proj_create_cartesian_2D_cs(PJ_CONTEXT *ctx, PJ_CARTESIAN_CS_2D_TYPE type,
+ const char *unit_name,
+ double unit_conv_factor) {
try {
switch (type) {
case PJ_CART2D_EASTING_NORTHING:
- return PJ_OBJ::create(CartesianCS::createEastingNorthing(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createEastingNorthing(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_NORTHING_EASTING:
- return PJ_OBJ::create(CartesianCS::createNorthingEasting(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createNorthingEasting(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_NORTH_POLE_EASTING_SOUTH_NORTHING_SOUTH:
- return PJ_OBJ::create(
- CartesianCS::createNorthPoleEastingSouthNorthingSouth(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createNorthPoleEastingSouthNorthingSouth(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_SOUTH_POLE_EASTING_NORTH_NORTHING_NORTH:
- return PJ_OBJ::create(
- CartesianCS::createSouthPoleEastingNorthNorthingNorth(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createSouthPoleEastingNorthNorthingNorth(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_WESTING_SOUTHING:
- return PJ_OBJ::create(CartesianCS::createWestingSouthing(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createWestingSouthing(
+ createLinearUnit(unit_name, unit_conv_factor)));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -3238,7 +3270,7 @@ PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
/** \brief Instanciate a Ellipsoidal 2D
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3248,22 +3280,24 @@ PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
* @param unit_conv_factor Unit conversion factor to SI.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
- PJ_ELLIPSOIDAL_CS_2D_TYPE type,
- const char *unit_name,
- double unit_conv_factor) {
+PJ *proj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
+ PJ_ELLIPSOIDAL_CS_2D_TYPE type,
+ const char *unit_name,
+ double unit_conv_factor) {
try {
switch (type) {
case PJ_ELLPS2D_LONGITUDE_LATITUDE:
- return PJ_OBJ::create(EllipsoidalCS::createLongitudeLatitude(
- createAngularUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::createLongitudeLatitude(
+ createAngularUnit(unit_name, unit_conv_factor)));
case PJ_ELLPS2D_LATITUDE_LONGITUDE:
- return PJ_OBJ::create(EllipsoidalCS::createLatitudeLongitude(
- createAngularUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::createLatitudeLongitude(
+ createAngularUnit(unit_name, unit_conv_factor)));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -3275,7 +3309,7 @@ PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
/** \brief Instanciate a ProjectedCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3286,32 +3320,32 @@ PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
* @param coordinate_system Cartesian coordinate system. Must not be NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
- const PJ_OBJ *geodetic_crs,
- const PJ_OBJ *conversion,
- const PJ_OBJ *coordinate_system) {
+PJ *proj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const PJ *geodetic_crs, const PJ *conversion,
+ const PJ *coordinate_system) {
SANITIZE_CTX(ctx);
auto geodCRS =
- util::nn_dynamic_pointer_cast<GeodeticCRS>(geodetic_crs->obj);
+ std::dynamic_pointer_cast<GeodeticCRS>(geodetic_crs->iso_obj);
if (!geodCRS) {
return nullptr;
}
- auto conv = util::nn_dynamic_pointer_cast<Conversion>(conversion->obj);
+ auto conv = std::dynamic_pointer_cast<Conversion>(conversion->iso_obj);
if (!conv) {
return nullptr;
}
auto cs =
- util::nn_dynamic_pointer_cast<CartesianCS>(coordinate_system->obj);
+ std::dynamic_pointer_cast<CartesianCS>(coordinate_system->iso_obj);
if (!cs) {
return nullptr;
}
try {
- return PJ_OBJ::create(ProjectedCRS::create(
- createPropertyMapName(crs_name), NN_NO_CHECK(geodCRS),
- NN_NO_CHECK(conv), NN_NO_CHECK(cs)));
+ return pj_obj_create(
+ ctx, ProjectedCRS::create(createPropertyMapName(crs_name),
+ NN_NO_CHECK(geodCRS), NN_NO_CHECK(conv),
+ NN_NO_CHECK(cs)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3322,8 +3356,9 @@ PJ_OBJ *proj_obj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
//! @cond Doxygen_Suppress
-static PJ_OBJ *proj_obj_create_conversion(const ConversionNNPtr &conv) {
- return PJ_OBJ::create(conv);
+static PJ *proj_create_conversion(PJ_CONTEXT *ctx,
+ const ConversionNNPtr &conv) {
+ return pj_obj_create(ctx, conv);
}
//! @endcond
@@ -3340,11 +3375,11 @@ static PJ_OBJ *proj_obj_create_conversion(const ConversionNNPtr &conv) {
* Linear parameters are expressed in (linear_unit_name,
* linear_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
+PJ *proj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
SANITIZE_CTX(ctx);
try {
auto conv = Conversion::createUTM(PropertyMap(), zone, north != 0);
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3361,7 +3396,7 @@ PJ_OBJ *proj_obj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
+PJ *proj_create_conversion_transverse_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3377,7 +3412,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3395,7 +3430,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
+PJ *proj_create_conversion_gauss_schreiber_transverse_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3411,7 +3446,7 @@ PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3429,7 +3464,7 @@ PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
+PJ *proj_create_conversion_transverse_mercator_south_oriented(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3445,7 +3480,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3462,7 +3497,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
+PJ *proj_create_conversion_two_point_equidistant(
PJ_CONTEXT *ctx, double latitude_first_point, double longitude_first_point,
double latitude_second_point, double longitude_secon_point,
double false_easting, double false_northing, const char *ang_unit_name,
@@ -3481,7 +3516,7 @@ PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
Angle(longitude_secon_point, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3498,7 +3533,7 @@ PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
+PJ *proj_create_conversion_tunisia_mapping_grid(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3513,7 +3548,7 @@ PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3530,7 +3565,7 @@ PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
+PJ *proj_create_conversion_albers_equal_area(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3550,7 +3585,7 @@ PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3567,7 +3602,7 @@ PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
+PJ *proj_create_conversion_lambert_conic_conformal_1sp(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3583,7 +3618,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3600,7 +3635,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3620,7 +3655,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3638,7 +3673,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp_michigan(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3659,7 +3694,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit),
Scale(ellipsoid_scaling_factor));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3677,7 +3712,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp_belgium(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3697,7 +3732,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3714,7 +3749,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
+PJ *proj_create_conversion_azimuthal_equidistant(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3730,7 +3765,7 @@ PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3747,7 +3782,7 @@ PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_guam_projection(
+PJ *proj_create_conversion_guam_projection(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3763,7 +3798,7 @@ PJ_OBJ *proj_obj_create_conversion_guam_projection(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3780,11 +3815,13 @@ PJ_OBJ *proj_obj_create_conversion_guam_projection(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_bonne(
- PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
- 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 *proj_create_conversion_bonne(PJ_CONTEXT *ctx, double latitude_nat_origin,
+ double longitude_nat_origin,
+ 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(
@@ -3796,7 +3833,7 @@ PJ_OBJ *proj_obj_create_conversion_bonne(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3814,7 +3851,7 @@ PJ_OBJ *proj_obj_create_conversion_bonne(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
+PJ *proj_create_conversion_lambert_cylindrical_equal_area_spherical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -3830,7 +3867,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3847,7 +3884,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
+PJ *proj_create_conversion_lambert_cylindrical_equal_area(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -3863,7 +3900,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3880,7 +3917,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
+PJ *proj_create_conversion_cassini_soldner(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3895,7 +3932,7 @@ PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3912,7 +3949,7 @@ PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
+PJ *proj_create_conversion_equidistant_conic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double latitude_first_parallel, double latitude_second_parallel,
double false_easting, double false_northing, const char *ang_unit_name,
@@ -3931,7 +3968,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
Angle(latitude_second_parallel, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3948,13 +3985,12 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -3965,7 +4001,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3982,11 +4018,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_ii(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_eckert_ii(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -3997,7 +4035,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_ii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4014,11 +4052,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_ii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_iii(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_eckert_iii(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4029,7 +4069,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4046,11 +4086,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_iv(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_eckert_iv(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4061,7 +4103,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iv(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4078,13 +4120,12 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iv(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4095,7 +4136,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4112,11 +4153,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_vi(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_eckert_vi(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4127,7 +4170,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_vi(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4144,7 +4187,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_vi(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
+PJ *proj_create_conversion_equidistant_cylindrical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -4160,7 +4203,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4178,7 +4221,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
+PJ *proj_create_conversion_equidistant_cylindrical_spherical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -4194,7 +4237,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4211,13 +4254,12 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4228,7 +4270,7 @@ PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
Conversion::createGall(PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4245,11 +4287,13 @@ PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_goode_homolosine(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4260,7 +4304,7 @@ PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4277,7 +4321,7 @@ PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
+PJ *proj_create_conversion_interrupted_goode_homolosine(
PJ_CONTEXT *ctx, double center_long, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4292,7 +4336,7 @@ PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4310,7 +4354,7 @@ PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
+PJ *proj_create_conversion_geostationary_satellite_sweep_x(
PJ_CONTEXT *ctx, double center_long, double height, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4325,7 +4369,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
PropertyMap(), Angle(center_long, angUnit),
Length(height, linearUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4343,7 +4387,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
+PJ *proj_create_conversion_geostationary_satellite_sweep_y(
PJ_CONTEXT *ctx, double center_long, double height, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4358,7 +4402,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
PropertyMap(), Angle(center_long, angUnit),
Length(height, linearUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4375,11 +4419,13 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gnomonic(
- PJ_CONTEXT *ctx, double center_lat, double center_long,
- 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 *proj_create_conversion_gnomonic(PJ_CONTEXT *ctx, double center_lat,
+ double center_long, 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(
@@ -4390,7 +4436,7 @@ PJ_OBJ *proj_obj_create_conversion_gnomonic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4408,7 +4454,7 @@ PJ_OBJ *proj_obj_create_conversion_gnomonic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
+PJ *proj_create_conversion_hotine_oblique_mercator_variant_a(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_projection_centre, double azimuth_initial_line,
double angle_from_rectified_to_skrew_grid, double scale,
@@ -4428,7 +4474,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
Angle(angle_from_rectified_to_skrew_grid, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4446,7 +4492,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
+PJ *proj_create_conversion_hotine_oblique_mercator_variant_b(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_projection_centre, double azimuth_initial_line,
double angle_from_rectified_to_skrew_grid, double scale,
@@ -4466,7 +4512,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
Angle(angle_from_rectified_to_skrew_grid, angUnit), Scale(scale),
Length(easting_projection_centre, linearUnit),
Length(northing_projection_centre, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4484,8 +4530,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *
-proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
+PJ *proj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
PJ_CONTEXT *ctx, double latitude_projection_centre, double latitude_point1,
double longitude_point1, double latitude_point2, double longitude_point2,
double scale, double easting_projection_centre,
@@ -4507,7 +4552,7 @@ proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
Angle(longitude_point2, angUnit), Scale(scale),
Length(easting_projection_centre, linearUnit),
Length(northing_projection_centre, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4525,7 +4570,7 @@ proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
* 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 *proj_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,
@@ -4543,7 +4588,7 @@ PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator(
Angle(azimuth_initial_line, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4561,7 +4606,7 @@ PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
+PJ *proj_create_conversion_international_map_world_polyconic(
PJ_CONTEXT *ctx, double center_long, double latitude_first_parallel,
double latitude_second_parallel, double false_easting,
double false_northing, const char *ang_unit_name,
@@ -4579,7 +4624,7 @@ PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
Angle(latitude_second_parallel, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4596,7 +4641,7 @@ PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
+PJ *proj_create_conversion_krovak_north_oriented(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_of_origin, double colatitude_cone_axis,
double latitude_pseudo_standard_parallel,
@@ -4618,7 +4663,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
Scale(scale_factor_pseudo_standard_parallel),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4635,7 +4680,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_krovak(
+PJ *proj_create_conversion_krovak(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_of_origin, double colatitude_cone_axis,
double latitude_pseudo_standard_parallel,
@@ -4657,7 +4702,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak(
Scale(scale_factor_pseudo_standard_parallel),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4674,7 +4719,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
+PJ *proj_create_conversion_lambert_azimuthal_equal_area(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4690,7 +4735,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4707,7 +4752,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
+PJ *proj_create_conversion_miller_cylindrical(
PJ_CONTEXT *ctx, double center_long, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4722,7 +4767,7 @@ PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4739,7 +4784,7 @@ PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
+PJ *proj_create_conversion_mercator_variant_a(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4755,7 +4800,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4772,7 +4817,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
+PJ *proj_create_conversion_mercator_variant_b(
PJ_CONTEXT *ctx, double latitude_first_parallel, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4787,7 +4832,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
PropertyMap(), Angle(latitude_first_parallel, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4805,7 +4850,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
+PJ *proj_create_conversion_popular_visualisation_pseudo_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4820,7 +4865,7 @@ PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4837,11 +4882,13 @@ PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mollweide(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_mollweide(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -4852,7 +4899,7 @@ PJ_OBJ *proj_obj_create_conversion_mollweide(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4869,7 +4916,7 @@ PJ_OBJ *proj_obj_create_conversion_mollweide(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
+PJ *proj_create_conversion_new_zealand_mapping_grid(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4884,7 +4931,7 @@ PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4901,7 +4948,7 @@ PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
+PJ *proj_create_conversion_oblique_stereographic(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4917,7 +4964,7 @@ PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4934,7 +4981,7 @@ PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_orthographic(
+PJ *proj_create_conversion_orthographic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4949,7 +4996,7 @@ PJ_OBJ *proj_obj_create_conversion_orthographic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4966,7 +5013,7 @@ PJ_OBJ *proj_obj_create_conversion_orthographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_american_polyconic(
+PJ *proj_create_conversion_american_polyconic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4981,7 +5028,7 @@ PJ_OBJ *proj_obj_create_conversion_american_polyconic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4998,7 +5045,7 @@ PJ_OBJ *proj_obj_create_conversion_american_polyconic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
+PJ *proj_create_conversion_polar_stereographic_variant_a(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5014,7 +5061,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5031,7 +5078,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
+PJ *proj_create_conversion_polar_stereographic_variant_b(
PJ_CONTEXT *ctx, double latitude_standard_parallel,
double longitude_of_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -5047,7 +5094,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
Angle(longitude_of_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5064,13 +5111,12 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5081,7 +5127,7 @@ PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5098,11 +5144,13 @@ PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_sinusoidal(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_sinusoidal(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5113,7 +5161,7 @@ PJ_OBJ *proj_obj_create_conversion_sinusoidal(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5130,7 +5178,7 @@ PJ_OBJ *proj_obj_create_conversion_sinusoidal(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_stereographic(
+PJ *proj_create_conversion_stereographic(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5146,7 +5194,7 @@ PJ_OBJ *proj_obj_create_conversion_stereographic(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5163,11 +5211,13 @@ PJ_OBJ *proj_obj_create_conversion_stereographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_van_der_grinten(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5178,7 +5228,7 @@ PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5195,13 +5245,12 @@ PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5212,7 +5261,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5229,11 +5278,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_ii(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_wagner_ii(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5244,7 +5295,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_ii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5261,7 +5312,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_ii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_iii(
+PJ *proj_create_conversion_wagner_iii(
PJ_CONTEXT *ctx, double latitude_true_scale, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5276,7 +5327,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iii(
PropertyMap(), Angle(latitude_true_scale, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5293,11 +5344,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_iv(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_wagner_iv(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5308,7 +5361,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iv(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5325,13 +5378,12 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iv(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
- 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 *proj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5342,7 +5394,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5359,11 +5411,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_vi(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_wagner_vi(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5374,7 +5428,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vi(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5391,11 +5445,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vi(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_vii(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_wagner_vii(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5406,7 +5462,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5424,7 +5480,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
+PJ *proj_create_conversion_quadrilateralized_spherical_cube(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5439,7 +5495,7 @@ PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5456,7 +5512,7 @@ PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
+PJ *proj_create_conversion_spherical_cross_track_height(
PJ_CONTEXT *ctx, double peg_point_lat, double peg_point_long,
double peg_point_heading, double peg_point_height,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -5471,7 +5527,7 @@ PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
PropertyMap(), Angle(peg_point_lat, angUnit),
Angle(peg_point_long, angUnit), Angle(peg_point_heading, angUnit),
Length(peg_point_height, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5488,11 +5544,13 @@ PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equal_earth(
- PJ_CONTEXT *ctx, double center_long, 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 *proj_create_conversion_equal_earth(PJ_CONTEXT *ctx, double center_long,
+ 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(
@@ -5503,7 +5561,7 @@ PJ_OBJ *proj_obj_create_conversion_equal_earth(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5524,10 +5582,10 @@ PJ_OBJ *proj_obj_create_conversion_equal_earth(
*/
int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
assert(coordoperation);
- auto op =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto op = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -5551,10 +5609,11 @@ int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return 0;
@@ -5574,12 +5633,13 @@ int proj_coordoperation_get_param_count(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param_index(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char *name) {
SANITIZE_CTX(ctx);
assert(coordoperation);
assert(name);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return -1;
@@ -5628,15 +5688,15 @@ int proj_coordoperation_get_param_index(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param(
- PJ_CONTEXT *ctx, const PJ_OBJ *coordoperation, int index,
- const char **out_name, const char **out_auth_name, const char **out_code,
- double *out_value, const char **out_value_string,
- double *out_unit_conv_factor, const char **out_unit_name,
- const char **out_unit_auth_name, const char **out_unit_code,
- const char **out_unit_category) {
+ PJ_CONTEXT *ctx, const PJ *coordoperation, int index, const char **out_name,
+ const char **out_auth_name, const char **out_code, double *out_value,
+ const char **out_value_string, double *out_unit_conv_factor,
+ const char **out_unit_name, const char **out_unit_auth_name,
+ const char **out_unit_code, const char **out_unit_category) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return false;
@@ -5751,13 +5811,13 @@ int proj_coordoperation_get_param(
*/
int proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
double *out_values, int value_count,
int emit_error_if_incompatible) {
SANITIZE_CTX(ctx);
assert(coordoperation);
auto transf =
- dynamic_cast<const Transformation *>(coordoperation->obj.get());
+ dynamic_cast<const Transformation *>(coordoperation->iso_obj.get());
if (!transf) {
if (emit_error_if_incompatible) {
proj_log_error(ctx, __FUNCTION__, "Object is not a Transformation");
@@ -5789,11 +5849,11 @@ int proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto co =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto co = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!co) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -5842,7 +5902,7 @@ int proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_grid_used(
- PJ_CONTEXT *ctx, const PJ_OBJ *coordoperation, int index,
+ PJ_CONTEXT *ctx, const PJ *coordoperation, int index,
const char **out_short_name, const char **out_full_name,
const char **out_package_name, const char **out_url,
int *out_direct_download, int *out_open_license, int *out_available) {
@@ -6239,22 +6299,23 @@ void proj_operation_factory_context_set_allowed_intermediate_crs(
* @param target_crs source CRS. Must not be NULL.
* @param operationContext Search context. Must not be NULL.
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_create_operations(
- PJ_CONTEXT *ctx, const PJ_OBJ *source_crs, const PJ_OBJ *target_crs,
- const PJ_OPERATION_FACTORY_CONTEXT *operationContext) {
+PJ_OBJ_LIST *
+proj_create_operations(PJ_CONTEXT *ctx, const PJ *source_crs,
+ const PJ *target_crs,
+ const PJ_OPERATION_FACTORY_CONTEXT *operationContext) {
SANITIZE_CTX(ctx);
assert(source_crs);
assert(target_crs);
assert(operationContext);
- auto sourceCRS = nn_dynamic_pointer_cast<CRS>(source_crs->obj);
+ auto sourceCRS = std::dynamic_pointer_cast<CRS>(source_crs->iso_obj);
if (!sourceCRS) {
proj_log_error(ctx, __FUNCTION__, "source_crs is not a CRS");
return nullptr;
}
- auto targetCRS = nn_dynamic_pointer_cast<CRS>(target_crs->obj);
+ auto targetCRS = std::dynamic_pointer_cast<CRS>(target_crs->iso_obj);
if (!targetCRS) {
proj_log_error(ctx, __FUNCTION__, "target_crs is not a CRS");
return nullptr;
@@ -6282,7 +6343,7 @@ PJ_OBJ_LIST *proj_obj_create_operations(
*
* @param result Objet of type PJ_OBJ_LIST (must not be NULL)
*/
-int proj_obj_list_get_count(const PJ_OBJ_LIST *result) {
+int proj_list_get_count(const PJ_OBJ_LIST *result) {
assert(result);
return static_cast<int>(result->objects.size());
}
@@ -6291,26 +6352,25 @@ int proj_obj_list_get_count(const PJ_OBJ_LIST *result) {
/** \brief Return an object from the result set
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param result Objet of type PJ_OBJ_LIST (must not be NULL)
* @param index Index
- * @return a new object that must be unreferenced with proj_obj_destroy(),
+ * @return a new object that must be unreferenced with proj_destroy(),
* or nullptr in case of error.
*/
-PJ_OBJ *proj_obj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result,
- int index) {
+PJ *proj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result, int index) {
SANITIZE_CTX(ctx);
assert(result);
- if (index < 0 || index >= proj_obj_list_get_count(result)) {
+ if (index < 0 || index >= proj_list_get_count(result)) {
proj_log_error(ctx, __FUNCTION__, "Invalid index");
return nullptr;
}
- return PJ_OBJ::create(result->objects[index]);
+ return pj_obj_create(ctx, result->objects[index]);
}
// ---------------------------------------------------------------------------
@@ -6322,7 +6382,7 @@ PJ_OBJ *proj_obj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result,
*
* @param result Object, or NULL.
*/
-void proj_obj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
+void proj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
// ---------------------------------------------------------------------------
@@ -6333,11 +6393,11 @@ void proj_obj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
* @return the accuracy, or a negative value if unknown or in case of error.
*/
double proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto co =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto co = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!co) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -6358,19 +6418,19 @@ double proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx,
/** \brief Returns the datum of a SingleCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type SingleCRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error (or if there is no datum)
*/
-PJ_OBJ *proj_obj_crs_get_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_datum(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const SingleCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const SingleCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleCRS");
return nullptr;
@@ -6379,31 +6439,31 @@ PJ_OBJ *proj_obj_crs_get_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
if (!datum) {
return nullptr;
}
- return PJ_OBJ::create(NN_NO_CHECK(datum));
+ return pj_obj_create(ctx, NN_NO_CHECK(datum));
}
// ---------------------------------------------------------------------------
/** \brief Returns the coordinate system of a SingleCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type SingleCRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const SingleCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const SingleCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleCRS");
return nullptr;
}
- return PJ_OBJ::create(l_crs->coordinateSystem());
+ return pj_obj_create(ctx, l_crs->coordinateSystem());
}
// ---------------------------------------------------------------------------
@@ -6414,11 +6474,10 @@ PJ_OBJ *proj_obj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @return type, or PJ_CS_TYPE_UNKNOWN in case of error.
*/
-PJ_COORDINATE_SYSTEM_TYPE proj_obj_cs_get_type(PJ_CONTEXT *ctx,
- const PJ_OBJ *cs) {
+PJ_COORDINATE_SYSTEM_TYPE proj_cs_get_type(PJ_CONTEXT *ctx, const PJ *cs) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return PJ_CS_TYPE_UNKNOWN;
@@ -6461,10 +6520,10 @@ PJ_COORDINATE_SYSTEM_TYPE proj_obj_cs_get_type(PJ_CONTEXT *ctx,
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @return number of axis, or -1 in case of error.
*/
-int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
+int proj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ *cs) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return -1;
@@ -6479,7 +6538,7 @@ int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
* @param ctx PROJ context, or NULL for default context
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @param index Index of the coordinate system (between 0 and
- * proj_obj_cs_get_axis_count() - 1)
+ * proj_cs_get_axis_count() - 1)
* @param out_name Pointer to a string value to store the axis name. or NULL
* @param out_abbrev Pointer to a string value to store the axis abbreviation.
* or NULL
@@ -6495,16 +6554,16 @@ int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
* 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_auth_name,
- const char **out_unit_code) {
+int proj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ *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_auth_name,
+ const char **out_unit_code) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return false;