coordinates_to_geometry {geodimension} | R Documentation |
Transform coordinates to point geometry
Description
From the coordinates defined in fields such as latitude and longitude, it returns a layer of points.
Usage
coordinates_to_geometry(table, lon_lat = c("intptlon", "intptlat"), crs = 4326)
Arguments
table |
A |
lon_lat |
A vector, name of longitude and latitude attributes. |
crs |
A coordinate reference system: integer with the EPSG code, or character with proj4string. |
Details
If we start from a geographic layer, it initially transforms it into a table.
The CRS of the new layer is indicated. By default, it considers 4326 (WGS84).
Value
A sf
object.
See Also
Other geolevel definition functions:
add_geometry()
,
check_key()
,
complete_point_geometry()
,
geolevel()
,
get_empty_geometry_instances()
,
get_geometry()
Examples
layer_us_county <-
dplyr::inner_join(
get_level_data_geo(gd_us, "county"),
get_level_layer(gd_us, "county"),
by = c("geoid", "statefp", "name", "type")
) |>
sf::st_as_sf()
us_county_point <-
coordinates_to_geometry(layer_us_county,
lon_lat = c("intptlon", "intptlat"))
[Package geodimension version 2.0.0 Index]