diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-12-27 22:16:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-27 22:16:10 +0100 |
| commit | 123011447a2d7d25041cc3e466408a0d81bb4d3b (patch) | |
| tree | 450cb1f8db7247c224fc309465cea0f22b045bc8 | |
| parent | 81ec8c0b58d66333fccd3703dab62a11132a0331 (diff) | |
| parent | 6bb14fa874562eb4879a3b80b51b22cd2add058e (diff) | |
| download | PROJ-123011447a2d7d25041cc3e466408a0d81bb4d3b.tar.gz PROJ-123011447a2d7d25041cc3e466408a0d81bb4d3b.zip | |
Merge pull request #1210 from rouault/remove_proj_defs_dat
Remove proj_def.dat (#201)
31 files changed, 128 insertions, 195 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index fe256ba7..859f9a60 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -8,7 +8,6 @@ set(PROJ_DICTIONARY world GL27 nad83 nad.lst - proj_def.dat CH ITRF2000 ITRF2008 diff --git a/data/Makefile.am b/data/Makefile.am index fe5ad532..3e98e59f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,6 +1,6 @@ DATAPATH = $(top_srcdir)/data -pkgdata_DATA = GL27 nad.lst proj_def.dat nad27 nad83 world other.extra \ +pkgdata_DATA = GL27 nad.lst nad27 nad83 world other.extra \ CH \ ITRF2000 ITRF2008 ITRF2014 proj.db @@ -36,7 +36,7 @@ SQL_ORDERED_LIST = sql/begin.sql \ sql/customizations.sql \ sql/commit.sql -EXTRA_DIST = GL27 nad.lst proj_def.dat nad27 nad83 \ +EXTRA_DIST = GL27 nad.lst nad27 nad83 \ world other.extra \ CH \ ITRF2000 ITRF2008 ITRF2014 \ diff --git a/data/README b/data/README index f8efbae7..1b18dd2f 100644 --- a/data/README +++ b/data/README @@ -5,8 +5,6 @@ File Contents: README --- This file -proj_def.dat --- basic default file used by proj. - epsg --- Translation of EPSG GCS/PCS codes into PROJ via init= mechanism. epsg-deprecated --- EPSG definitions that have been deprecated. They are diff --git a/data/proj_def.dat b/data/proj_def.dat deleted file mode 100644 index 00dff281..00000000 --- a/data/proj_def.dat +++ /dev/null @@ -1,17 +0,0 @@ -# Projection library defaults file -# SCCSID--- @(#)proj_def.dat 4.3 94/02/23 GIE REL" -# very preliminary version -<general> -ellps=WGS84 -<> -<aea> # Conterminous U.S. map -lat_1=29.5 -lat_2=45.5 -<> -<lcc> # Conterminous U.S. map -lat_1=33 -lat_2=45 -<> -<lagrng> -W=2 -<> diff --git a/docs/source/operations/options/ellps.rst b/docs/source/operations/options/ellps.rst index af98d377..b754f741 100644 --- a/docs/source/operations/options/ellps.rst +++ b/docs/source/operations/options/ellps.rst @@ -2,4 +2,4 @@ See :option:`proj -le` for a list of available ellipsoids. - *Defaults to "WGS84".* + *Defaults to "GRS80".* diff --git a/docs/source/resource_files.rst b/docs/source/resource_files.rst index bd21486c..53843571 100644 --- a/docs/source/resource_files.rst +++ b/docs/source/resource_files.rst @@ -393,15 +393,6 @@ Below is a list of the init files that are packaged with PROJ. The defaults file ------------------------------------------------------------------------------- -The ``proj_def.dat`` file supplies default parameters for PROJ. It uses the same -syntax as the init files described above. The identifiers in the defaults file -describe to what the parameters should apply. If the ``<general>`` identifier is -used, then all parameters in that section applies for all proj-strings. Otherwise -the identifier is connected to a specific projection. With the defaults file -supplied with PROJ the default ellipsoid is set to WGS84 (for all proj-strings). -Apart from that only the Albers Equal Area, -:doc:`Lambert Conic Conformal<operations/projections/lcc>` and the -:doc:`Lagrange<operations/projections/lagrng>` projections have default parameters. -Defaults can be ignored by adding the ``+no_def`` parameter to a proj-string. - - +Before PROJ 6.0, a ``proj_def.dat`` file could be used to supply default +parameters to PROJ. It has been removed due to the confusion and errors it +caused. diff --git a/docs/source/usage/differences.rst b/docs/source/usage/differences.rst index 7d9d6ced..5694e4d0 100644 --- a/docs/source/usage/differences.rst +++ b/docs/source/usage/differences.rst @@ -58,3 +58,14 @@ should return the same output for both. Adding the ``+over`` flag to the projection definition provides the old behaviour. + +Version 6.0.0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Removal of proj_def.dat +----------------------- + +Before PROJ 6, the proj_def.dat was used to provide general and per-projection +parameters, when +no_defs was not specified. It has now been removed. In case, +no ellipsoid or datum specification is provided in the PROJ string, the +default ellipsoid is GRS80 (was WGS84 in previous PROJ versions). diff --git a/docs/source/usage/projections.rst b/docs/source/usage/projections.rst index 20e82763..8f1ccd50 100644 --- a/docs/source/usage/projections.rst +++ b/docs/source/usage/projections.rst @@ -26,7 +26,6 @@ documenting the individual :doc:`projections<../operations/projections/index>`. +lat_0 Latitude of origin +lon_0 Central meridian +lon_wrap Center longitude to use for wrapping (see below) - +no_defs Don't use the /usr/share/proj/proj_def.dat defaults file +over Allow longitude output outside -180 to 180 range, disables wrapping (see below) +pm Alternate prime meridian (typically a city name, see below) diff --git a/src/init.cpp b/src/init.cpp index 5710031c..4274f5b4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -332,74 +332,41 @@ Expand key from buffer or (if not in buffer) from init file -static paralist *append_defaults_to_paralist (PJ_CONTEXT *ctx, paralist *start, const char *key, int allow_init_epsg) { - paralist *defaults, *last = nullptr; - char keystring[ID_TAG_MAX + 20]; - paralist *next, *proj; - int err; - +static void append_default_ellipsoid_to_paralist (paralist *start) { if (nullptr==start) - return nullptr; - - if (strlen(key) > ID_TAG_MAX) - return nullptr; + return; /* Set defaults, unless inhibited (either explicitly through a "no_defs" token */ /* or implicitly, because we are initializing a pipeline) */ if (pj_param_exists (start, "no_defs")) - return start; - proj = pj_param_exists (start, "proj"); + return; + auto proj = pj_param_exists (start, "proj"); if (nullptr==proj) - return start; + return; if (strlen (proj->param) < 6) - return start; + return; if (0==strcmp ("pipeline", proj->param + 5)) - return start; - - err = pj_ctx_get_errno (ctx); - pj_ctx_set_errno (ctx, 0); + return; + + /* Don't default ellipse if datum, ellps or any ellipsoid information is set */ + if (pj_param_exists (start, "datum")) return; + if (pj_param_exists (start, "ellps")) return; + if (pj_param_exists (start, "a")) return; + if (pj_param_exists (start, "b")) return; + if (pj_param_exists (start, "rf")) return; + if (pj_param_exists (start, "f")) return; + if (pj_param_exists (start, "e")) return; + if (pj_param_exists (start, "es")) return; /* Locate end of start-list */ + paralist *last = nullptr; for (last = start; last->next; last = last->next); - strcpy (keystring, "proj_def.dat:"); - strcat (keystring, key); - defaults = get_init (ctx, keystring, allow_init_epsg); - - /* Defaults are optional - so we don't care if we cannot open the file */ - pj_ctx_set_errno (ctx, err); - - if (!defaults) - return last; - - /* Loop over all default items */ - for (next = defaults; next; next = next->next) { - - /* Don't override existing parameter value of same name */ - if (pj_param_exists (start, next->param)) - continue; - - /* Don't default ellipse if datum, ellps or any ellipsoid information is set */ - if (0==strncmp(next->param,"ellps=", 6)) { - if (pj_param_exists (start, "datum")) continue; - if (pj_param_exists (start, "ellps")) continue; - if (pj_param_exists (start, "a")) continue; - if (pj_param_exists (start, "b")) continue; - if (pj_param_exists (start, "rf")) continue; - if (pj_param_exists (start, "f")) continue; - if (pj_param_exists (start, "e")) continue; - if (pj_param_exists (start, "es")) continue; - } - - /* If we're here, it's OK to append the current default item */ - last = last->next = pj_mkparam(next->param); - } - last->next = nullptr; - - pj_dealloc_params (ctx, defaults, 0); - return last; + /* If we're here, it's OK to append the current default item */ + last->next = pj_mkparam("ellps=GRS80"); } + /*****************************************************************************/ static paralist *pj_expand_init_internal(PJ_CONTEXT *ctx, paralist *init, int allow_init_epsg) { /****************************************************************************** @@ -664,11 +631,7 @@ pj_init_ctx_with_allow_init_epsg(projCtx ctx, int argc, char **argv, int allow_i return nullptr; } - - /* Append general and projection specific defaults to the definition list */ - append_defaults_to_paralist (ctx, start, "general", allow_init_epsg); - append_defaults_to_paralist (ctx, start, name, allow_init_epsg); - + append_default_ellipsoid_to_paralist (start); /* Allocate projection structure */ PIN = proj(nullptr); diff --git a/src/projections/lagrng.cpp b/src/projections/lagrng.cpp index 8c0150aa..a119ea31 100644 --- a/src/projections/lagrng.cpp +++ b/src/projections/lagrng.cpp @@ -76,7 +76,10 @@ PJ *PROJECTION(lagrng) { return pj_default_destructor (P, ENOMEM); P->opaque = Q; - Q->w = pj_param(P->ctx, P->params, "dW").f; + if( pj_param(P->ctx, P->params, "tW").i ) + Q->w = pj_param(P->ctx, P->params, "dW").f; + else + Q->w = 2; if (Q->w <= 0) return pj_default_destructor(P, PJD_ERR_W_OR_M_ZERO_OR_LESS); Q->hw = 0.5 * Q->w; diff --git a/src/tests/multistresstest.cpp b/src/tests/multistresstest.cpp index 234783b3..33d2d738 100644 --- a/src/tests/multistresstest.cpp +++ b/src/tests/multistresstest.cpp @@ -46,7 +46,6 @@ #define num_threads 10 static int num_iterations = 1000000; static int reinit_every_iteration=0; -static int add_no_defs = 0; typedef struct { const char *src_def; @@ -179,15 +178,7 @@ static volatile int active_thread_count = 0; static projPJ custom_pj_init_plus_ctx(projCtx ctx, const char* def) { - if( add_no_defs ) - { - char szBuffer[256]; - strcpy(szBuffer, def); - strcat(szBuffer, " +no_defs"); - return pj_init_plus_ctx(ctx, szBuffer); - } - else - return pj_init_plus_ctx(ctx, def); + return pj_init_plus_ctx(ctx, def); } /************************************************************************/ @@ -462,8 +453,6 @@ int main( int argc, char **argv ) { if( strcmp(argv[i], "-reinit") == 0 ) reinit_every_iteration = 1; - else if( strcmp(argv[i], "-add_no_defs") == 0 ) - add_no_defs = 1; else if( strcmp(argv[i], "-num_iterations") == 0 && i+1 < argc ) { num_iterations = atoi(argv[i+1]); diff --git a/src/tests/test228.cpp b/src/tests/test228.cpp index fcacd7c9..4fadda94 100644 --- a/src/tests/test228.cpp +++ b/src/tests/test228.cpp @@ -36,10 +36,9 @@ static void* thread_main(void* unused) p_proj_ctxt=pj_ctx_alloc(); p_WGS84_proj=pj_init_plus_ctx(p_proj_ctxt,"+proj=longlat " - "+ellps=WGS84 +datum=WGS84 +no_defs"); + "+ellps=WGS84 +datum=WGS84"); p_OSGB36_proj=pj_init_plus_ctx(p_proj_ctxt, - "+proj=longlat +ellps=airy +datum=OSGB36 +nadgrids=OSTN02_NTv2.gsb " - "+no_defs"); + "+proj=longlat +ellps=airy +datum=OSGB36 +nadgrids=OSTN02_NTv2.gsb"); while(run) { diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp index 6c30f21c..0197cf5c 100644 --- a/src/transformations/deformation.cpp +++ b/src/transformations/deformation.cpp @@ -269,7 +269,8 @@ PJ *TRANSFORMATION(deformation,1) { return destructor(P, ENOMEM); P->opaque = (void *) Q; - Q->cart = proj_create(P->ctx, "+proj=cart"); + // Pass a dummy ellipsoid definition that will be overridden just afterwards + Q->cart = proj_create(P->ctx, "+proj=cart +a=1"); if (Q->cart == nullptr) return destructor(P, ENOMEM); diff --git a/test/cli/proj_outIGNF.dist b/test/cli/proj_outIGNF.dist index 611144b8..c12b883b 100644 --- a/test/cli/proj_outIGNF.dist +++ b/test/cli/proj_outIGNF.dist @@ -1,22 +1,22 @@ +init=IGNF:NTFG +to +init=IGNF:RGF93G 3.300866856 43.4477976569 0.0000 3d18'0.915"E 43d26'52.077"N 0.000 +init=IGNF:LAMBE +to +init=IGNF:LAMB93 - 600000.0000 2600545.4523 0.0000 652759.036 7033588.609 0.000 - 135638.3592 2418760.4094 0.0000 187444.148 6856142.911 0.000 - 998137.3947 2413822.2844 0.0000 1048843.997 6843923.913 0.000 + 600000.0000 2600545.4523 0.0000 652760.737 7033791.243 0.000 + 135638.3592 2418760.4094 0.0000 187194.062 6855928.882 0.000 + 998137.3947 2413822.2844 0.0000 1049052.258 6843776.562 0.000 600000.0000 2200000.0000 0.0000 649398.872 6633524.191 0.000 - 311552.5340 1906457.4840 0.0000 358593.374 6342647.465 0.000 - 960488.4138 1910172.8812 0.0000 1007324.119 6340956.093 0.000 - 600000.0000 1699510.8340 0.0000 645201.753 6133255.515 0.000 + 311552.5340 1906457.4840 0.0000 358799.172 6342652.486 0.000 + 960488.4138 1910172.8812 0.0000 1007068.686 6340907.237 0.000 + 600000.0000 1699510.8340 0.0000 645204.279 6133556.746 0.000 1203792.5981 626873.17210 0.0000 * * inf +init=IGNF:LAMBE +to +init=IGNF:GEOPORTALFXX - 600000.0000 2600545.4523 0.0000 179040.150 5610292.766 0.000 - 135638.3592 2418760.4094 0.0000 -303490.059 5410353.890 0.000 - 998137.3947 2413822.2844 0.0000 592635.926 5410280.335 0.000 + 600000.0000 2600545.4523 0.0000 179040.148 5610495.275 0.000 + 135638.3592 2418760.4094 0.0000 -303729.363 5410118.356 0.000 + 998137.3947 2413822.2844 0.0000 592842.792 5410120.554 0.000 600000.0000 2200000.0000 0.0000 179041.670 5209746.080 0.000 - 311552.5340 1906457.4840 0.0000 -97021.878 4909167.981 0.000 - 960488.4138 1910172.8812 0.0000 524126.466 4909227.598 0.000 - 600000.0000 1699510.8340 0.0000 179047.637 4708515.623 0.000 + 311552.5340 1906457.4840 0.0000 -96825.465 4909184.136 0.000 + 960488.4138 1910172.8812 0.0000 523880.019 4909191.141 0.000 + 600000.0000 1699510.8340 0.0000 179047.633 4708817.007 0.000 1203792.5981 626873.17210 0.0000 * * inf +init=IGNF:RGF93G +to +init=IGNF:GEOPORTALFXX 2d20'11.4239243" 50d23'59.7718445" 0.0 179040.151 5610495.281 0.000 diff --git a/test/cli/testvarious b/test/cli/testvarious index 88673c5d..7ec50bb3 100755 --- a/test/cli/testvarious +++ b/test/cli/testvarious @@ -631,7 +631,7 @@ echo "##############################################################" >> ${OUT} echo "Test laea" >> ${OUT} # $EXE -f '%.12f' \ - +proj=laea +lat_0=45 +lon_0=-100 +units=m +datum=WGS84 +no_defs \ + +proj=laea +lat_0=45 +lon_0=-100 +units=m +datum=WGS84 \ +to +proj=latlong +datum=WGS84 \ -E >>${OUT} <<EOF -6086629.0 4488761.0 @@ -682,7 +682,7 @@ echo "Test omerc sensitivity with locations 90d from origin(#114)" >> ${OUT} $EXE -f '%.8f' \ +proj=latlong +ellps=WGS84 \ +to +proj=omerc +ellps=WGS84 +lon_1=62.581150 +lat_1=74.856102 \ - +lon_2=53.942810 +lat_2=74.905884 +units=km +no_rot +no_defs \ + +lon_2=53.942810 +lat_2=74.905884 +units=km +no_rot \ -E >>${OUT} <<EOF 56.958381652832 72.8798 56.9584 72.8798 @@ -718,12 +718,12 @@ echo "Test qsc" >> ${OUT} # $EXE -f '%.7f' \ +proj=latlong +datum=WGS84 \ - +to +proj=qsc +datum=WGS84 +no_defs \ + +to +proj=qsc +datum=WGS84 \ -E >>${OUT} <<EOF 13 -10 EOF $EXE -f '%.13f' \ - +proj=qsc +datum=WGS84 +no_defs \ + +proj=qsc +datum=WGS84 \ +to +proj=latlong +datum=WGS84 \ -E >>${OUT} <<EOF 2073986.94908809568733 -1680858.27222427958623 @@ -732,8 +732,8 @@ echo "##############################################################" >> ${OUT} echo "Test bug 229" >> ${OUT} # $EXE -f '%.13f' \ - +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 \ - +to +proj=latlong +datum=WGS84 +no_defs \ + +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0 \ + +to +proj=latlong +datum=WGS84 \ -E >>${OUT} <<EOF 13 -10 EOF @@ -750,7 +750,7 @@ echo "Test bug 244 " >> ${OUT} # $EXE -f '%.8f' \ +init=epsg:4326 \ - +to +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m +no_defs \ + +to +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m \ -E >>${OUT} <<EOF -140.100000 -87.000000 EOF @@ -758,7 +758,7 @@ echo "##############################################################" >> ${OUT} echo "Test bug 244 (2)" >> ${OUT} # $EXE -f '%.11f' \ - +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m +no_defs \ + +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m \ +to +init=epsg:4326 \ -E >>${OUT} <<EOF 987122.418330284 -14429896.539530909 @@ -767,7 +767,7 @@ echo "##############################################################" >> ${OUT} echo "Test bug 245 (use +datum=carthage)" >> ${OUT} # $EXE -f '%.7f' \ - +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=32 +datum=carthage +no_defs \ + +proj=longlat +datum=WGS84 +to +proj=utm +zone=32 +datum=carthage \ -E >>${OUT} <<EOF 10 34 EOF @@ -775,7 +775,7 @@ echo "##############################################################" >> ${OUT} echo "Test bug 245 (use expansion of +datum=carthage)" >> ${OUT} # $EXE -f '%.7f' \ - +proj=longlat +datum=WGS84 +no_defs +to +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-263.0,6.0,431.0 +no_defs \ + +proj=longlat +datum=WGS84 +to +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-263.0,6.0,431.0 \ -E >>${OUT} <<EOF 10 34 EOF @@ -810,7 +810,7 @@ echo "##############################################################" >> ${OUT} echo "Test issue #316 (switch utm to use etmerc)" >> ${OUT} # $EXE -f '%.6f' \ - +proj=latlong +datum=WGS84 +no_defs +to +proj=utm +zone=35 +datum=WGS84 +no_defs \ + +proj=latlong +datum=WGS84 +to +proj=utm +zone=35 +datum=WGS84 \ -E >>${OUT} <<EOF 0 83 EOF @@ -819,7 +819,7 @@ echo "##############################################################" >> ${OUT} echo "Test issue #316 (switch utm to use etmerc)" >> ${OUT} # $EXE -f '%.6f' \ - +proj=latlong +datum=WGS84 +no_defs +to +proj=etmerc +datum=WGS84 +no_defs +k=0.9996 +lon_0=27 +x_0=500000 -f %.6f \ + +proj=latlong +datum=WGS84 +to +proj=etmerc +datum=WGS84 +k=0.9996 +lon_0=27 +x_0=500000 -f %.6f \ -E >>${OUT} <<EOF 0 83 EOF @@ -829,7 +829,7 @@ echo "Test nzmg forward projection" >> ${OUT} # $EXE -f '%.7f' \ +proj=latlong +datum=WGS84 +to \ - +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=WGS84 +units=m +no_defs \ + +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=WGS84 +units=m \ -E >> ${OUT} <<EOF 175. -40. 0. EOF @@ -838,7 +838,7 @@ echo "##############################################################" >> ${OUT} echo "Test nzmg inverse projection" >> ${OUT} # $EXE -f '%.7f' \ - +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=WGS84 +units=m +no_defs +to \ + +proj=nzmg +lat_0=-41 +lon_0=173 +x_0=2510000 +y_0=6023150 +ellps=WGS84 +units=m +to \ +proj=latlong +datum=WGS84 \ -E >> ${OUT} <<EOF 2680778.57267967 6132228.07645127 0. @@ -848,7 +848,7 @@ echo "##############################################################" >> ${OUT} echo "Test misrsom forward projection" >> ${OUT} # $EXE -f '%.7f' \ - +proj=latlong +datum=WGS84 +no_defs +to \ + +proj=latlong +datum=WGS84 +to \ +proj=misrsom +path=41 +ellps=WGS84 +units=m \ -E >> ${OUT} <<EOF 48.64966165540372 66.2263195368941 0. @@ -858,7 +858,7 @@ echo "##############################################################" >> ${OUT} echo "Test misrsom inverse projection" >> ${OUT} # $EXE -f '%.7f' \ - +proj=misrsom +path=41 +ellps=WGS84 +units=m +no_defs +to \ + +proj=misrsom +path=41 +ellps=WGS84 +units=m +to \ +proj=latlong +datum=WGS84 -f '%0.7f' \ -E >> ${OUT} <<EOF 7461300.0 528000.0 0.0 diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index e653454e..f66b26ec 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -167,7 +167,7 @@ A test case from a comment by Github user c0nk operation proj=somerc lat_0=46.95240555555556 lon_0=7.439583333333333 k_0=1 x_0=2600000 y_0=1200000 ellps=bessel - towgs84=674.374,15.056,405.346 no_defs + towgs84=674.374,15.056,405.346 ------------------------------------------------------------------------------- tolerance 20 cm accept 7.438632495 46.951082877 @@ -178,11 +178,11 @@ where, at the end of pipeline creation, a false warning about missing ellps was left behind from the creation of the Helmert step (now repaired in pj_init). ------------------------------------------------------------------------------- operation proj=pipeline - step proj=cart ellps=WGS84 no_defs - step proj=helmert x=674.37400 y=15.05600 z=405.34600 inv no_defs - step proj=cart ellps=bessel no_defs inv + step proj=cart ellps=WGS84 + step proj=helmert x=674.37400 y=15.05600 z=405.34600 inv + step proj=cart ellps=bessel inv step proj=somerc lat_0=46.95240555555556 lon_0=7.439583333333333 - k_0=1 x_0=2600000 y_0=1200000 ellps=bessel units=m no_defs + k_0=1 x_0=2600000 y_0=1200000 ellps=bessel units=m ------------------------------------------------------------------------------- tolerance 20 cm accept 7.438632495 46.951082877 @@ -219,7 +219,7 @@ expect -10370728.80 5552839.74 0 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -Test Google's Web Mercator with +proj=webmerc +Test Google's Web Mercator with +proj=webmerc +ellps=WGS84 ------------------------------------------------------------------------------- use_proj4_init_rules true operation proj=pipeline step init=epsg:26915 inv step proj=webmerc datum=WGS84 @@ -235,7 +235,7 @@ expect -10370728.80 5552839.74 0 ------------------------------------------------------------------------------- Web Mercator test data from EPSG Guidance Note 7-2, p. 44. ------------------------------------------------------------------------------- -operation proj=webmerc +operation proj=webmerc +ellps=WGS84 tolerance 1 cm accept -100.33333333 24.46358028 @@ -288,7 +288,7 @@ operation +proj=pipeline expect failure pjd_err_malformed_pipeline operation +proj=pipeline - +step +proj=merc + +step +proj=merc +ellps=WGS84 +step +proj=unitconvert +xy_in=m +xy_out=km accept 12 56 expect 1335.8339 7522.963 diff --git a/test/gie/axisswap.gie b/test/gie/axisswap.gie index 5fe86200..a44a61a6 100644 --- a/test/gie/axisswap.gie +++ b/test/gie/axisswap.gie @@ -71,7 +71,7 @@ accept 1 2 3 4 expect -2 -1 -3 4 operation proj=pipeline - step proj=latlong + step proj=latlong +ellps=WGS84 step proj=axisswap order=1,2,3,4 angularunits @@ -81,7 +81,7 @@ accept 12 55 0 0 expect 12 55 0 0 operation proj=pipeline - step proj=latlong + step proj=latlong +ellps=WGS84 step proj=axisswap order=-2,-1,3,4 angularunits diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 48be629c..c76272e9 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -660,7 +660,7 @@ Cal Coop Ocean Fish Invest Lines/Stations =============================================================================== ------------------------------------------------------------------------------- -operation +proj=calcofi +ellps=GRS80 +lat_1=0.5 +lat_2=2 +no_defs +operation +proj=calcofi +ellps=GRS80 +lat_1=0.5 +lat_2=2 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -683,7 +683,7 @@ accept -200 -100 expect -62.486322854 87.980755945 ------------------------------------------------------------------------------- -operation +proj=calcofi +R=6400000 +lat_1=0.5 +lat_2=2 +no_defs +operation +proj=calcofi +R=6400000 +lat_1=0.5 +lat_2=2 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -705,7 +705,7 @@ expect -207.544906814 81.314089279 accept -200 -100 expect -62.576950372 87.980755945 -operation +proj=calcofi +lon_0=50 +operation +proj=calcofi +lon_0=50 +ellps=WGS84 accept 10 50 expect 303.525850 -1576.974388 roundtrip 100 @@ -2007,7 +2007,7 @@ accept -200 -100 expect -0.001790493 -0.000759909 ------------------------------------------------------------------------------- -operation +proj=rhealpix +south_square=2 +north_square=3 +operation +proj=rhealpix +south_square=2 +north_square=3 +ellps=WGS84 ------------------------------------------------------------------------------- tolerance 1 m accept 45 50 @@ -2191,7 +2191,7 @@ Krovak =============================================================================== ------------------------------------------------------------------------------- -operation +proj=krovak +ellps=GRS80 +no_defs +operation +proj=krovak +ellps=GRS80 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 @@ -2625,7 +2625,7 @@ accept 0 0 expect 0 0 ------------------------------------------------------------------------------- -operation +proj=lcc +ellps=GRS80 +lat_1=30 +operation +proj=lcc +ellps=GRS80 +lat_1=30 +lat_2=45 ------------------------------------------------------------------------------- tolerance 0.1 mm @@ -2639,7 +2639,7 @@ accept -1 -2 expect -137536.205750651 -269686.591917190 ------------------------------------------------------------------------------- -operation +proj=lcc +ellps=sphere +lat_1=30 +operation +proj=lcc +ellps=sphere +lat_1=30 +lat_2=45 ------------------------------------------------------------------------------- tolerance 0.1 mm @@ -5220,7 +5220,7 @@ van der Grinten (I) =============================================================================== ------------------------------------------------------------------------------- -operation +proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2 +no_defs +operation +proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2 ------------------------------------------------------------------------------- tolerance 0.1 mm accept 2 1 diff --git a/test/gie/ellipsoid.gie b/test/gie/ellipsoid.gie index c2c7770a..929eb799 100644 --- a/test/gie/ellipsoid.gie +++ b/test/gie/ellipsoid.gie @@ -57,10 +57,6 @@ expect failure errno unknown_ellp_param operation proj=merc +a=-1 expect failure errno major_axis_not_given -operation proj=merc no_defs -expect failure errno major_axis_not_given - -# This one should succeed due to ellps=WGS84 in proj_def.dat operation proj=merc accept 0 0 expect 0 0 diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 276b1fef..44d01385 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -213,12 +213,12 @@ operation proj=pipeline inv step expect failure pjd_err_malformed_pipeline operation proj=pipeline inv step - proj=urm5 n=0.5 inv + proj=urm5 n=0.5 ellps=WGS84 inv accept 12 56 expect 1215663.2814182492 5452209.5424045017 operation proj=pipeline step - proj=urm5 n=0.5 + proj=urm5 ellps=WGS84 n=0.5 accept 12 56 expect 1215663.2814182492 5452209.5424045017 ------------------------------------------------------------------------------- @@ -502,7 +502,7 @@ expect 69187.5632 609890.7825 Test that gie can read DMS style coordinates as well as coordinates where _ is used as a thousands separator. ------------------------------------------------------------------------------- -operation +step +proj=latlong +operation +step +proj=latlong +ellps=WGS84 ------------------------------------------------------------------------------- tolerance 1 m diff --git a/test/gigs/5101.4-jhs-etmerc.gie b/test/gigs/5101.4-jhs-etmerc.gie index 42aad560..a4f28a4a 100644 --- a/test/gigs/5101.4-jhs-etmerc.gie +++ b/test/gigs/5101.4-jhs-etmerc.gie @@ -11,7 +11,7 @@ use_proj4_init_rules true -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4190 +inv - +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m -------------------------------------------------------------------------------- tolerance 0.03 m accept -63.9993433 80.0002644 @@ -107,7 +107,7 @@ expect 5756200.0 5568100.0 -------------------------------------------------------------------------------- operation +proj=pipeline - +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +inv + +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +inv +step +init=epsg:4190 -------------------------------------------------------------------------------- tolerance 0.03 m @@ -205,7 +205,7 @@ expect -57.0000158 -40.0002087 -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4190 +inv - +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + +step +proj=etmerc +lat_0=-90 +lon_0=-60 +k=1 +x_0=5500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m -------------------------------------------------------------------------------- tolerance 0.006 m accept -63.9993433 80.0002644 diff --git a/test/gigs/5105.1.gie.failing b/test/gigs/5105.1.gie.failing index a0803d2b..881d0808 100644 --- a/test/gigs/5105.1.gie.failing +++ b/test/gigs/5105.1.gie.failing @@ -9,7 +9,7 @@ Test 5105 (part 1), Oblique Mercator (variant B), v2-0_2011-06-28. -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4742 +inv - +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs + +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m -------------------------------------------------------------------------------- tolerance 0.05 m accept 117 12 @@ -105,7 +105,7 @@ expect 479068.802 663798.63 -------------------------------------------------------------------------------- operation +proj=pipeline - +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs +inv + +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +inv +step +init=epsg:4742 -------------------------------------------------------------------------------- tolerance 0.05 m @@ -203,7 +203,7 @@ expect 114 6 -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4742 +inv - +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs + +step +proj=somerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m -------------------------------------------------------------------------------- tolerance 0.006 m accept 117 12 diff --git a/test/gigs/5107.gie b/test/gigs/5107.gie index bfd044fd..d3f1df79 100644 --- a/test/gigs/5107.gie +++ b/test/gigs/5107.gie @@ -11,7 +11,7 @@ use_proj4_init_rules true -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4674 +inv - +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m -------------------------------------------------------------------------------- tolerance 0.05 m accept -54 0 @@ -67,7 +67,7 @@ expect 7458947.70133 7313327.31691 -------------------------------------------------------------------------------- operation +proj=pipeline - +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +inv + +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +inv +step +init=epsg:4674 -------------------------------------------------------------------------------- tolerance 0.05 m @@ -125,7 +125,7 @@ expect -30 -22.5 -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4674 +inv - +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs + +step +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m -------------------------------------------------------------------------------- tolerance 0.006 m accept -54 0 diff --git a/test/gigs/5108.gie.failing b/test/gigs/5108.gie.failing index 6a979118..15ecc3cf 100644 --- a/test/gigs/5108.gie.failing +++ b/test/gigs/5108.gie.failing @@ -5,10 +5,10 @@ Test 5108, Cassini-Soldner, v2-0_2011-06-28. -------------------------------------------------------------------------------- # GDM2000 -<4742> +proj=longlat +ellps=GRS80 +no_defs <> +<4742> +proj=longlat +ellps=GRS80 <> # GDM2000 / Johor Grid -<3377> +proj=cass +lat_0=2.121679744444445 +lon_0=103.4279362361111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m +no_defs <> +<3377> +proj=cass +lat_0=2.121679744444445 +lon_0=103.4279362361111 +x_0=-14810.562 +y_0=8758.32 +ellps=GRS80 +units=m <> <gie> diff --git a/test/gigs/5110.gie.failing b/test/gigs/5110.gie.failing index 2d26d1ab..52307b53 100644 --- a/test/gigs/5110.gie.failing +++ b/test/gigs/5110.gie.failing @@ -5,11 +5,11 @@ Test 5110, Lambert Azimuthal Equal Area, v2-0_2011-06-28. -------------------------------------------------------------------------------- # ETRS89 -<4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> +<4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 <> # ETRS89 / LAEA Europe <3035> +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 - +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> + +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m <> <gie> diff --git a/test/gigs/5111.1.gie b/test/gigs/5111.1.gie index fcbd4b1a..decb7f9f 100644 --- a/test/gigs/5111.1.gie +++ b/test/gigs/5111.1.gie @@ -5,9 +5,9 @@ Test 5111 (part 1), Mercator (variant A), v2-0_2011-06-28. -------------------------------------------------------------------------------- # Batavia -<4211> +proj=longlat +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +no_defs <> +<4211> +proj=longlat +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 <> # Batavia / NEIEZ -<3001> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m +no_defs <> +<3001> +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +towgs84=-377,681,-50,0,0,0,0 +units=m <> <gie> diff --git a/test/gigs/5111.2.gie.failing b/test/gigs/5111.2.gie.failing index dfa6bca2..815efb97 100644 --- a/test/gigs/5111.2.gie.failing +++ b/test/gigs/5111.2.gie.failing @@ -9,7 +9,7 @@ Test 5111 (part 2), Mercator (variant A), v2-0_2011-06-28. -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4813 +inv - +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m +no_defs + +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m -------------------------------------------------------------------------------- tolerance 0.05 m accept -6.7200711 77.6534822 @@ -153,7 +153,7 @@ expect -15964105.84 679490.65 -------------------------------------------------------------------------------- operation +proj=pipeline - +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m +no_defs +inv + +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m +inv +step +init=epsg:4813 -------------------------------------------------------------------------------- tolerance 0.05 m @@ -299,7 +299,7 @@ expect -175.8077194 2.0 -------------------------------------------------------------------------------- operation +proj=pipeline +step +init=epsg:4813 +inv - +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m +no_defs + +step +proj=merc +lon_0=110 +k=0.997 +x_0=3900000 +y_0=900000 +ellps=bessel +units=m -------------------------------------------------------------------------------- tolerance 0.006 m accept -6.7200711 77.6534822 diff --git a/test/gigs/5201.gie b/test/gigs/5201.gie index 29805b79..7d8f3bfe 100644 --- a/test/gigs/5201.gie +++ b/test/gigs/5201.gie @@ -5,9 +5,9 @@ Test 5201, Geographic Geocentric conversions, v2.0_2011-09-28. (EPSG 4979 - WGS8 -------------------------------------------------------------------------------- # WGS 84 -<4978> +proj=geocent +datum=WGS84 +units=m +no_defs <> +<4978> +proj=geocent +datum=WGS84 +units=m <> # WGS 84 -<4326> +proj=longlat +datum=WGS84 +no_defs <> +<4326> +proj=longlat +datum=WGS84 <> <gie> diff --git a/test/gigs/5208.gie b/test/gigs/5208.gie index 985dfdcb..1c28b26c 100644 --- a/test/gigs/5208.gie +++ b/test/gigs/5208.gie @@ -13,10 +13,10 @@ To be on the safe side we, use 0.01 m as the tolerance. -------------------------------------------------------------------------------- # NTF -<4275> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +no_defs <> +<4275> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 <> # NTF (Paris) -<4807> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +no_defs <> +<4807> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris <> diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index b7af926b..9ff7a278 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -405,7 +405,7 @@ TEST(gie, info_functions) { ASSERT_NEAR(-2.0, proj_dmstor(&buf[0], NULL), 1e-7); /* test proj_derivatives_retrieve() and proj_factors_retrieve() */ - P = proj_create(PJ_DEFAULT_CTX, "+proj=merc"); + P = proj_create(PJ_DEFAULT_CTX, "+proj=merc +ellps=WGS84"); a = proj_coord(0, 0, 0, 0); a.lp.lam = proj_torad(12); a.lp.phi = proj_torad(55); @@ -488,7 +488,7 @@ TEST(gie, io_predicates) { " +rx=-0.00039 +ry=0.00080 +rz=-0.00114" " +dx=-0.0029 +dy=-0.0002 +dz=-0.0006 +ds=0.00001" " +drx=-0.00011 +dry=-0.00019 +drz=0.00007" - " +t_epoch=1988.0 +convention=coordinate_frame +no_defs"); + " +t_epoch=1988.0 +convention=coordinate_frame"); ASSERT_TRUE(P != nullptr); ASSERT_FALSE(proj_angular_input(P, PJ_FWD)); ASSERT_FALSE(proj_angular_input(P, PJ_INV)); @@ -500,14 +500,13 @@ TEST(gie, io_predicates) { ASSERT_FALSE(proj_angular_output(P, PJ_FWD)); ASSERT_FALSE(proj_angular_output(P, PJ_INV)); - /* We specified "no_defs" but didn't give any ellipsoid info */ - /* pj_init_ctx should default to WGS84 */ + /* pj_init_ctx should default to GRS80 */ ASSERT_EQ(P->a, 6378137.0); - ASSERT_EQ(P->f, 1.0 / 298.257223563); + ASSERT_EQ(P->f, 1.0 / 298.257222101); proj_destroy(P); /* Test that pj_fwd* and pj_inv* returns NaNs when receiving NaN input */ - P = proj_create(PJ_DEFAULT_CTX, "+proj=merc"); + P = proj_create(PJ_DEFAULT_CTX, "+proj=merc +ellps=WGS84"); ASSERT_TRUE(P != nullptr); auto a = proj_coord(NAN, NAN, NAN, NAN); a = proj_trans(P, PJ_FWD, a); diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 466ce80b..5ea92fd0 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -7967,12 +7967,14 @@ TEST(io, projparse_init) { { auto obj = createFromUserInput( - "proj=pipeline step init=epsg:4326 step proj=longlat", dbContext, + "proj=pipeline step init=epsg:4326 step proj=longlat ellps=WGS84", + dbContext, true); auto co = nn_dynamic_pointer_cast<CoordinateOperation>(obj); ASSERT_TRUE(co != nullptr); EXPECT_EQ(co->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +init=epsg:4326 +step +proj=longlat"); + "+proj=pipeline +step +init=epsg:4326 +step +proj=longlat " + "+ellps=WGS84"); } { |
