aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-27 19:38:52 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-27 19:38:52 +0100
commitd669631ad36641e49fca9e96a4bdd5e590efa239 (patch)
treed77d1d3629f46680a359518e94195b03e4804d16 /src
parent81ec8c0b58d66333fccd3703dab62a11132a0331 (diff)
downloadPROJ-d669631ad36641e49fca9e96a4bdd5e590efa239.tar.gz
PROJ-d669631ad36641e49fca9e96a4bdd5e590efa239.zip
proj_create_crs_to_crs(): add debugging traces
Diffstat (limited to 'src')
-rw-r--r--src/4D_api.cpp4
-rw-r--r--src/internal.cpp10
-rw-r--r--src/proj_internal.h2
3 files changed, 16 insertions, 0 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index 88210348..de950c7a 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -757,11 +757,13 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
src = proj_obj_create_from_user_input(ctx, source_crs, optionsImportCRS);
if( !src ) {
+ proj_context_log_debug(ctx, "Cannot instanciate source_crs");
return nullptr;
}
dst = proj_obj_create_from_user_input(ctx, target_crs, optionsImportCRS);
if( !dst ) {
+ proj_context_log_debug(ctx, "Cannot instanciate target_crs");
proj_obj_destroy(src);
return nullptr;
}
@@ -798,6 +800,7 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
if( proj_obj_list_get_count(op_list) == 0 ) {
proj_obj_list_destroy(op_list);
+ proj_context_log_debug(ctx, "No operation found matching criteria");
return nullptr;
}
@@ -810,6 +813,7 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
proj_string = proj_obj_as_proj_string(ctx, op, PJ_PROJ_5, nullptr);
if( !proj_string) {
proj_obj_destroy(op);
+ proj_context_log_debug(ctx, "Cannot export operation as a PROJ string");
return nullptr;
}
diff --git a/src/internal.cpp b/src/internal.cpp
index 3f3d191e..41744d16 100644
--- a/src/internal.cpp
+++ b/src/internal.cpp
@@ -416,6 +416,16 @@ void proj_log_debug (PJ *P, const char *fmt, ...) {
va_end( args );
}
+/*****************************************************************************/
+void proj_context_log_debug (PJ_CONTEXT *ctx, const char *fmt, ...) {
+/******************************************************************************
+ For reporting debugging information.
+******************************************************************************/
+ va_list args;
+ va_start( args, fmt );
+ pj_vlog (ctx, PJ_LOG_DEBUG_MAJOR , fmt, args);
+ va_end( args );
+}
/*****************************************************************************/
void proj_log_trace (PJ *P, const char *fmt, ...) {
diff --git a/src/proj_internal.h b/src/proj_internal.h
index d5154f78..e0999d88 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -111,6 +111,8 @@ void PROJ_DLL proj_log_error (PJ *P, const char *fmt, ...);
void proj_log_debug (PJ *P, const char *fmt, ...);
void proj_log_trace (PJ *P, const char *fmt, ...);
+void proj_context_log_debug (PJ_CONTEXT *ctx, const char *fmt, ...);
+
int pj_ellipsoid (PJ *);
void pj_inherit_ellipsoid_def (const PJ *src, PJ *dst);
void pj_erase_ellipsoid_def (PJ *P);