R/guess_crs.R
guess_crs.RdWhen 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.
guess_crs(
df,
col_x,
col_y,
belgium = TRUE,
crs_try = c("EPSG:4326", "EPSG:31370", "EPSG:28992", "EPSG:32631", "EPSG:3812",
"EPSG:3035")
)data.frame with a x and y coordinate column
(character) name of the x (longitude) column
(character) name of the y (latitude) column
(logical) If TRUE, coordinates are expected to be in Belgium
(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/
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.
crsuggest::guess_crs() for a (better) alternative
Other GIS_utilities:
plot_coordinates_on_map(),
transform_coordinates()
if (FALSE) {
guess_crs(data, "x", "y")
}