Skip to contents

This function takes an sf polygon object, ensures that the polygon is in counterclockwise winding order, and returns the WKT (Well-Known Text) representation of the polygon.

Usage

get_wkt(sf_obj)

Arguments

sf_obj

An sf object containing a polygon geometry.

Value

A WKT string representing the polygon in counterclockwise winding order.

Examples

get_wkt(bbox_danube_basin)
#> [1] "POLYGON ((8 51, 8 42, 30 42, 30 51, 8 51))"