aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/source/apps/projinfo.rst3
-rw-r--r--docs/source/resource_files.rst2
-rw-r--r--docs/source/usage/differences.rst9
-rw-r--r--src/apps/cct.cpp42
-rw-r--r--src/apps/projinfo.cpp13
5 files changed, 33 insertions, 36 deletions
diff --git a/docs/source/apps/projinfo.rst b/docs/source/apps/projinfo.rst
index 6236056d..2715f687 100644
--- a/docs/source/apps/projinfo.rst
+++ b/docs/source/apps/projinfo.rst
@@ -77,6 +77,9 @@ The following control parameters can appear in any order:
.. note:: WKT2_2019 was previously called WKT2_2018.
+ .. note:: Before PROJ 6.3.0, WKT1:GDAL was implicitly calling --boundcrs-to-wgs84.
+ This is no longer the case.
+
.. option:: -k crs|operation|ellipsoid
When used to query a single object with a AUTHORITY:CODE, determines the (k)ind of the object
diff --git a/docs/source/resource_files.rst b/docs/source/resource_files.rst
index 13b9386d..7a0ede63 100644
--- a/docs/source/resource_files.rst
+++ b/docs/source/resource_files.rst
@@ -18,7 +18,7 @@ Where are PROJ resource files looked for ?
-------------------------------------------------------------------------------
PROJ will attempt to locate its resource files - database, transformation grids
-or init-files - from several dictionaries.
+or init-files - from several directories.
The following paths are checked in order:
- For transformation grids that have an explict relative or absolute path,
diff --git a/docs/source/usage/differences.rst b/docs/source/usage/differences.rst
index 4d05543a..b1c3d1a9 100644
--- a/docs/source/usage/differences.rst
+++ b/docs/source/usage/differences.rst
@@ -114,3 +114,12 @@ exclusive with :option:`+t_epoch`. :option:`+dt` is used when deformation
for a set amount of time is needed and :option:`+t_epoch` is used (in
conjunction with the observation time of the input coordinate) when
deformation from a specific epoch to the observation time is needed.
+
+Version 6.3.0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+projinfo
+--------
+
+Before PROJ 6.3.0, WKT1:GDAL was implicitly calling --boundcrs-to-wgs84, to
+add a TOWGS84[] node in some cases. This is no longer the case.
diff --git a/src/apps/cct.cpp b/src/apps/cct.cpp
index d29b58fb..f7413872 100644
--- a/src/apps/cct.cpp
+++ b/src/apps/cct.cpp
@@ -161,19 +161,13 @@ static void logger(void *data, int level, const char *msg) {
/* if we use PJ_LOG_NONE we always want to print stuff to stream */
if (level == PJ_LOG_NONE) {
- fprintf(stream, "%s", msg);
+ fprintf(stream, "%s\n", msg);
return;
}
- /* should always print to stderr if level == PJ_LOG_ERROR */
- if (level == PJ_LOG_ERROR) {
- fprintf(stderr, "%s", msg);
- return;
- }
-
- /* otherwise only print if log level set by user is high enough */
- if (level <= log_tell)
- fprintf(stream, "%s", msg);
+ /* otherwise only print if log level set by user is high enough or error */
+ if (level <= log_tell || level == PJ_LOG_ERROR)
+ fprintf(stderr, "%s\n", msg);
}
FILE *fout;
@@ -240,23 +234,25 @@ int main(int argc, char **argv) {
PJ_DIRECTION direction = opt_given (o, "I")? PJ_INV: PJ_FWD;
verbose = MIN(opt_given (o, "v"), 3); /* log level can't be larger than 3 */
- proj_log_level (PJ_DEFAULT_CTX, static_cast<PJ_LOG_LEVEL>(verbose));
+ if( verbose > 0 ) {
+ proj_log_level (PJ_DEFAULT_CTX, static_cast<PJ_LOG_LEVEL>(verbose));
+ }
proj_log_func (PJ_DEFAULT_CTX, (void *) fout, logger);
if (opt_given (o, "version")) {
- print (PJ_LOG_NONE, "%s: %s\n", o->progname, pj_get_release ());
+ print (PJ_LOG_NONE, "%s: %s", o->progname, pj_get_release ());
return 0;
}
if (opt_given (o, "o"))
fout = fopen (opt_arg (o, "output"), "wt");
if (nullptr==fout) {
- print (PJ_LOG_ERROR, "%s: Cannot open '%s' for output\n", o->progname, opt_arg (o, "output"));
+ print (PJ_LOG_ERROR, "%s: Cannot open '%s' for output", o->progname, opt_arg (o, "output"));
free (o);
return 1;
}
- print (PJ_LOG_TRACE, "%s: Running in very verbose mode\n", o->progname);
+ print (PJ_LOG_TRACE, "%s: Running in very verbose mode", o->progname);
if (opt_given (o, "z")) {
fixed_z = proj_atof (opt_arg (o, "z"));
@@ -287,7 +283,7 @@ int main(int argc, char **argv) {
/* cppcheck-suppress invalidscanf */
ncols = sscanf (opt_arg (o, "c"), "%d,%d,%d,%d", columns_xyzt, columns_xyzt+1, columns_xyzt+2, columns_xyzt+3);
if (ncols != nfields) {
- print (PJ_LOG_ERROR, "%s: Too few input columns given: '%s'\n", o->progname, opt_arg (o, "c"));
+ print (PJ_LOG_ERROR, "%s: Too few input columns given: '%s'", o->progname, opt_arg (o, "c"));
free (o);
if (stdout != fout)
fclose (fout);
@@ -298,7 +294,7 @@ int main(int argc, char **argv) {
/* Setup transformation */
P = proj_create_argv (nullptr, o->pargc, o->pargv);
if ((nullptr==P) || (0==o->pargc)) {
- print (PJ_LOG_ERROR, "%s: Bad transformation arguments - (%s)\n '%s -h' for help\n",
+ print (PJ_LOG_ERROR, "%s: Bad transformation arguments - (%s)\n '%s -h' for help",
o->progname, pj_strerrno (proj_errno(P)), o->progname);
free (o);
if (stdout != fout)
@@ -307,12 +303,12 @@ int main(int argc, char **argv) {
}
info = proj_pj_info (P);
- print (PJ_LOG_TRACE, "Final: %s argc=%d pargc=%d\n", info.definition, argc, o->pargc);
+ print (PJ_LOG_TRACE, "Final: %s argc=%d pargc=%d", info.definition, argc, o->pargc);
if (direction== PJ_INV) {
/* fail if an inverse operation is not available */
if (!info.has_inverse) {
- print (PJ_LOG_ERROR, "Inverse operation not available\n");
+ print (PJ_LOG_ERROR, "Inverse operation not available");
if (stdout != fout)
fclose (fout);
return 1;
@@ -325,7 +321,7 @@ int main(int argc, char **argv) {
/* Allocate input buffer */
buf = static_cast<char*>(calloc (1, 10000));
if (nullptr==buf) {
- print (PJ_LOG_ERROR, "%s: Out of memory\n", o->progname);
+ print (PJ_LOG_ERROR, "%s: Out of memory", o->progname);
pj_free (P);
free (o);
if (stdout != fout)
@@ -341,7 +337,7 @@ int main(int argc, char **argv) {
char *c = column (buf, 1);
opt_eof_handler (o);
if (nullptr==ret) {
- print (PJ_LOG_ERROR, "Read error in record %d\n", (int) o->record_index);
+ print (PJ_LOG_ERROR, "Read error in record %d", (int) o->record_index);
continue;
}
point = parse_input_line (buf, columns_xyzt, fixed_z, fixed_time);
@@ -359,7 +355,7 @@ int main(int argc, char **argv) {
if (HUGE_VAL==point.xyzt.x) {
/* otherwise, it must be a syntax error */
print (PJ_LOG_NONE, "# Record %d UNREADABLE: %s", (int) o->record_index, buf);
- print (PJ_LOG_ERROR, "%s: Could not parse file '%s' line %d\n", o->progname, opt_filename (o), opt_record (o));
+ print (PJ_LOG_ERROR, "%s: Could not parse file '%s' line %d", o->progname, opt_filename (o), opt_record (o));
continue;
}
@@ -395,7 +391,7 @@ int main(int argc, char **argv) {
if (proj_angular_output (P, direction)) {
point.lpzt.lam = proj_todeg (point.lpzt.lam);
point.lpzt.phi = proj_todeg (point.lpzt.phi);
- print (PJ_LOG_NONE, "%14.*f %14.*f %12.*f %12.4f%s%s\n",
+ print (PJ_LOG_NONE, "%14.*f %14.*f %12.*f %12.4f%s%s",
decimals_angles, point.xyzt.x,
decimals_angles, point.xyzt.y,
decimals_distances, point.xyzt.z,
@@ -403,7 +399,7 @@ int main(int argc, char **argv) {
);
}
else
- print (PJ_LOG_NONE, "%13.*f %13.*f %12.*f %12.4f%s%s\n",
+ print (PJ_LOG_NONE, "%13.*f %13.*f %12.*f %12.4f%s%s",
decimals_distances, point.xyzt.x,
decimals_distances, point.xyzt.y,
decimals_distances, point.xyzt.z,
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index fd9b2f46..c1139564 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -423,24 +423,13 @@ static void outputObject(
std::cout << "WKT1:GDAL string:" << std::endl;
}
- auto crs = nn_dynamic_pointer_cast<CRS>(obj);
- std::shared_ptr<IWKTExportable> objToExport;
- if (crs) {
- objToExport = nn_dynamic_pointer_cast<IWKTExportable>(
- crs->createBoundCRSToWGS84IfPossible(
- dbContext, allowUseIntermediateCRS));
- }
- if (!objToExport) {
- objToExport = wktExportable;
- }
-
auto formatter =
WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL);
if (outputOpt.singleLine) {
formatter->setMultiLine(false);
}
formatter->setStrict(outputOpt.strict);
- auto wkt = objToExport->exportToWKT(formatter.get());
+ auto wkt = wktExportable->exportToWKT(formatter.get());
if (outputOpt.c_ify) {
wkt = c_ify_string(wkt);
}