aboutsummaryrefslogtreecommitdiff
path: root/src/conversions/unitconvert.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-17 00:24:03 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-17 00:52:19 +0100
commit4724025e6c817761052fc0dc8810fd489a9e0104 (patch)
tree21117e52f95b8f36880efef8cd71c1fcec21242c /src/conversions/unitconvert.cpp
parent66fd99a8831955034cb25c8468ecfe1f9d3a7d62 (diff)
parentd76e6202d27c730b4dcbf16b8c1575c11b703485 (diff)
downloadPROJ-4724025e6c817761052fc0dc8810fd489a9e0104.tar.gz
PROJ-4724025e6c817761052fc0dc8810fd489a9e0104.zip
Merge branch 'master' into rfc4_merge_back_master
Diffstat (limited to 'src/conversions/unitconvert.cpp')
-rw-r--r--src/conversions/unitconvert.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp
index 377f384e..f8439aee 100644
--- a/src/conversions/unitconvert.cpp
+++ b/src/conversions/unitconvert.cpp
@@ -164,7 +164,8 @@ static double decimalyear_to_mjd(double decimalyear) {
double fractional_year;
double mjd;
- if( decimalyear < -10000 || decimalyear > 10000 )
+ // Written this way to deal with NaN input
+ if( !(decimalyear >= -10000 && decimalyear <= 10000) )
return 0;
year = lround(floor(decimalyear));
@@ -470,7 +471,7 @@ PJ *CONVERSION(unitconvert,0) {
const char* normalized_name = nullptr;
f = get_unit_conversion_factor(name, &xy_in_is_linear, &normalized_name);
if (f != 0.0) {
- proj_log_debug(P, "xy_in unit: %s", normalized_name);
+ proj_log_trace(P, "xy_in unit: %s", normalized_name);
} else {
f = pj_param (P->ctx, P->params, "dxy_in").f;
if (f == 0.0 || 1.0 / f == 0.0)
@@ -485,7 +486,7 @@ PJ *CONVERSION(unitconvert,0) {
const char* normalized_name = nullptr;
f = get_unit_conversion_factor(name, &xy_out_is_linear, &normalized_name);
if (f != 0.0) {
- proj_log_debug(P, "xy_out unit: %s", normalized_name);
+ proj_log_trace(P, "xy_out unit: %s", normalized_name);
} else {
f = pj_param (P->ctx, P->params, "dxy_out").f;
if (f == 0.0 || 1.0 / f == 0.0)
@@ -506,7 +507,7 @@ PJ *CONVERSION(unitconvert,0) {
const char* normalized_name = nullptr;
f = get_unit_conversion_factor(name, &z_in_is_linear, &normalized_name);
if (f != 0.0) {
- proj_log_debug(P, "z_in unit: %s", normalized_name);
+ proj_log_trace(P, "z_in unit: %s", normalized_name);
} else {
f = pj_param (P->ctx, P->params, "dz_in").f;
if (f == 0.0 || 1.0 / f == 0.0)
@@ -519,7 +520,7 @@ PJ *CONVERSION(unitconvert,0) {
const char* normalized_name = nullptr;
f = get_unit_conversion_factor(name, &z_out_is_linear, &normalized_name);
if (f != 0.0) {
- proj_log_debug(P, "z_out unit: %s", normalized_name);
+ proj_log_trace(P, "z_out unit: %s", normalized_name);
} else {
f = pj_param (P->ctx, P->params, "dz_out").f;
if (f == 0.0 || 1.0 / f == 0.0)
@@ -540,7 +541,7 @@ PJ *CONVERSION(unitconvert,0) {
if (!s) return pj_default_destructor(P, PJD_ERR_UNKNOWN_UNIT_ID); /* unknown unit conversion id */
Q->t_in_id = i;
- proj_log_debug(P, "t_in unit: %s", time_units[i].name);
+ proj_log_trace(P, "t_in unit: %s", time_units[i].name);
}
s = nullptr;
@@ -550,7 +551,7 @@ PJ *CONVERSION(unitconvert,0) {
if (!s) return pj_default_destructor(P, PJD_ERR_UNKNOWN_UNIT_ID); /* unknown unit conversion id */
Q->t_out_id = i;
- proj_log_debug(P, "t_out unit: %s", time_units[i].name);
+ proj_log_trace(P, "t_out unit: %s", time_units[i].name);
}
return P;