Read and write well-known text
geos_read_wkt(wkt, fix_structure = FALSE, crs = NULL)
geos_write_wkt(geom, include_z = TRUE, precision = 16, trim = TRUE)
geos_read_geojson(geojson, crs = NULL)
geos_write_geojson(geom, indent = -1)
geos_read_wkb(wkb, fix_structure = FALSE, crs = NULL)
geos_write_wkb(
geom,
include_z = TRUE,
include_srid = FALSE,
endian = 1,
flavor = c("extended", "iso")
)
geos_read_hex(hex, fix_structure = FALSE, crs = NULL)
geos_write_hex(
geom,
include_z = TRUE,
include_srid = FALSE,
endian = 1,
flavor = c("extended", "iso")
)
geos_read_xy(point)
geos_write_xy(geom)
a character()
vector of well-known text
Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading.
An object that can be interpreted as a CRS. See wk::wk_crs()
.
Include the values of the Z and M coordinates and/or
SRID in the output?
Use FALSE
to omit, TRUE
to include, or NA
to
include only if present. Note that using TRUE
may result
in an error if there is no value present in the original.
The number of significant digits to include iin WKT output.
Trim unnecessary zeroes in the output?
A character()
vector fo GeoJSON features
The number of spaces to use when indenting a formatted version of the output. Use -1 to indicate no formatting.
A list()
of raw()
vectors (or NULL
representing
an NA
value).
0 for big endian or 1 for little endian.
One of "extended" (i.e., EWKB) or "iso".
A hexidecimal representation of well-known binary
A list()
representing points in the form list(x, y)
.
geos_read_wkt("POINT (30 10)")
#> <geos_geometry[1]>
#> [1] <POINT (30 10)>
geos_write_wkt(geos_read_wkt("POINT (30 10)"))
#> [1] "POINT (30 10)"