[R-pkg-team] Bug#979026: r-cran-rgdal: autopkgtest failure with PROJ 7.2.1

Sebastiaan Couwenberg sebastic at xs4all.nl
Mon Jan 4 06:42:59 GMT 2021


Control: tags -1 patch

On 1/2/21 9:42 AM, Sebastiaan Couwenberg wrote:
> On 1/2/21 6:54 AM, Bas Couwenberg wrote:
>> The autopkgtest of your package fail with PROJ 7.2.1:
>>
>>  Error: isTRUE(all.equal(a, matrix(c(-5.917698, -1.87195), ncol = 2),  .... is not TRUE
>>  Execution halted
>>  autopkgtest [23:01:36]: test run-unit-test: -----------------------]
>>  autopkgtest [23:01:36]: test run-unit-test:  - - - - - - - - - - results - - - - - - - - - -
>>  run-unit-test        FAIL non-zero exit status 1
>>
>> https://ci.debian.net/data/autopkgtest/testing/amd64/r/r-cran-rgdal/9312472/log.gz
>>
>> This appears to be an issue with how upstream uses PROJ incorrectly,
>> as discussed on the PROJ list:
>>
>>  https://lists.osgeo.org/pipermail/proj/2020-December/010014.html
>>
>> Upstream doesn't appear to have a public VCS, so it's unclear if the fix
>> posted on the PROJ list can be easily turned into a patch for the Debian
>> package.
> 
> Further investigation shows PROJ 7.2.1 related commits at:
> 
>  https://github.com/r-forge/rgdal/commits/master

This issue is fixed when added the relevant upstream patches, as per the
attached debdiff.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
-------------- next part --------------
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/changelog r-cran-rgdal-1.5-18+dfsg/debian/changelog
--- r-cran-rgdal-1.5-18+dfsg/debian/changelog	2020-10-15 16:39:00.000000000 +0200
+++ r-cran-rgdal-1.5-18+dfsg/debian/changelog	2021-01-04 07:32:27.000000000 +0100
@@ -1,3 +1,11 @@
+r-cran-rgdal (1.5-18+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add upstream patches for PROJ 7.2.1 compatibility.
+    (closes: #979026)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 04 Jan 2021 07:32:27 +0100
+
 r-cran-rgdal (1.5-18+dfsg-1) unstable; urgency=medium
 
   * New upstream version
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/patches/series r-cran-rgdal-1.5-18+dfsg/debian/patches/series
--- r-cran-rgdal-1.5-18+dfsg/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ r-cran-rgdal-1.5-18+dfsg/debian/patches/series	2021-01-04 07:32:06.000000000 +0100
@@ -0,0 +1,4 @@
+svn-r1086.patch
+svn-r1087.patch
+svn-r1088.patch
+svn-r1089.patch
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1086.patch r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1086.patch
--- r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1086.patch	1970-01-01 01:00:00.000000000 +0100
+++ r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1086.patch	2021-01-04 07:32:08.000000000 +0100
@@ -0,0 +1,195 @@
+From 9312ef56d9158f5e3a520c733e7b7a9049e41a89 Mon Sep 17 00:00:00 2001
+From: rsbivand <rsbivand at edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
+Date: Tue, 29 Dec 2020 14:58:22 +0000
+Subject: [PATCH] adapt ob_tran for PROJ > 7.2.0
+
+git-svn-id: svn://svn.r-forge.r-project.org/svnroot/rgdal@1086 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
+
+--- a/DESCRIPTION
++++ b/DESCRIPTION
+@@ -1,7 +1,7 @@
+ Package: rgdal
+ Title: Bindings for the 'Geospatial' Data Abstraction Library
+ Version: 1.5-18
+-Date: 2020-10-08
++Date: 2020-12-29
+ Depends: R (>= 3.5.0), methods, sp (>= 1.1-0)
+ Imports: grDevices, graphics, stats, utils
+ LinkingTo: sp
+--- a/R/project.R
++++ b/R/project.R
+@@ -249,7 +249,7 @@ OSRIsProjected <- function(obj) {
+                     }
+                 }
+                 coordOp <- .Call("project_ng_coordOp", proj,
+-                    as.logical(inv), aoi, PACKAGE="rgdal")
++                    as.logical(inv), aoi, as.logical(use_ob_tran), PACKAGE="rgdal")
+             }
+             if (verbose) cat(strwrap(coordOp), sep="\n")
+             res <- .Call("project_ng",
+@@ -442,7 +442,7 @@ if (!isGeneric("spTransform"))
+                     else use_ob_tran1 <- TRUE
+                     if (is.null(coordOp)) {
+                         out_coordOp <- .Call("project_ng_coordOp", proj,
+-                            as.logical(inv), NULL, #as.logical(use_ob_tran1),
++                            as.logical(inv), NULL, as.logical(use_ob_tran1),
+                             PACKAGE="rgdal")
+                     }
+                     res <- .Call("project_ng", as.integer(n), 
+@@ -484,7 +484,7 @@ if (!isGeneric("spTransform"))
+                     else use_ob_tran1 <- TRUE
+                     if (is.null(coordOp)) {
+                         out_coordOp <- .Call("project_ng_coordOp", proj,
+-                            as.logical(inv), NULL, #as.logical(use_ob_tran1),
++                            as.logical(inv), NULL, as.logical(use_ob_tran1),
+                             PACKAGE="rgdal")
+                     }
+                     res <- .Call("project_ng", as.integer(n), 
+@@ -577,7 +577,7 @@ setMethod("spTransform", signature("Spat
+                 else use_ob_tran1 <- TRUE
+                 if (is.null(coordOp)) {
+                     coordOp <- .Call("project_ng_coordOp", proj,
+-                        as.logical(inv), NULL, #as.logical(use_ob_tran1),
++                        as.logical(inv), NULL, as.logical(use_ob_tran1),
+                         PACKAGE="rgdal")
+                 }
+                 res <- .Call("project_ng", as.integer(n), 
+@@ -790,7 +790,7 @@ setMethod("spTransform", signature("Spat
+                 else use_ob_tran1 <- TRUE
+                 if (is.null(coordOp)) {
+                     coordOp <- .Call("project_ng_coordOp", proj,
+-                        as.logical(inv), NULL, #as.logical(use_ob_tran1),
++                        as.logical(inv), NULL, as.logical(use_ob_tran1),
+                         PACKAGE="rgdal")
+                 }
+                 res <- .Call("project_ng", as.integer(n), 
+--- a/src/init.c
++++ b/src/init.c
+@@ -80,7 +80,7 @@ static R_CallMethodDef CallEntries[] = {
+     {"RGDAL_project", (DL_FUNC) &RGDAL_project, 5},
+     {"project_inv", (DL_FUNC) &project_inv, 5},
+     {"project_ng", (DL_FUNC) &project_ng, 7},
+-    {"project_ng_coordOp", (DL_FUNC) &project_ng_coordOp, 3},
++    {"project_ng_coordOp", (DL_FUNC) &project_ng_coordOp, 4},
+     {"CRS_compare", (DL_FUNC) &CRS_compare, 4},
+     {"proj_network_enabled", (DL_FUNC) &proj_network_enabled, 0},
+     {"enable_proj_network", (DL_FUNC) &enable_proj_network, 0},
+--- a/src/proj6.cpp
++++ b/src/proj6.cpp
+@@ -495,7 +495,7 @@ SEXP CRS_compare(SEXP fromargs, SEXP toa
+ 	error("source crs creation failed: %s", errstr);
+     }
+ 	
+-//Rprintf("source crs: %s\n", proj_pj_info(source_crs).description); not filled for WKT
++//Rprintf("source crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, source_crs, PJ_PROJ_5, NULL)); not filled for WKT
+ //Rprintf("target crs input:  %s\n", CHAR(STRING_ELT(toargs, 0)));
+     if ((target_crs = proj_create(PJ_DEFAULT_CTX, CHAR(STRING_ELT(toargs, 0)))) == NULL) {
+         proj_destroy(source_crs);
+@@ -503,7 +503,7 @@ SEXP CRS_compare(SEXP fromargs, SEXP toa
+         //proj_context_destroy(ctx);
+         error("target crs creation failed: %s", errstr);
+     }
+-//Rprintf("target crs: %s\n", proj_pj_info(target_crs).description); not filled for WKT
++//Rprintf("target crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, target_crs, PJ_PROJ_5, NULL)); not filled for WKT
+ #if PROJ_VERSION_MAJOR == 6  && PROJ_VERSION_MINOR < 3
+     ires_strict = proj_is_equivalent_to(source_crs, target_crs,
+         PJ_COMP_STRICT);
+@@ -587,7 +587,7 @@ SEXP transform_ng(SEXP fromargs, SEXP to
+ 	    error("source crs creation failed: %s", errstr);
+         }
+ 	
+-//Rprintf("source crs: %s\n", proj_pj_info(source_crs).description); 
++//Rprintf("source crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, source_crs, PJ_PROJ_5, NULL)); 
+ //Rprintf("target crs input:  %s\n", CHAR(STRING_ELT(toargs, 0)));
+ 	if ((target_crs = proj_create(PJ_DEFAULT_CTX, CHAR(STRING_ELT(toargs, 0)))) == NULL) {
+             proj_area_destroy(area_of_interest);
+@@ -596,7 +596,7 @@ SEXP transform_ng(SEXP fromargs, SEXP to
+             //proj_context_destroy(ctx);
+ 	    error("target crs creation failed: %s", errstr);
+         }
+-//Rprintf("target crs: %s\n", proj_pj_info(target_crs).description); 
++//Rprintf("target crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, target_crs, PJ_PROJ_5, NULL)); 
+ #if PROJ_VERSION_MAJOR == 6  && PROJ_VERSION_MINOR < 2
+         if ((pj_transform = proj_create_crs_to_crs(PJ_DEFAULT_CTX,
+             CHAR(STRING_ELT(fromargs, 0)),
+@@ -764,14 +764,14 @@ SEXP transform_ng(SEXP fromargs, SEXP to
+     return(res);
+ }
+ 
+-SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi//, SEXP ob_tran
++SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi, SEXP ob_tran
+ ) {
+ 
+     //PJ_CONTEXT *ctx = proj_context_create();
+     PJ *source_crs, *target_crs;
+     PJ* pj_transform = NULL;
+     PJ_AREA *area_of_interest = 0;
+-    int //use_ob_tran = LOGICAL_POINTER(ob_tran)[0], 
++    int use_ob_tran = LOGICAL_POINTER(ob_tran)[0], 
+         use_inv, use_aoi=1;
+ 
+     proj_log_func(PJ_DEFAULT_CTX, NULL, silent_logger);
+@@ -796,14 +796,23 @@ SEXP project_ng_coordOp(SEXP proj, SEXP
+ 	error("target crs creation failed: %s", errstr);
+     }
+ 	
+-//Rprintf("target crs: %s\n", proj_pj_info(target_crs).definition); 
+-    if ((source_crs = proj_crs_get_geodetic_crs(PJ_DEFAULT_CTX, target_crs)) == 0) {
+-        const char *errstr = proj_errno_string(proj_context_errno(PJ_DEFAULT_CTX));
+-        proj_destroy(target_crs);
+-        //proj_context_destroy(ctx);
+-        error("source crs creation failed: %s", errstr);
++//Rprintf("target crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, target_crs, PJ_PROJ_5, NULL)); 
++    if (proj_get_type(target_crs) == PJ_TYPE_GEOGRAPHIC_2D_CRS && use_ob_tran) {
++        if ((source_crs = proj_get_source_crs(PJ_DEFAULT_CTX, target_crs)) == 0) {
++            const char *errstr = proj_errno_string(proj_context_errno(PJ_DEFAULT_CTX));
++            proj_destroy(target_crs);
++            //proj_context_destroy(ctx);
++            error("source crs creation failed: %s", errstr);
++        }
++    } else {
++        if ((source_crs = proj_crs_get_geodetic_crs(PJ_DEFAULT_CTX, target_crs)) == 0) {
++            const char *errstr = proj_errno_string(proj_context_errno(PJ_DEFAULT_CTX));
++            proj_destroy(target_crs);
++            //proj_context_destroy(ctx);
++            error("source crs creation failed: %s", errstr);
++        }
+     }
+-//Rprintf("source crs: %s\n", proj_pj_info(source_crs).definition); 
++//Rprintf("source crs: %s\n", proj_as_proj_string(PJ_DEFAULT_CTX, source_crs, PJ_PROJ_5, NULL)); 
+ 
+     if (use_aoi) {
+         area_of_interest = proj_area_create();
+@@ -811,7 +820,7 @@ SEXP project_ng_coordOp(SEXP proj, SEXP
+             NUMERIC_POINTER(aoi)[1], NUMERIC_POINTER(aoi)[2],
+             NUMERIC_POINTER(aoi)[3]);
+     }
+-
++//Rprintf("use_inv: %d\n", use_inv);
+ #if PROJ_VERSION_MAJOR == 6  && PROJ_VERSION_MINOR < 2
+     if (use_inv) pj_transform = proj_create_crs_to_crs(PJ_DEFAULT_CTX, 
+         proj_as_wkt(PJ_DEFAULT_CTX, target_crs, PJ_WKT2_2018, NULL),
+@@ -891,8 +900,10 @@ SEXP project_ng(SEXP n, SEXP xlon, SEXP
+             NUMERIC_POINTER(VECTOR_ELT(res, 1))[i]=iylat;
+         } else {
+             a = proj_coord(ixlon, iylat, iz, 0);
+-            if (!use_inv && is_ob_tran) b = proj_trans(pj_transform, PJ_INV, a);
+-            else b = proj_trans(pj_transform, PJ_FWD, a);
++            if (!use_inv && is_ob_tran) {
++                if (PROJ_VERSION_MAJOR > 7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR > 2) || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR == 2 && PROJ_VERSION_PATCH >= 1)) b = proj_trans(pj_transform, PJ_FWD, a);
++                else b = proj_trans(pj_transform, PJ_INV, a);
++            } else b = proj_trans(pj_transform, PJ_FWD, a);
+             if (b.uv.u == HUGE_VAL || ISNAN(b.uv.u) || b.uv.v == HUGE_VAL || 
+                 ISNAN(b.uv.v)) {
+                 nwarn++;
+--- a/src/rgdal.h
++++ b/src/rgdal.h
+@@ -139,7 +139,7 @@ SEXP R_GDAL_OSR_PROJ();// GDAL
+ SEXP RGDAL_project(SEXP n, SEXP xlon, SEXP ylat, SEXP projarg, SEXP ob_tran); // both
+ SEXP project_inv(SEXP n, SEXP x, SEXP y, SEXP projarg, SEXP ob_tran); // both
+ SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP inv, SEXP ob_tran, SEXP coordOp); // both
+-SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi); // both
++SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi, SEXP ob_tran); // both
+ SEXP get_source_crs(SEXP source); // both
+ SEXP proj_vis_order(SEXP wkt2); // both
+ SEXP OSR_is_projected(SEXP inSRID);
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1087.patch r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1087.patch
--- r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1087.patch	1970-01-01 01:00:00.000000000 +0100
+++ r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1087.patch	2021-01-04 07:32:08.000000000 +0100
@@ -0,0 +1,31 @@
+From 665fd90c143de3c00a2834e7d88d09ede0cb6bb8 Mon Sep 17 00:00:00 2001
+From: rsbivand <rsbivand at edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
+Date: Tue, 29 Dec 2020 15:13:29 +0000
+Subject: [PATCH] test with PROJ 7.2.0
+
+git-svn-id: svn://svn.r-forge.r-project.org/svnroot/rgdal@1087 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
+---
+ pkg/src/proj6.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/src/proj6.cpp
++++ b/src/proj6.cpp
+@@ -1,4 +1,4 @@
+-/* Copyright (c) 2019 Roger Bivand */
++/* Copyright (c) 2019-20 Roger Bivand */
+ 
+ 
+ #include <R.h>
+@@ -900,10 +900,10 @@ SEXP project_ng(SEXP n, SEXP xlon, SEXP
+             NUMERIC_POINTER(VECTOR_ELT(res, 1))[i]=iylat;
+         } else {
+             a = proj_coord(ixlon, iylat, iz, 0);
+-            if (!use_inv && is_ob_tran) {
++            /*if (!use_inv && is_ob_tran) {
+                 if (PROJ_VERSION_MAJOR > 7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR > 2) || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR == 2 && PROJ_VERSION_PATCH >= 1)) b = proj_trans(pj_transform, PJ_FWD, a);
+                 else b = proj_trans(pj_transform, PJ_INV, a);
+-            } else b = proj_trans(pj_transform, PJ_FWD, a);
++            } else*/ b = proj_trans(pj_transform, PJ_FWD, a);
+             if (b.uv.u == HUGE_VAL || ISNAN(b.uv.u) || b.uv.v == HUGE_VAL || 
+                 ISNAN(b.uv.v)) {
+                 nwarn++;
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1088.patch r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1088.patch
--- r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1088.patch	1970-01-01 01:00:00.000000000 +0100
+++ r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1088.patch	2021-01-04 07:32:20.000000000 +0100
@@ -0,0 +1,106 @@
+From 6345154005eedd80c2e0cd41d0cc1a85a9aa30e2 Mon Sep 17 00:00:00 2001
+From: rsbivand <rsbivand at edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
+Date: Tue, 29 Dec 2020 15:25:17 +0000
+Subject: [PATCH] adapt ob_tran for PROJ > 7.2.0
+
+git-svn-id: svn://svn.r-forge.r-project.org/svnroot/rgdal@1088 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
+---
+ pkg/R/project.R   |  8 +-------
+ pkg/src/init.c    |  2 +-
+ pkg/src/proj6.cpp | 10 +++-------
+ pkg/src/rgdal.h   |  2 +-
+ 4 files changed, 6 insertions(+), 16 deletions(-)
+
+--- a/R/project.R
++++ b/R/project.R
+@@ -257,8 +257,6 @@ OSRIsProjected <- function(obj) {
+                 as.double(xy[,1]),
+                 as.double(xy[,2]),
+                 NULL,
+-                as.logical(inv),
+-                as.logical(use_ob_tran),
+                 coordOp,
+                 PACKAGE="rgdal")
+         } else {
+@@ -447,7 +445,6 @@ if (!isGeneric("spTransform"))
+                     }
+                     res <- .Call("project_ng", as.integer(n), 
+                         as.double(crds[,1]), as.double(crds[,2]), NULL,
+-                        as.logical(inv), as.logical(use_ob_tran1),
+                         out_coordOp, PACKAGE="rgdal")
+                 }
+             } else {
+@@ -489,8 +486,7 @@ if (!isGeneric("spTransform"))
+                     }
+                     res <- .Call("project_ng", as.integer(n), 
+                         as.double(crds[,1]), as.double(crds[,2]),
+-                        as.double(crds[,3]), as.logical(inv), 
+-                        as.logical(use_ob_tran1), out_coordOp, PACKAGE="rgdal")
++                        as.double(crds[,3]), out_coordOp, PACKAGE="rgdal")
+                 }
+             } else {
+ 	    res <- .Call("transform", from_args, to_args, n,
+@@ -582,7 +578,6 @@ setMethod("spTransform", signature("Spat
+                 }
+                 res <- .Call("project_ng", as.integer(n), 
+                     as.double(crds[,1]), as.double(crds[,2]), NULL,
+-                    as.logical(inv), as.logical(use_ob_tran1),
+                     coordOp, PACKAGE="rgdal")
+                 out_coordOp <- coordOp
+             }
+@@ -795,7 +790,6 @@ setMethod("spTransform", signature("Spat
+                 }
+                 res <- .Call("project_ng", as.integer(n), 
+                     as.double(crds[,1]), as.double(crds[,2]), NULL,
+-                    as.logical(inv), as.logical(use_ob_tran1),
+                     coordOp, PACKAGE="rgdal")
+                 out_coordOp <- coordOp
+             }
+--- a/src/init.c
++++ b/src/init.c
+@@ -79,7 +79,7 @@ static R_CallMethodDef CallEntries[] = {
+     {"RGDAL_projInfo", (DL_FUNC) &RGDAL_projInfo, 1},
+     {"RGDAL_project", (DL_FUNC) &RGDAL_project, 5},
+     {"project_inv", (DL_FUNC) &project_inv, 5},
+-    {"project_ng", (DL_FUNC) &project_ng, 7},
++    {"project_ng", (DL_FUNC) &project_ng, 5},
+     {"project_ng_coordOp", (DL_FUNC) &project_ng_coordOp, 4},
+     {"CRS_compare", (DL_FUNC) &CRS_compare, 4},
+     {"proj_network_enabled", (DL_FUNC) &proj_network_enabled, 0},
+--- a/src/proj6.cpp
++++ b/src/proj6.cpp
+@@ -863,9 +863,8 @@ SEXP project_ng_coordOp(SEXP proj, SEXP
+     return(res);
+ }
+ 
+-SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP inv, SEXP ob_tran, SEXP coordOp) {
+-    int i, nwarn=0, is_ob_tran=LOGICAL_POINTER(ob_tran)[0], 
+-        nn=INTEGER_POINTER(n)[0], use_inv=LOGICAL_POINTER(inv)[0];
++SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP coordOp) {
++    int i, nwarn=0, nn=INTEGER_POINTER(n)[0];
+     SEXP res;
+     //PJ_CONTEXT *ctx = proj_context_create();
+     PJ* pj_transform = NULL;
+@@ -900,10 +899,7 @@ SEXP project_ng(SEXP n, SEXP xlon, SEXP
+             NUMERIC_POINTER(VECTOR_ELT(res, 1))[i]=iylat;
+         } else {
+             a = proj_coord(ixlon, iylat, iz, 0);
+-            /*if (!use_inv && is_ob_tran) {
+-                if (PROJ_VERSION_MAJOR > 7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR > 2) || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR == 2 && PROJ_VERSION_PATCH >= 1)) b = proj_trans(pj_transform, PJ_FWD, a);
+-                else b = proj_trans(pj_transform, PJ_INV, a);
+-            } else*/ b = proj_trans(pj_transform, PJ_FWD, a);
++            b = proj_trans(pj_transform, PJ_FWD, a);
+             if (b.uv.u == HUGE_VAL || ISNAN(b.uv.u) || b.uv.v == HUGE_VAL || 
+                 ISNAN(b.uv.v)) {
+                 nwarn++;
+--- a/src/rgdal.h
++++ b/src/rgdal.h
+@@ -138,7 +138,7 @@ SEXP RGDAL_projInfo(SEXP type); // both
+ SEXP R_GDAL_OSR_PROJ();// GDAL
+ SEXP RGDAL_project(SEXP n, SEXP xlon, SEXP ylat, SEXP projarg, SEXP ob_tran); // both
+ SEXP project_inv(SEXP n, SEXP x, SEXP y, SEXP projarg, SEXP ob_tran); // both
+-SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP inv, SEXP ob_tran, SEXP coordOp); // both
++SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP coordOp); // both
+ SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi, SEXP ob_tran); // both
+ SEXP get_source_crs(SEXP source); // both
+ SEXP proj_vis_order(SEXP wkt2); // both
diff -Nru r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1089.patch r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1089.patch
--- r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1089.patch	1970-01-01 01:00:00.000000000 +0100
+++ r-cran-rgdal-1.5-18+dfsg/debian/patches/svn-r1089.patch	2021-01-04 07:32:21.000000000 +0100
@@ -0,0 +1,92 @@
+From 08053a9e648b0446ec13c4db601239883f311af8 Mon Sep 17 00:00:00 2001
+From: rsbivand <rsbivand at edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
+Date: Tue, 29 Dec 2020 18:56:57 +0000
+Subject: [PATCH] ob_tran handling for 7.2.1
+
+git-svn-id: svn://svn.r-forge.r-project.org/svnroot/rgdal@1089 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
+---
+ pkg/src/projectit.cpp             |  4 ++--
+ pkg/tests/srs_rendering.Rout.save | 12 ++++++------
+ pkg/tests/test_proj.Rout.save     |  6 +++---
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/src/projectit.cpp
++++ b/src/projectit.cpp
+@@ -161,12 +161,12 @@ SEXP transform_ng(SEXP fromargs, SEXP to
+     return(R_NilValue);
+ }
+ 
+-SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP inv, SEXP ob_tran, SEXP coordOp) {
++SEXP project_ng(SEXP n, SEXP xlon, SEXP ylat, SEXP zz, SEXP coordOp) {
+     Rprintf("Not available for deprecated API");
+     return(R_NilValue);
+ }
+ 
+-SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi) {
++SEXP project_ng_coordOp(SEXP proj, SEXP inv, SEXP aoi, SEXP ob_tran) {
+     Rprintf("Not available for deprecated API");
+     return(R_NilValue);
+ }
+--- a/tests/srs_rendering.Rout.save
++++ b/tests/srs_rendering.Rout.save
+@@ -1,5 +1,5 @@
+ 
+-R version 4.0.2 (2020-06-22) -- "Taking Off Again"
++R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
+ Copyright (C) 2020 The R Foundation for Statistical Computing
+ Platform: x86_64-pc-linux-gnu (64-bit)
+ 
+@@ -17,11 +17,11 @@ Type 'q()' to quit R.
+ 
+ > suppressPackageStartupMessages(library(rgdal))
+ > getPROJ4VersionInfo()
+-[1] "Rel. 7.1.1, September 1st, 2020, [PJ_VERSION: 711]"
++[1] "Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]"
+ attr(,"short")
+-[1] 711
++[1] 721
+ > getGDALVersionInfo()
+-[1] "GDAL 3.1.3, released 2020/09/01"
++[1] "GDAL 3.2.0, released 2020/10/26"
+ > d <- system.file("vectors", package="rgdal")
+ > #shps <- ogrListLayers(d)
+ > (o <- OGRSpatialRef(d, "trin_inca_pl03"))
+@@ -42,7 +42,7 @@ Warning message:
+ In OGRSpatialRef(d, "scot_BNG") :
+   Discarded datum OSGB_1936 in CRS definition: +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs
+ > if (new_proj_and_gdal()) comment(o)
+-[1] "PROJCRS[\"OSGB 1936 / British National Grid\",\n    BASEGEOGCRS[\"OSGB 1936\",\n        DATUM[\"OSGB 1936\",\n            ELLIPSOID[\"Airy 1830\",6377563.396,299.3249646,\n                LENGTHUNIT[\"metre\",1]]],\n        PRIMEM[\"Greenwich\",0,\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        ID[\"EPSG\",4277]],\n    CONVERSION[\"British National Grid\",\n        METHOD[\"Transverse Mercator\",\n            ID[\"EPSG\",9807]],\n        PARAMETER[\"Latitude of natural origin\",49,\n            ANGLEUNIT[\"degree\",0.0174532925199433],\n            ID[\"EPSG\",8801]],\n        PARAMETER[\"Longitude of natural origin\",-2,\n            ANGLEUNIT[\"degree\",0.0174532925199433],\n            ID[\"EPSG\",8802]],\n        PARAMETER[\"Scale factor at natural origin\",0.9996012717,\n            SCALEUNIT[\"unity\",1],\n            ID[\"EPSG\",8805]],\n        PARAMETER[\"False easting\",400000,\n            LENGTHUNIT[\"metre\",1],\n            ID[\"EPSG\",8806]],\n        PARAMETER[\"False northing\",-100000,\n            LENGTHUNIT[\"metre\",1],\n            ID[\"EPSG\",8807]]],\n    CS[Cartesian,2],\n        AXIS[\"(E)\",east,\n            ORDER[1],\n            LENGTHUNIT[\"metre\",1]],\n        AXIS[\"(N)\",north,\n            ORDER[2],\n            LENGTHUNIT[\"metre\",1]],\n    USAGE[\n        SCOPE[\"unknown\"],\n        AREA[\"UK - Britain and UKCS 49°45'N to 61°N, 9°W to 2°E\"],\n        BBOX[49.75,-9,61.01,2.01]],\n    ID[\"EPSG\",27700]]"
++[1] "PROJCRS[\"OSGB 1936 / British National Grid\",\n    BASEGEOGCRS[\"OSGB 1936\",\n        DATUM[\"OSGB 1936\",\n            ELLIPSOID[\"Airy 1830\",6377563.396,299.3249646,\n                LENGTHUNIT[\"metre\",1]]],\n        PRIMEM[\"Greenwich\",0,\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        ID[\"EPSG\",4277]],\n    CONVERSION[\"British National Grid\",\n        METHOD[\"Transverse Mercator\",\n            ID[\"EPSG\",9807]],\n        PARAMETER[\"Latitude of natural origin\",49,\n            ANGLEUNIT[\"degree\",0.0174532925199433],\n            ID[\"EPSG\",8801]],\n        PARAMETER[\"Longitude of natural origin\",-2,\n            ANGLEUNIT[\"degree\",0.0174532925199433],\n            ID[\"EPSG\",8802]],\n        PARAMETER[\"Scale factor at natural origin\",0.9996012717,\n            SCALEUNIT[\"unity\",1],\n            ID[\"EPSG\",8805]],\n        PARAMETER[\"False easting\",400000,\n            LENGTHUNIT[\"metre\",1],\n            ID[\"EPSG\",8806]],\n        PARAMETER[\"False northing\",-100000,\n            LENGTHUNIT[\"metre\",1],\n            ID[\"EPSG\",8807]]],\n    CS[Cartesian,2],\n        AXIS[\"(E)\",east,\n            ORDER[1],\n            LENGTHUNIT[\"metre\",1]],\n        AXIS[\"(N)\",north,\n            ORDER[2],\n            LENGTHUNIT[\"metre\",1]],\n    USAGE[\n        SCOPE[\"Engineering survey, topographic mapping.\"],\n        AREA[\"United Kingdom (UK) - offshore to boundary of UKCS within 49°45'N to 61°N and 9°W to 2°E; onshore Great Britain (England, Wales and Scotland). Isle of Man onshore.\"],\n        BBOX[49.75,-9,61.01,2.01]],\n    ID[\"EPSG\",27700]]"
+ > (o <- OGRSpatialRef(file.path(d, "airports.gml"), "airports"))
+ [1] NA
+ > if (new_proj_and_gdal()) comment(o)
+@@ -142,4 +142,4 @@ In getProjectionRef(ds, OVERRIDE_PROJ_DA
+ > 
+ > proc.time()
+    user  system elapsed 
+-  0.415   0.042   0.453 
++  0.434   0.034   0.486 
+--- a/tests/test_proj.Rout.save
++++ b/tests/test_proj.Rout.save
+@@ -1,5 +1,5 @@
+ 
+-R version 4.0.2 (2020-06-22) -- "Taking Off Again"
++R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
+ Copyright (C) 2020 The R Foundation for Statistical Computing
+ Platform: x86_64-pc-linux-gnu (64-bit)
+ 
+@@ -62,7 +62,7 @@ In showSRID(uprojargs, format = "PROJ",
+ proj=pipeline step proj=unitconvert xy_in=deg xy_out=rad step inv
+ proj=ob_tran o_proj=longlat o_lon_p=-162 o_lat_p=39.25 lon_0=180
+ ellps=sphere step proj=unitconvert xy_in=rad xy_out=deg
+-proj=pipeline step proj=unitconvert xy_in=deg xy_out=rad step inv
++proj=pipeline step proj=unitconvert xy_in=deg xy_out=rad step
+ proj=ob_tran o_proj=longlat o_lon_p=-162 o_lat_p=39.25 lon_0=180
+ ellps=sphere step proj=unitconvert xy_in=rad xy_out=deg
+ Warning messages:
+@@ -75,4 +75,4 @@ Warning messages:
+ > 
+ > proc.time()
+    user  system elapsed 
+-  0.448   0.038   0.483 
++  0.538   0.044   0.585 


More information about the R-pkg-team mailing list