Learn R Programming

azuremapsr (version 0.0.2)

get_point: Create sfc Object from Coordinates or sf Object

Description

Converts a pair of coordinates, a matrix of coordinates, or an sf POINT object into an sfc object for use in GeoJSON bodies.

Usage

get_point(x)

# S3 method for default get_point(x)

# S3 method for numeric get_point(x)

# S3 method for matrix get_point(x)

# S3 method for sf get_point(x)

# S3 method for sfc get_point(x)

Value

An sfc object with coordinates in EPSG:4326.

Arguments

x

A numeric vector of length 2, a matrix with coordinates, or an sf object of POINT type.

Examples

Run this code
get_point(c(-122.201399,47.608678))

Run the code above in your browser using DataLab