Skip to contents

This function sets the map provider based on the specified provider alias. It retrieves the corresponding provider and attribution information from an internal database of available background map providers.

Usage

set_provider(alias, attribution = TRUE)

Arguments

alias

character specifying the alias of the map provider to use. Admissible values are "ign_ortho" and "ign_plan". See details

attribution

logical. Should the attribution information also be provided? defaults to TRUE.

Value

A list or character vector:

  • If attribution is TRUE, returns a list containing the provider and attribution

  • If attribution is FALSE, returns a character vector containing the provider.

Details

If no provider is specified, the function issues a warning and sets provider = "ign_ortho" by default. Available aliases are:

  • "ign_ortho": Orthophotos from IGN (Institut national de l'information géographique et forestière)

  • "ign_plan": Plan IGN v2 (Cartographie multi-échelles sur le territoire national français de l'Institut national de l'information géographique et forestière)

  • "ign_parcellaire": cadastral plots from IGN (Cartographie parcellaire cadastral multi-échelles sur le territoire national français de l'Institut national de l'information géographique et forestière)

  • "ign_3d": IGN's 3D representation using shading derived from MNH LiDAR HD ( estompage issu du MNH LiDAR HD de l'Institut national de l'information géographique et forestière)

  • "ign_building": BD TOPO® V3 - Buildings layer (BD TOPO® V3 - Bâtiments de l'Institut national de l'information géographique et forestière)

  • "ign_rpg": French land parcel identification system (RPG Dernière édition de l'Institut national de l'information géographique et forestière)

  • "ign_aoc_viti": IGN's AOC wine region boundaries (délimitations parcellaires AOC viticoles (INAO) de l'Institut national de l'information géographique et forestière)

Examples


# issues warning and returns provider "ign_ortho" and attribution information
set_provider() 
#> Warning: Provider alias missing. Please see documentation.
#> Choosing 'ign_ortho' by default
#> $provider
#> [1] "https://data.geopf.fr/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/jpeg&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
#> 
#> $attribution
#> [1] "IGN-F/Geoportail"
#> 

# returns provider "ign_ortho" and attribution information without warning
set_provider("ign_ortho")
#> $provider
#> [1] "https://data.geopf.fr/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/jpeg&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
#> 
#> $attribution
#> [1] "IGN-F/Geoportail"
#> 

# Sets the provider to "ign_plan" and returns only the provider
set_provider("ign_plan", attribution = FALSE)  
#> [1] "https://data.geopf.fr/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE=normal&TILEMATRIXSET=PM&FORMAT=image/png&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"