-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:hypertidy/vapour # Conflicts: # DESCRIPTION # NEWS.md # R/vapour_vrt.R
- Loading branch information
Showing
23 changed files
with
2,082 additions
and
1,886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: vapour | ||
Title: Access to the 'Geospatial Data Abstraction Library' ('GDAL') | ||
Version: 0.9.5.9006 | ||
Version: 0.9.5.9008 | ||
Authors@R: c(person("Michael", "Sumner", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-2471-7511")), | ||
person("Simon", "Wotherspoon", role = "ctb", comment = "RasterIO configuration for resampling options"), | ||
person("Mark", "Padgham", role = "ctb", comment = "helped get started :)"), | ||
|
@@ -29,7 +29,7 @@ Imports: | |
nanoarrow, | ||
Rcpp, | ||
utils | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.0 | ||
Roxygen: list(markdown = TRUE) | ||
Suggests: | ||
testthat, | ||
|
@@ -39,6 +39,6 @@ Suggests: | |
spelling | ||
SystemRequirements: libgdal-dev, GDAL (>= 2.2.3), PROJ (>= 4.8.0) | ||
VignetteBuilder: knitr | ||
URL: https://github.com/hypertidy/vapour | ||
URL: https://github.com/hypertidy/vapour, https://hypertidy.github.io/vapour/ | ||
BugReports: https://github.com/hypertidy/vapour/issues | ||
Language: en-US |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,57 @@ | ||
.read_stream <- function(dsn, layer, ..., sql = NA, options = NULL, quiet = FALSE, | ||
fid_column_name = character(0), | ||
drivers = character(0), ## replace with vrt://..?if= | ||
wkt_filter = character(0), ## extent | ||
optional = FALSE, return_stream = FALSE) { | ||
|
||
## vapourize this | ||
layer <- if (missing(layer)) { | ||
character() | ||
} else { | ||
enc2utf8(layer) | ||
} | ||
if (nchar(dsn) < 1L) { | ||
stop("`dsn` must describe a valid data source name for GDAL (input wasan empty string).", call. = FALSE) | ||
} | ||
dsn_exists <- file.exists(dsn) ## good to see this finally stuck in sf | ||
|
||
if (length(dsn) == 1 && dsn_exists) { | ||
dsn = enc2utf8(normalizePath(dsn)) | ||
} | ||
|
||
|
||
stream = nanoarrow::nanoarrow_allocate_array_stream() | ||
|
||
info = gdal_dsn_read_vector_stream(stream, dsn, layer, sql, as.character(options), quiet, | ||
drivers, wkt_filter, dsn_exists, dsn_isdb = FALSE, fid_column_name, 80L) | ||
|
||
browser() | ||
if (return_stream) return(stream) | ||
##// layer has been freed as this point | ||
# geometry_column <- unlist(lapply( | ||
# stream$get_schema()$children, function(s) identical(s$metadata[["ARROW:extension:name"]], "ogc.wkb") | ||
# )) | ||
crs <- info[[1L]] | ||
if (info[[2L]] == -1) { | ||
num_features = NULL | ||
} | ||
list(data = suppressWarnings(nanoarrow::convert_array_stream(stream, size = num_features)), crs = crs) | ||
} | ||
|
||
|
||
|
||
# gdal_ptrs <- function(dsource, layer) { | ||
# layer <- if (missing(layer)) { | ||
# character() | ||
# } else { | ||
# enc2utf8(layer) | ||
# } | ||
# #gdal_ptrs_cpp(dsource, layer) | ||
# } | ||
# | ||
# gdal_vector_data <- function(dsource, layer, ..., sql = NA, options = NULL, quiet = FALSE, | ||
# fid_column_name = character(0), | ||
# if_drivers = character(0), | ||
# extent = NA, | ||
# optional = FALSE, return_stream = FALSE) { | ||
# | ||
# ## vapourize this | ||
# layer <- if (missing(layer)) { | ||
# character() | ||
# } else { | ||
# enc2utf8(layer) | ||
# } | ||
# if (nchar(dsource) < 1L) { | ||
# stop("`dsour` must describe a valid source description for GDAL (input was an empty string).", call. = FALSE) | ||
# } | ||
# dsn_exists <- file.exists(dsource) | ||
# | ||
# if (length(dsource) == 1 && dsn_exists) { | ||
# dsource <- enc2utf8(normalizePath(dsource)) | ||
# } | ||
# | ||
# | ||
# stream <- nanoarrow::nanoarrow_allocate_array_stream() | ||
# | ||
# # | ||
# # info <- gdal_dsn_read_vector_stream(stream, | ||
# # dsource, layer, sql, as.character(options), quiet, | ||
# # if_drivers, extent, dsn_exists, fid_column_name, 80L) | ||
# # | ||
# # | ||
# | ||
# # geometry_column <- unlist(lapply( | ||
# # stream$get_schema()$children, function(s) identical(s$metadata[["ARROW:extension:name"]], "ogc.wkb") | ||
# # )) | ||
# crs <- info[[1L]] | ||
# if (info[[2L]] == -1) { | ||
# num_features = NULL | ||
# } | ||
# | ||
# # df = suppressWarnings(nanoarrow::convert_array_stream(x$stream, x$num_features)) | ||
# #list(stream = stream, crs = crs, num_features = num_features) | ||
# d <- nanoarrow::convert_array_stream(stream, num_features) | ||
# #d$wkb_geometry <- wk::wkb(d$wkb_geometry, crs = crs) | ||
# d | ||
# } | ||
# | ||
# | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.