Provides an abbreviated version of the well-known text representation of a geometry. This returns a constant number of coordinates for each geometry, so is safe to use for geometry vectors with many (potentially large) features.

wkb_format(wkb, max_coords = 3, precision = 6, trim = TRUE)

wkt_format(wkt, max_coords = 3, precision = 6, trim = TRUE)

Arguments

wkb

A list() of raw() vectors, such as that returned by sf::st_as_binary().

max_coords

The maximum number of coordinates to include in the output.

precision

The rounding precision to use when writing (number of decimal places).

trim

Trim unnecessary zeroes in the output?

wkt

A character vector containing well-known text.

Value

A character vector of abbreviated well-known text.

Examples

wkt_format("MULTIPOLYGON (((0 0, 10 0, 0 10, 0 0)))")
#> [1] "MULTIPOLYGON (((0 0, 10 0, 0 10..."
wkb_format( wkt_translate_wkb( "MULTIPOLYGON (((0 0, 10 0, 0 10, 0 0)))" ) )
#> [1] "MULTIPOLYGON (((0 0, 10 0, 0 10..."