Last active
April 10, 2020 01:40
-
-
Save paleolimbot/8bfe4c3157e2306479220070b344da21 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Rcpp::sourceCpp( | |
| code = ' | |
| #include "geovctrs/geos-operator.hpp" | |
| // [[Rcpp::depends(geovctrs)]] | |
| class BufferOp: public UnaryGeometryOperator { | |
| GEOSGeometry* operateNext(GEOSContextHandle_t context, GEOSGeometry* geometry, size_t i) { | |
| // width, segments per quandrant | |
| return GEOSBuffer_r(context, geometry, 2, 30); | |
| } | |
| }; | |
| // [[Rcpp::export]] | |
| SEXP buffer2(SEXP data, SEXP ptype) { | |
| BufferOp op; | |
| op.initProvider(data); | |
| op.initExporter(ptype); | |
| return op.operate(); | |
| } | |
| ' | |
| ) | |
| buffer2(geovctrs::geo_wkt("POINT (30 10)"), geovctrs::geo_wkt()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment