guess_crs: Take a dataset and plot in different coordinate reference...

View source: R/guess_crs.R

guess_crsR Documentation

Take a dataset and plot in different coordinate reference systems (CRS) on a leaflet map to check the expected CRS

Description

When retrieving a number of data-points, but the kind of CRS is not provided/known (for any reason), this utility plots the data for different CRS on a map to make comparison possible. The main function is guess_crs which creates the map with different options. Custom projections can be provided by the user as well.

Usage

guess_crs(
  df,
  col_x,
  col_y,
  belgium = TRUE,
  crs_try = c("EPSG:4326", "EPSG:31370", "EPSG:28992", "EPSG:32631", "EPSG:3812",
    "EPSG:3035")
)

Arguments

df

data.frame with a x and y coordinate column

col_x

(character) name of the x (longitude) column

col_y

(character) name of the y (latitude) column

belgium

(logical) If TRUE, coordinates are expected to be in Belgium

crs_try

(list) EPSG codes of the different CRS to evaluate By default, the following six CRS are added to the map:

  • "EPSG:4326"WGS 84, https://spatialreference.org/ref/epsg/wgs-84/

  • "EPSG:31370"Belge 1972/Belgian Lambert 72, https://spatialreference.org/ref/epsg/31370/

  • "EPSG:28992"Amersfoort/Rijksdriehoek nieuw, https://spatialreference.org/ref/epsg/28992/

  • "EPSG:32631"WGS 84 / UTM zone 31N, https://spatialreference.org/ref/epsg/32631/

  • "EPSG:3812"ETRS89/Belgian Lambert 2008, https://spatialreference.org/ref/epsg/3812/

  • "EPSG:3035"ETRS89 / ETRS-LAEA, https://spatialreference.org/ref/epsg/3035/

Details

For each of the given CRS, the coordinates columns are given the the specified CRS In a next step, these CRS are converted to wgs84 and plotted on a openstreetmap background with leaflet. The interactive map provides the possibility to select/unselect specific layers.

See Also

crsuggest::guess_crs() for a (better) alternative

Other GIS_utilities: plot_coordinates_on_map(), transform_coordinates()

Examples

## Not run: 
guess_crs(data, "x", "y")

## End(Not run)


inbo/inborutils documentation built on Nov. 23, 2023, 4:42 a.m.