Note that geos_x(), geos_y(), and geos_z() do not handle empty points (use geos_write_xy() if you need to handle this case). Similarly, the min/max functions will error on empty geometries.

geos_area(geom)

geos_length(geom)

geos_x(geom)

geos_y(geom)

geos_z(geom)

geos_xmin(geom)

geos_ymin(geom)

geos_xmax(geom)

geos_ymax(geom)

geos_minimum_clearance(geom)

geos_is_empty(geom)

geos_is_simple(geom)

geos_is_ring(geom)

geos_has_z(geom)

geos_is_closed(geom)

geos_type_id(geom)

geos_type(geom)

geos_precision(geom)

geos_srid(geom)

geos_num_coordinates(geom)

geos_num_geometries(geom)

geos_num_interior_rings(geom)

geos_num_rings(geom)

geos_dimension(geom)

geos_coordinate_dimension(geom)

geos_is_clockwise(geom)

geos_hilbert_code(geom, extent = wk::wk_bbox(geom), level = 15)

Arguments

geom

A GEOS geometry vector

extent

A geometry describing the extent of geom within which Hilbert codes should be computed. Defaults to wk::wk_bbox() of geom.

level

The Hilbert level of precision (between 0 and 15).

Value

A vector of length geom

Examples

geos_area("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")
#> [1] 100
geos_length("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")
#> [1] 40
geos_x("POINT Z (1 2 3)")
#> [1] 1
geos_y("POINT Z (1 2 3)")
#> [1] 2
geos_z("POINT Z (1 2 3)")
#> [1] 3
geos_xmin("LINESTRING (0 1, 2 3)")
#> [1] 0
geos_ymin("LINESTRING (0 1, 2 3)")
#> [1] 1
geos_xmax("LINESTRING (0 1, 2 3)")
#> [1] 2
geos_ymax("LINESTRING (0 1, 2 3)")
#> [1] 3
geos_minimum_clearance("POLYGON ((0 0, 10 0, 10 10, 3 5, 0 10, 0 0))")
#> [1] 3

geos_is_empty(c("POINT EMPTY", "POINT (0 1)"))
#> [1]  TRUE FALSE
geos_is_simple(c("LINESTRING (0 0, 1 1)", "LINESTRING (0 0, 1 1, 1 0, 0 1)"))
#> [1]  TRUE FALSE
geos_is_ring(
  c(
    "LINESTRING (0 0, 1 0, 1 1, 0 1, 0 0)",
    "LINESTRING (0 0, 1 0, 1 1, 0 1)"
   )
)
#> [1]  TRUE FALSE
geos_is_closed(
  c(
    "LINESTRING (0 0, 1 0, 1 1, 0 1, 0 0)",
    "LINESTRING (0 0, 1 0, 1 1, 0 1)"
   )
)
#> [1]  TRUE FALSE
geos_has_z(c("POINT Z (1 2 3)", "POINT (1 2)"))
#> [1]  TRUE FALSE

geos_type_id(c("POINT (0 0)", "LINESTRING (0 0, 1 1)"))
#> [1] 1 2
geos_srid(wk::as_wkb(c("SRID=1234;POINT (0 0)", "POINT (0 0)")))
#> [1] 1234    0
geos_num_coordinates(c("POINT (0 0)", "MULTIPOINT (0 0, 1 1)"))
#> [1] 1 2
geos_num_geometries(c("POINT (0 0)", "MULTIPOINT (0 0, 1 1)"))
#> [1] 1 2
geos_num_interior_rings("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))")
#> [1] 0
geos_dimension(c("POINT (0 0)", "LINESTRING (0 0, 1 1)"))
#> [1] 0 1
geos_coordinate_dimension(c("POINT (0 0)", "POINT Z (0 0 1)"))
#> [1] 2 3