USDAForestService / gdalraster

R Bindings to GDAL (Geospatial Data Abstraction Library)
https://usdaforestservice.github.io/gdalraster/
Other
41 stars 7 forks source link

Add `g_wk2wk()`: geometry WKB/WKT conversion #517

Closed ctoney closed 3 weeks ago

ctoney commented 3 weeks ago

Geometry WKB/WKT conversion

g_wk2wk() converts geometries between Well Known Binary (WKB) and Well Known Text (WKT) formats. A geometry given as a raw vector of WKB will be converted to a WKT string, while a geometry given as a WKT string will be converted to a WKB raw vector. Input may also be a list of WKB raw vectors or a character vector of WKT strings.

This PR also renames files: src/geos_wkt.cpp -> src/geom_api.cpp src/geos_wkt.h -> src/geom_api.h

and the tests in tests/testthat/test-geos_wkt.R were merged into tests/testthat/test-geom.R.

A separate PR will re-implement the geometry API to operate on either WKB or WKT inputs.