| Title: | A Collection of Useful R Functions for Spatial Data |
|---|---|
| Description: | Useful R functions developed at the Research Institute for Nature and Forest (INBO) for dealing with spatial raster or vector data. |
| Authors: | Hans Van Calster [aut, cre] (ORCID: <https://orcid.org/0000-0001-8595-8426>, affiliation: Research Institute for Nature and Forest (INBO)), Floris Vanderhaeghe [ctb] (ORCID: <https://orcid.org/0000-0002-6378-6229>, affiliation: Research Institute for Nature and Forest (INBO)), Falk Mielke [ctb] (ORCID: <https://orcid.org/0000-0003-3229-0981>, affiliation: Research Institute for Nature and Forest (INBO)), Research Institute for Nature and Forest (INBO) [cph, fnd] (ROR: <https://ror.org/00j54wy13>) |
| Maintainer: | Hans Van Calster <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-02 09:12:44 UTC |
| Source: | https://github.com/inbo/inbospatial |
The add_wms_*() functions are shorthand alternatives for a fully specified
leaflet::addWMSTiles() or leaflet.extras2::addWMS() statement.
Appropriate attribution is added to the Leaflet map depending on the layer.
add_wms_be_cartoweb( map, layer = c("topo", "topo_grey", "overlay", "crossborder"), options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_be_ortho( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_nl_ortho( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_grbmap( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_habitatmap( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 1200), add_wms_legend = FALSE, ... ) add_wms_fl_habitatlabels( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_forestnature( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 600), add_wms_legend = FALSE, ... ) add_wms_fl_agriculture( map, year, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 1200), add_wms_legend = FALSE, ... ) add_wms_nlnb_nnb( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 600), add_wms_legend = FALSE, ... ) add_wms_nlnb_natte_natuurparels( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_ambitie_landschapstypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_ambitie_natuurtypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_landschapstypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html", minZoom = 13), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_natuurtypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html", minZoom = 13), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... )add_wms_be_cartoweb( map, layer = c("topo", "topo_grey", "overlay", "crossborder"), options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_be_ortho( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_nl_ortho( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_grbmap( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_habitatmap( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 1200), add_wms_legend = FALSE, ... ) add_wms_fl_habitatlabels( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE), ... ) add_wms_fl_forestnature( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 600), add_wms_legend = FALSE, ... ) add_wms_fl_agriculture( map, year, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 1200), add_wms_legend = FALSE, ... ) add_wms_nlnb_nnb( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 600), add_wms_legend = FALSE, ... ) add_wms_nlnb_natte_natuurparels( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_ambitie_landschapstypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_ambitie_natuurtypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html"), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_landschapstypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html", minZoom = 13), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... ) add_wms_nlnb_natuurtypen( map, options = leaflet::WMSTileOptions(format = "image/png", transparent = TRUE, info_format = "text/html", minZoom = 13), popupOptions = leaflet::popupOptions(maxWidth = 2000), add_wms_legend = FALSE, ... )
map |
a map widget object created from |
layer |
String that defines which layer to use, if the function supports more than one. In such case, the available strings are shown in the Usage section. The first value is used if missing. |
options |
a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements |
... |
Further arguments passed to |
popupOptions |
A Vector of |
add_wms_legend |
Logical. Is a legend to be added for this WMS? Note that the legend cannot be toggled on and off in the map; it is plotted as a separate, static legend. |
year |
Year to be applied in selecting the WMS |
On condition that these functions continue being maintained, using the shorthand functions should make your scripts more futureproof.
A leaflet HTML widget object.
be_Belgium
fl_Flanders
nl_Netherlands
nlnb_Netherlands: Province 'Noord-Brabant'
_orthoOrthophotographs
_cartowebTopographic Cartoweb layers (Belgium)
_grbmapGRB basemap (Flanders; 'Grootschalig Referentiebestand')
_habitatmapNatura 2000 habitat types
_habitatlabelsNatura 2000 habitat type labels
_forestnaturePublic forest and nature areas managed by the Flemish Nature & Forest Agency
_agricultureParcels with the agricultural use in a specific year
_nnbNetherlands; 'Natuurnetwerk Brabant (Rijk en Provincie NNB)'
_natte_natuurparelsNetherlands; 'Natte natuurparels'
_ambitie_landschapstypenNetherlands; 'Natuurbeheerplan - Ambitiekaart Landschaptypen'
_ambitie_natuurtypenNetherlands; 'Natuurbeheerplan - Ambitiekaart Natuurtypen'
_landschapstypenNetherlands; 'Natuurbeheerplan - Beheertypenkaart_Landschaptypen'
_natuurtypenNetherlands; 'Natuurbeheerplan - Beheertypenkaart Natuurtypen'
Floris Vanderhaeghe, https://github.com/florisvdh
Other topics on using web services:
add_wmts_nl_brt(),
check_ogc_collection(),
get_coverage_wcs(),
get_feature_ogc(),
get_feature_wfs(),
get_wcs_layers()
library(leaflet) leaflet() |> setView(lng = 4.5, lat = 51.45, zoom = 11) |> add_wmts_nl_brt("grijs") |> add_wms_be_cartoweb("topo_grey") |> add_wms_fl_forestnature() |> add_wms_nlnb_nnb() # It can also use mapview objects, if you first extract the leaflet map slot: library(mapview) kmi_stations <- sf::read_sf( system.file("extdata/kmi_stations.geojson", package = "inbospatial") ) mapview(kmi_stations, map.types = "CartoDB.Positron")@map |> add_wms_be_cartoweb() # alternative syntax: ## Not run: mapview(kmi_stations, map.types = "CartoDB.Positron") |> _@map |> add_wms_be_cartoweb() ## End(Not run)library(leaflet) leaflet() |> setView(lng = 4.5, lat = 51.45, zoom = 11) |> add_wmts_nl_brt("grijs") |> add_wms_be_cartoweb("topo_grey") |> add_wms_fl_forestnature() |> add_wms_nlnb_nnb() # It can also use mapview objects, if you first extract the leaflet map slot: library(mapview) kmi_stations <- sf::read_sf( system.file("extdata/kmi_stations.geojson", package = "inbospatial") ) mapview(kmi_stations, map.types = "CartoDB.Positron")@map |> add_wms_be_cartoweb() # alternative syntax: ## Not run: mapview(kmi_stations, map.types = "CartoDB.Positron") |> _@map |> add_wms_be_cartoweb() ## End(Not run)
The add_wmts_*() functions are shorthand alternatives for a fully specified
leaflet::addTiles() statement.
Appropriate attribution is added to the Leaflet map depending on the layer.
add_wmts_nl_brt(map, layer = c("standaard", "grijs", "pastel", "water"), ...) add_wmts_nl_ortho(map, ...)add_wmts_nl_brt(map, layer = c("standaard", "grijs", "pastel", "water"), ...) add_wmts_nl_ortho(map, ...)
map |
a map widget object created from |
layer |
String that defines which layer to use, if the function supports more than one. In such case, the available strings are shown in the Usage section. The first value is used if missing. |
... |
Further arguments passed to |
On condition that these functions continue being maintained, using the shorthand functions should make your scripts more futureproof.
A leaflet HTML widget object.
be_Belgium
nl_Netherlands
_orthoOrthophotographs
_brtTopographic BRT layers (Netherlands; 'Basisregistratie Topografie')
Floris Vanderhaeghe, https://github.com/florisvdh
Other topics on using web services:
add_wms_be_cartoweb(),
check_ogc_collection(),
get_coverage_wcs(),
get_feature_ogc(),
get_feature_wfs(),
get_wcs_layers()
library(leaflet) leaflet() |> setView(lng = 5.5, lat = 52.5, zoom = 9) |> add_wmts_nl_brt() leaflet() |> setView(lng = 5.4, lat = 52.2, zoom = 14) |> add_wmts_nl_ortho()library(leaflet) leaflet() |> setView(lng = 5.5, lat = 52.5, zoom = 9) |> add_wmts_nl_brt() leaflet() |> setView(lng = 5.4, lat = 52.2, zoom = 14) |> add_wmts_nl_ortho()
A lightweight helper function that queries the /collections endpoint of an
OGC API using JSON. It verifies if a specified collection exists and provides
a helpful error message with valid names if it does not.
check_ogc_collection(url, collection)check_ogc_collection(url, collection)
url |
A character string with the base URL of the OGC API. |
collection |
A character string with the ID of the collection to check. |
TRUE invisibly if the collection exists, otherwise throws an error.
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
get_coverage_wcs(),
get_feature_ogc(),
get_feature_wfs(),
get_wcs_layers()
## Not run: api_url <- "https://geo.api.vlaanderen.be/Wegenregister/ogc/features/v1" check <- check_ogc_collection(api_url, "Wegsegment") check # An informative error is thrown when collection does not exist check <- try(check_ogc_collection(api_url, "foutieve_laag")) ## End(Not run)## Not run: api_url <- "https://geo.api.vlaanderen.be/Wegenregister/ogc/features/v1" check <- check_ogc_collection(api_url, "Wegsegment") check # An informative error is thrown when collection does not exist check <- try(check_ogc_collection(api_url, "foutieve_laag")) ## End(Not run)
The function sends a query to a WCS service, downloads it to a temporary file
from which it is read with terra::rast() - if needed reprojected -
and returned as a SpatRaster object
get_coverage_wcs( wcs = c("dtm", "dsm", "omz", "omw", "dhmv", "mercatornet"), bbox, layername, resolution, wcs_crs = c("EPSG:4258", "EPSG:31370"), output_crs = "EPSG:31370", bbox_crs = "EPSG:31370", version = c("1.0.0", "2.0.1"), ... )get_coverage_wcs( wcs = c("dtm", "dsm", "omz", "omw", "dhmv", "mercatornet"), bbox, layername, resolution, wcs_crs = c("EPSG:4258", "EPSG:31370"), output_crs = "EPSG:31370", bbox_crs = "EPSG:31370", version = c("1.0.0", "2.0.1"), ... )
wcs |
One of |
bbox |
An object of class bbox of length 4. |
layername |
Character string; name of the layer |
resolution |
Output resolution in meters |
wcs_crs |
Native CRS in which the raster layers are stored on the |
output_crs |
Output CRS. May involve reprojection. |
bbox_crs |
CRS in which bbox coordinates are passed |
version |
|
... |
Additional key-value pairs passed on to the |
The following WCS services can currently be used:
"omz": orthophotomosaic summer images Flanders
"omw": orthophotomosaic winter images Flanders
"dtm": digital terrain model Flanders
"dsm": digital surface model Flanders
"dhmv": digital elevation model Flanders (contains dtm and dsm data)
"mercatornet": Public Download Service Flemish Government -
department environment - cooperation MercatorNet
For more information, see metadata Vlaanderen:
https://metadata.vlaanderen.be/srv/eng/catalog.search#/search?any=WCS
A SpatRaster object
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
check_ogc_collection(),
get_feature_ogc(),
get_feature_wfs(),
get_wcs_layers()
## Not run: bbox <- sf::st_bbox( c(xmin = 155800, xmax = 155850, ymin = 132700, ymax = 132750), crs = sf::st_crs(31370) ) get_coverage_wcs( wcs = "dsm", bbox = bbox, layername = "EL.GridCoverage.DSM", resolution = 1 ) ## End(Not run)## Not run: bbox <- sf::st_bbox( c(xmin = 155800, xmax = 155850, ymin = 132700, ymax = 132750), crs = sf::st_crs(31370) ) get_coverage_wcs( wcs = "dsm", bbox = bbox, layername = "EL.GridCoverage.DSM", resolution = 1 ) ## End(Not run)
get_feature_ogc() provides a modern alternative to get_feature_wfs(). It
retrieves vector data from an OGC API Features service.
See https://ogcapi.ogc.org.
get_feature_ogc( url, collection, bbox = NULL, datetime = NULL, properties = NULL, cql_filter = NULL, limit = NULL, crs = NULL, quiet = TRUE, ... )get_feature_ogc( url, collection, bbox = NULL, datetime = NULL, properties = NULL, cql_filter = NULL, limit = NULL, crs = NULL, quiet = TRUE, ... )
url |
A character string with the base URL of the OGC API (the landing page). |
collection |
A character string with the ID of the collection (layer). |
bbox |
A bounding box to filter features. Can be a numeric vector of
length 4 ( |
datetime |
A character string representing a time instant or time
interval (e.g., |
properties |
A character vector of specific column names to return. |
cql_filter |
A character string containing a CQL2-text filter to apply attribute or complex spatial filtering on the server. See Common Query Language filter specifications. |
limit |
Numeric. Maximum number of features to retrieve. If |
crs |
Target Coordinate Reference System (CRS) as an EPSG code or CRS object. If provided, the output will be automatically transformed to this CRS. |
quiet |
Logical. Should the download progress be suppressed? Defaults to
|
... |
Additional name-value pairs passed on to |
An sf (simple feature) object.
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
check_ogc_collection(),
get_coverage_wcs(),
get_feature_wfs(),
get_wcs_layers()
## Not run: # Base URL for the Digitaal Vlaanderen Wegenregister (Road Register) api_url <- "https://geo.api.vlaanderen.be/Wegenregister/ogc/features/v1" # 1. Basic usage: Fetch 10 road segments roads_sample <- get_feature_ogc( url = api_url, collection = "Wegsegment", limit = 10 ) # 2. Spatial Filtering & CRS Transformation: # Fetch features within a WGS84 bounding box and project to Belgian Lambert72 my_bbox <- sf::st_bbox( c(xmin = 4.39, ymin = 51.21, xmax = 4.40, ymax = 51.22), crs = sf::st_crs(4326) ) roads_bbox <- get_feature_ogc( url = api_url, collection = "Wegsegment", bbox = my_bbox, crs = 31370 ) # Base URL for Historical Land Use (Ferraris map) hist_url <- "https://geo.api.vlaanderen.be/HistLandgebruik/ogc/features/v1" # 3. Attribute Selection: # Fetch only specific columns ferraris_lite <- get_feature_ogc( url = hist_url, collection = "Lgbrk1778", limit = 100, properties = c("KLASSE") ) # 4. Advanced CQL2 Attribute Filtering: # Filter features directly on the server roads_filtered <- get_feature_ogc( url = api_url, collection = "Wegsegment", limit = 50, cql_filter = "morfologischeWegklasse = 'dienstweg'" ) ## End(Not run)## Not run: # Base URL for the Digitaal Vlaanderen Wegenregister (Road Register) api_url <- "https://geo.api.vlaanderen.be/Wegenregister/ogc/features/v1" # 1. Basic usage: Fetch 10 road segments roads_sample <- get_feature_ogc( url = api_url, collection = "Wegsegment", limit = 10 ) # 2. Spatial Filtering & CRS Transformation: # Fetch features within a WGS84 bounding box and project to Belgian Lambert72 my_bbox <- sf::st_bbox( c(xmin = 4.39, ymin = 51.21, xmax = 4.40, ymax = 51.22), crs = sf::st_crs(4326) ) roads_bbox <- get_feature_ogc( url = api_url, collection = "Wegsegment", bbox = my_bbox, crs = 31370 ) # Base URL for Historical Land Use (Ferraris map) hist_url <- "https://geo.api.vlaanderen.be/HistLandgebruik/ogc/features/v1" # 3. Attribute Selection: # Fetch only specific columns ferraris_lite <- get_feature_ogc( url = hist_url, collection = "Lgbrk1778", limit = 100, properties = c("KLASSE") ) # 4. Advanced CQL2 Attribute Filtering: # Filter features directly on the server roads_filtered <- get_feature_ogc( url = api_url, collection = "Wegsegment", limit = 50, cql_filter = "morfologischeWegklasse = 'dienstweg'" ) ## End(Not run)
This function constructs a URL request from its arguments and either reads
in the resulting vector layer as a sf object or returns the number of
features that are requested.
The request is made up of key-value pairs and additional key-value pairs can
be passed to the function.
The full documentation for the WFS standard can be consulted from
https://www.ogc.org/standards/wfs/.
get_feature_wfs( wfs, version = "2.0.0", layername = NULL, crs = NULL, bbox = NULL, filter = NULL, cql_filter = NULL, output_format = NULL, property_name = NULL, result_type = c("results", "hits"), ... )get_feature_wfs( wfs, version = "2.0.0", layername = NULL, crs = NULL, bbox = NULL, filter = NULL, cql_filter = NULL, output_format = NULL, property_name = NULL, result_type = c("results", "hits"), ... )
wfs |
Web address for the service which you want to query features from |
version |
Version number for the service.
For instance |
layername |
Optional name of a layer hosted by the web feature service |
crs |
Optional coordinate reference system to represent the features.
For instance |
bbox |
Optional bounding box.
Pass this as a named vector with names |
filter |
Optional standard OGC filter specification |
cql_filter |
Optional
Common Query Language
filter.
This currently only works if the |
output_format |
Optional output format supported by the |
property_name |
Optional character string.
Which fields or columns to return?
If you want to specify multiple columns, separate them by a comma.
The column containing the feature geometry is usually called |
result_type |
For version |
... |
Additional key-value pairs passed on to the WFS query. |
See https://tutorials.inbo.be/tutorials/spatial_wfs_services/ for more information.
An sf (simple feature) object.
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
check_ogc_collection(),
get_coverage_wcs(),
get_feature_ogc(),
get_wcs_layers()
## Not run: vlaanderen <- get_feature_wfs( wfs = paste0( "https://eservices.minfin.fgov.be/", "arcgis/services/R2C/Regions/MapServer/WFSServer" ), layername = "regions", crs = "EPSG:31370", filter = paste0( "<Filter><PropertyIsEqualTo><PropertyName>", "regions:NameDUT</PropertyName><Literal>'Vlaams Gewest'", "</Literal></PropertyIsEqualTo></Filter>" ) ) ## End(Not run)## Not run: vlaanderen <- get_feature_wfs( wfs = paste0( "https://eservices.minfin.fgov.be/", "arcgis/services/R2C/Regions/MapServer/WFSServer" ), layername = "regions", crs = "EPSG:31370", filter = paste0( "<Filter><PropertyIsEqualTo><PropertyName>", "regions:NameDUT</PropertyName><Literal>'Vlaams Gewest'", "</Literal></PropertyIsEqualTo></Filter>" ) ) ## End(Not run)
The function sends a GetCapabilities query to a WCS service,
parses the XML response, and returns a data.frame containing
the names of the available layers and their descriptions.
get_wcs_layers( wcs = c("dtm", "dsm", "omz", "omw", "dhmv", "mercatornet"), version = c("1.0.0", "2.0.1"), ... )get_wcs_layers( wcs = c("dtm", "dsm", "omz", "omw", "dhmv", "mercatornet"), version = c("1.0.0", "2.0.1"), ... )
wcs |
One of |
version |
|
... |
Additional key-value pairs passed on to the |
The following WCS services can currently be used:
"omz": orthophotomosaic summer images Flanders
"omw": orthophotomosaic winter images Flanders
"dtm": digital terrain model Flanders
"dsm": digital surface model Flanders
"dhmv": digital elevation model Flanders (contains dtm and dsm data)
"mercatornet": Public Download Service Flemish Government -
department environment - cooperation MercatorNet
For more information, see metadata Vlaanderen:
https://metadata.vlaanderen.be/srv/eng/catalog.search#/search?any=WCS
A data.frame object with columns layername and description.
Other topics on using web services:
add_wms_be_cartoweb(),
add_wmts_nl_brt(),
check_ogc_collection(),
get_coverage_wcs(),
get_feature_ogc(),
get_feature_wfs()
## Not run: get_wcs_layers(wcs = "dsm") get_wcs_layers(wcs = "omz", version = "2.0.1") ## End(Not run)## Not run: get_wcs_layers(wcs = "dsm") get_wcs_layers(wcs = "omz", version = "2.0.1") ## End(Not run)
The scale factor is the distance distortion. In this case (a conic conformal projection) it holds in any direction.
scalefactor_lcc(par_deg, par1_deg, par2_deg)scalefactor_lcc(par_deg, par1_deg, par2_deg)
par_deg |
Numeric vector. The latitude in decimal degrees of one or more parallels for which to do the calculation. |
par1_deg |
Latitude of the first standard parallel of the LCC projection in decimal degrees. |
par2_deg |
Latitude of the second standard parallel of the LCC projection in decimal degrees. |
The function applies to normal LCC projections, not the oblique ones. The applied formulas are for the sphere, hence approximate.
Numeric vector, same length as par_deg.
Floris Vanderhaeghe, https://github.com/florisvdh
Snyder J.P. (1987). Map Projections - A Working Manual. U.S. Geological Survey Professional Paper, Nr. 1395. United States Government Printing Office, Washington, 397 p.
Other functions to explore properties of coordinate reference systems:
scalefactor_tcyl()
sf::st_crs(31370) x <- seq(49.5, 52.5, 0.1) y <- scalefactor_lcc(x, 51.1666672333333, 49.8333339) data.frame(latitude = x, scalefactor = y)sf::st_crs(31370) x <- seq(49.5, 52.5, 0.1) y <- scalefactor_lcc(x, 51.1666672333333, 49.8333339) data.frame(latitude = x, scalefactor = y)
The scale factor is the distance distortion in the direction of the meridians. In the case of the Transverse Mercator projection (a cylindrical conformal projection) it holds in any direction.
scalefactor_tcyl(ang_dist)scalefactor_tcyl(ang_dist)
ang_dist |
Numeric vector. One or more angular distances from the central meridian, in decimal degrees. |
The formulas applied are for the sphere, hence approximate.
The best known map projection system in this context is the Universal Transverse Mercator (UTM), which superposes a central meridian scale factor of 0.9996.
Numeric vector, same length as ang_dist.
Floris Vanderhaeghe, https://github.com/florisvdh
Iliffe J. & Lott R. (2008). Datums and Map Projections. For Remote Sensing, GIS and Surveying. 2nd edn. Whittles Publishing, Caithness, UK, 208 p.
Other functions to explore properties of coordinate reference systems:
scalefactor_lcc()
x <- seq(0, 3, 0.1) y <- scalefactor_tcyl(x) data.frame(ang_dist = x, scalefactor = y)x <- seq(0, 3, 0.1) y <- scalefactor_tcyl(x) data.frame(ang_dist = x, scalefactor = y)