Skip to contents

From the coordinates defined in fields such as latitude and longitude, it returns a layer of points.

Usage

coordinates_to_point(table, lon_lat = c("intptlon", "intptlat"), crs = NULL)

Arguments

table

A tibble object.

lon_lat

A vector, name of longitude and latitude attributes.

crs

A coordinate reference system: integer with the EPSG code, or character with proj4string.

Value

A sf object.

Details

If we start from a geographic layer, it initially transforms it into a table.

The CRS of the new layer is indicated. If a CRS is not indicated, it considers the layer's CRS by default and, if it is not a layer, it considers 4326 CRS (WGS84).

Examples


us_state_point <-
  coordinates_to_point(us_layer_state,
                       lon_lat = c("INTPTLON", "INTPTLAT"))