Skip to content

Commit 21d385a

Browse files
committed
fixes #2166
1 parent a2a3ec4 commit 21d385a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# version 1.0-15
22

3+
* `st_transform()` properly responds to in-session changes to `sf_proj_network()`; #2166
4+
35
* `plot.sf()`: `key.width` is sensitive to pointsize graphics parameter `par("ps")`; keys with factor levels suggest a proper size if they won't fit.
46

57
* `plot.sf()`: `key.pos` can hold a second value in [0, 1] determining the relative position of the key in the available space

src/proj.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <iostream>
22

3+
#include <ogr_srs_api.h>
4+
35
#include "Rcpp.h"
46

57
// [[Rcpp::export]]
@@ -197,11 +199,17 @@ Rcpp::CharacterVector CPL_enable_network(Rcpp::CharacterVector url, bool enable
197199
#ifdef HAVE_71
198200
if (enable) {
199201
proj_context_set_enable_network(PJ_DEFAULT_CTX, 1);
202+
#if GDAL_VERSION_NUM >= 3040000
203+
OSRSetPROJEnableNetwork(1);
204+
#endif
200205
if (url.size())
201206
proj_context_set_url_endpoint(PJ_DEFAULT_CTX, url[0]);
202207
return Rcpp::CharacterVector::create(proj_context_get_url_endpoint(PJ_DEFAULT_CTX));
203208
} else { // disable:
204209
proj_context_set_enable_network(PJ_DEFAULT_CTX, 0);
210+
#if GDAL_VERSION_NUM >= 3040000
211+
OSRSetPROJEnableNetwork(0);
212+
#endif
205213
return Rcpp::CharacterVector::create();
206214
}
207215
#else

tests/spatstat.Rout.save

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
2+
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
33
Copyright (C) 2023 The R Foundation for Statistical Computing
44
Platform: x86_64-pc-linux-gnu (64-bit)
55

@@ -125,8 +125,8 @@ Type 'q()' to quit R.
125125
+ (y = st_as_sfc(as.psp(sf)))
126126
+ all.equal(st_geometry(x), y)
127127
+ }
128-
spatstat.geom 3.2-1
129-
spatstat.random 3.1-5
128+
spatstat.geom 3.2-5
129+
spatstat.random 3.1-6
130130
Simple feature collection with 51 features and 1 field
131131
Geometry type: GEOMETRY
132132
Dimension: XY
@@ -166,4 +166,4 @@ In st_as_sfc.owin(spatstat.geom::as.owin(x)) :
166166
>
167167
> proc.time()
168168
user system elapsed
169-
2.366 0.868 2.343
169+
2.011 0.116 2.121

0 commit comments

Comments
 (0)