Learn R Programming

geos (version 0.2.4)

geos_empty: Create empty geometries

Description

Create empty geometries

Usage

geos_empty(type_id = "geometrycollection", crs = wk::wk_crs_inherit())

as_geos_type_id(type_id)

# S3 method for default as_geos_type_id(type_id)

# S3 method for character as_geos_type_id(type_id)

# S3 method for numeric as_geos_type_id(type_id)

Value

A GEOS geometry vector.

Arguments

type_id

The numeric type identifier for which an empty should be returned, an object from which one can be extracted using as_geos_type_id() (default to calling geos_type_id()). This is most usefully a character vector with the geometry type (e.g., point, linestring, polygon).

crs

An object that can be interpreted as a CRS. See wk::wk_crs().

Examples

Run this code
geos_empty(c("point", "linestring", "polygon"))
geos_empty(1:7)
geos_empty(geos_read_wkt(c("POINT (0 1)", "LINESTRING (0 0, 1 1)")))

Run the code above in your browser using DataLab