Skip to content

Commit 76ae621

Browse files
committed
1.8.1
1 parent c7be95c commit 76ae621

File tree

6 files changed

+35
-28
lines changed

6 files changed

+35
-28
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Type: Package
33
Title: Read and Write 'las' and 'laz' Binary File Formats Used for Remote Sensing Data
44
Version: 1.8.1
55
Authors@R: c(
6-
person("Jean-Romain", "Roussel", email = "info@r-lidar.com", role = c("aut", "cre", "cph")),
6+
person("Jean-Romain", "Roussel", email = "jean-romain.roussel.1@ulaval.ca", role = c("aut", "cre", "cph")),
77
person("Florian", "De Boissieu", email = "", role = c("aut", "ctb"), comment = "Enable the support of .lax file and extra byte attributes"),
88
person("Martin", "Isenburg", email = "", role = "cph", comment = "Is the author of the LASlib and LASzip libraries"),
99
person("David", "Auty", email = "", role = c("ctb"), comment = "Reviewed the documentation"),
@@ -15,7 +15,7 @@ BugReports: https://github.com/r-lidar/rlas/issues
1515
License: GPL-3
1616
Depends: R (>= 3.6.0)
1717
Imports: Rcpp, data.table, utils
18-
RoxygenNote: 7.2.3
18+
RoxygenNote: 7.3.2
1919
LinkingTo: Rcpp
2020
Suggests: tinytest
2121
Encoding: UTF-8

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export(is_valid_scalefactors)
6868
export(is_valid_version)
6969
export(read.las)
7070
export(read.lasheader)
71+
export(stream.las)
7172
export(true_size)
7273
export(write.las)
7374
export(writelax)

NEWS.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
### rlas v1.8.2
2-
3-
- Fix: can read file with multiple extra bytes definitions
4-
- change maintainer's email address
5-
61
### rlas v1.8.1
72

3+
- Fix: can read file with multiple extra bytes definitions
4+
- Fix CRAN: Found non-API call to R: ‘DATAPTR’ for altrep
85
- Removed a `boost` header still included in the code.
6+
- Function `stream.las` exposed to users
97

108
### rlas v1.8.0
119

R/readLAS.r

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ read.lasheader = function(file)
126126
return(data)
127127
}
128128

129+
#' @rdname read.las
130+
#' @param ifiles,ofile characters. Streaming operations.
131+
#' @param polygons list. Internal use only.
132+
#' @export
129133
stream.las = function(ifiles, ofile = "", select = "*", filter = "", polygons = list())
130134
{
131135
stream <- ofile != ""

man/read.las.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/altrep_compact_replication.cpp

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,73 +171,70 @@ struct compact_repetition
171171
//
172172
// This is guaranteed to never allocate (in the R sense)
173173
static const void* Dataptr_or_null(SEXP vec) {
174-
//Rprintf("Calling Dataptr_or_null on a compact_repetition at %p\n", R_ExternalPtrAddr(vec));
175174
SEXP data2 = R_altrep_data2(vec);
176175
if (data2 == R_NilValue) return nullptr;
177-
return DATAPTR(data2);
176+
177+
switch (TYPEOF(data2)) {
178+
case INTSXP: return INTEGER(data2);
179+
case REALSXP: return REAL(data2);
180+
case LGLSXP: return LOGICAL(data2);
181+
case RAWSXP: return RAW(data2);
182+
default: return nullptr; // fallback if unknown type
183+
}
178184
}
179185

180-
// same in this case, writeable is ignored
181186
static void* DataptrInt(SEXP vec, Rboolean writeable)
182187
{
183188
SEXP data2 = R_altrep_data2(vec);
184-
if (data2 != R_NilValue)
185-
{
186-
//Rprintf("Returning pointer to materialized compact_repetition at %p\n", R_ExternalPtrAddr(vec));
187-
return DATAPTR(data2);
189+
if (data2 != R_NilValue) {
190+
return INTEGER(data2);
188191
}
189192

190-
//Rprintf("Materializing a compact repetition at %p\n", R_ExternalPtrAddr(vec));
191193
int n = Length(vec);
192194
auto v = Get(vec).value;
193195
SEXP val = PROTECT(Rf_allocVector(INTSXP, n));
194196
int *p = INTEGER(val);
195197
for (int i = 0; i < n; i++) p[i] = v;
196198
R_set_altrep_data2(vec, val);
197199
UNPROTECT(1);
198-
return DATAPTR(val);
200+
return INTEGER(val);
199201
}
200202

201203
static void* DataptrReal(SEXP vec, Rboolean writeable)
202204
{
203205
SEXP data2 = R_altrep_data2(vec);
204-
if (data2 != R_NilValue)
205-
{
206-
//Rprintf("Returning pointer to materialized compact_repetition at %p\n", R_ExternalPtrAddr(vec));
207-
return DATAPTR(data2);
206+
if (data2 != R_NilValue) {
207+
return REAL(data2);
208208
}
209209

210-
//Rprintf("Materializing a compact repetition at %p\n", R_ExternalPtrAddr(vec));
211210
int n = Length(vec);
212211
double v = Get(vec).value;
213212
SEXP val = PROTECT(Rf_allocVector(REALSXP, n));
214213
double *p = REAL(val);
215214
for (int i = 0; i < n; i++) p[i] = v;
216215
R_set_altrep_data2(vec, val);
217216
UNPROTECT(1);
218-
return DATAPTR(val);
217+
return REAL(val);
219218
}
220219

221220
static void* DataptrLogical(SEXP vec, Rboolean writeable)
222221
{
223222
SEXP data2 = R_altrep_data2(vec);
224-
if (data2 != R_NilValue)
225-
{
226-
//Rprintf("Returning pointer to materialized compact_repetition at %p\n", R_ExternalPtrAddr(vec));
227-
return DATAPTR(data2);
223+
if (data2 != R_NilValue) {
224+
return LOGICAL(data2);
228225
}
229226

230-
//Rprintf("Materializing a compact repetition at %p\n", R_ExternalPtrAddr(vec));
231227
int n = Length(vec);
232228
bool v = Get(vec).value;
233229
SEXP val = PROTECT(Rf_allocVector(LGLSXP, n));
234230
int *p = LOGICAL(val);
235231
for (int i = 0; i < n; i++) p[i] = v ? TRUE : FALSE;
236232
R_set_altrep_data2(vec, val);
237233
UNPROTECT(1);
238-
return DATAPTR(val);
234+
return LOGICAL(val);
239235
}
240236

237+
241238
// ALTINT methods -----------------
242239
// the element at the index `i`
243240
// this does not do bounds checking because that's expensive, so

0 commit comments

Comments
 (0)