get_point: Create sfc Object from Coordinates or sf Object

View source: R/get_points.R

get_pointR Documentation

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)

## Default S3 method:
get_point(x)

## S3 method for class 'numeric'
get_point(x)

## S3 method for class 'matrix'
get_point(x)

## S3 method for class 'sf'
get_point(x)

## S3 method for class 'sfc'
get_point(x)

Arguments

x

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

Value

An sfc object with coordinates in EPSG:4326.

Examples

get_point(c(-122.201399,47.608678))

azuremapsr documentation built on Aug. 27, 2025, 5:11 p.m.