From 1dc2acdfd0ff66af190c7262286dbec75ab65381 Mon Sep 17 00:00:00 2001 From: Scott Chamberlain Date: Thu, 18 Feb 2016 16:00:05 -0800 Subject: [PATCH] added exported fxn cwgr() to use internal fxn, #77 --- NAMESPACE | 1 + R/cwgr.R | 11 +++++++++++ man/cwgr.Rd | 19 +++++++++++++++++++ src/captured_write_ogr.o | Bin 236436 -> 236436 bytes src/geojsonio.so | Bin 56488 -> 56488 bytes 5 files changed, 31 insertions(+) create mode 100644 R/cwgr.R create mode 100644 man/cwgr.Rd 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 abc3a24d1131b5d617abaf765c966acd63aeb2b6..0b19f275ac4d69b50d470b250111bb7907e55b15 100644 GIT binary patch delta 245 zcmbQToo~u^zJ@J~61y7<1G!f~T-hx^-E~Y8J$8V2MyU#n4CX6=l5)Ek7<{!0LEN)I z?lX|AF~}s5&mg82h$(uPosnUBu^^)$qs{bIK}Jo+@agLX85J1Aw_gxsp1;1G!f~T*)m!-E~Y8J$8V2dZ`MG4CX6=l5)Ek7<|q9CXg`mvdSi)Fe5W(dyp$5 N5HoELa%FZ30|4~}IvD@} diff --git a/src/geojsonio.so b/src/geojsonio.so index 6dd9de19f6debc5ab3689f0895695abe882875e3..b1c3679b2902e3df472104eaf9d05a4cba5325c0 100755 GIT binary patch delta 17 ZcmZ3nlX=BX<_#yNFzt%kd}_))cK}c82_XOg delta 17 ZcmZ3nlX=BX<_#yNFnRE7J~ic@I{-@g2w?yK