Skip to contents

Use this function to convert the coordinates of a sf polygon object to a string of well known text. The output can be passed to an ArcGIS REST API to perform a spatial query.

Usage

format_polygon_coords(sf_obj)

format_line_coords(sf_obj)

format_multipoint_coords(sf_obj)

format_point_coords(sf_obj)

format_envelope_coords(sf_obj)

format_coords(sf_obj, geom_type)

Arguments

sf_obj

An sf object

geom_type

Either "points", "paths", or "rings". Choose wisely

Value

String of well known text

Details

Spatial queries from an ArcGIS REST API require specific text inputs formatted in a way called well-known text (WKT). ArcGIS REST APIs have their own syntax for how the text is taken. These functions will format sf objects in the correct way to be able to make spatial queries from a ArcGIS REST API

Examples

mke_polygon_coords <- format_polygon_coords(mke_county)