diff --git a/NAMESPACE b/NAMESPACE index 1fe2821..c6f208f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -148,6 +148,7 @@ export(as.json) export(as.location) export(bounds) export(centroid) +export(cwgr) export(file_to_geojson) export(geojson_json) export(geojson_list) diff --git a/R/cwgr.R b/R/cwgr.R new file mode 100644 index 0000000..687956d --- /dev/null +++ b/R/cwgr.R @@ -0,0 +1,11 @@ +#' capture writeOGR +#' +#' @export +#' @examples \dontrun{ +#' library("rgdal") +#' cities <- readOGR(system.file("vectors", package = "rgdal")[1], "cities") +#' cwgr(cities[1:10,], "cities") +#' } +cwgr <- function(obj, layer) { + capturedWriteOGR(obj, object.size(obj), layer, writeOGR) +} diff --git a/man/cwgr.Rd b/man/cwgr.Rd new file mode 100644 index 0000000..c39d0b7 --- /dev/null +++ b/man/cwgr.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cwgr.R +\name{cwgr} +\alias{cwgr} +\title{capture writeOGR} +\usage{ +cwgr(obj, layer) +} +\description{ +capture writeOGR +} +\examples{ +\dontrun{ +library("rgdal") +cities <- readOGR(system.file("vectors", package = "rgdal")[1], "cities") +cwgr(cities[1:10,], "cities") +} +} + diff --git a/src/captured_write_ogr.o b/src/captured_write_ogr.o index abc3a24..0b19f27 100644 Binary files a/src/captured_write_ogr.o and b/src/captured_write_ogr.o differ diff --git a/src/geojsonio.so b/src/geojsonio.so index 6dd9de1..b1c3679 100755 Binary files a/src/geojsonio.so and b/src/geojsonio.so differ