This function launches an interactive application that let the user place areas of a study on a map. the GPS coordinates of the areas are then returned and can be used in functions. This function should be used only once per study. The result should then be saved in an external file and be reused.

mapLayout(
  layout,
  what = c("areas", "districts"),
  map = getSpMaps(),
  map_builder = TRUE
)

Arguments

layout

object returned by function [antaresRead::readLayout()]

what

Either "areas" or "districts". Indicates what type of object to place on the map.

map

An optional [sp::SpatialPolygons()] or [sp::SpatialPolygonsDataFrame()] object. See [spMaps::getSpMaps()]

map_builder

logical Add inputs for build custom map ? Defaut to TRUE.

Value

An object of class mapLayout.

Details

With map_builder option, you can build a quiet custom map using spMaps package. This package help you to build [sp::SpatialPolygons()] on Europe. Moreover, you can use two options in the module :

  • "Merge countries" : Some countries like UK or Belgium are firstly rendered in multiple and diffrent area. You can so choose to finally use this countries as one single area on the map

  • "Merge states" : If you need states details but not having one area per state, the map will be incomplete for some countries, plotting only states with area. So you can choose to aggregate the states of the countries. This is done using a nearest states algorithm. The result is available only after layout validation.

See also

[plotMapLayout()]

Examples

if (FALSE) {
# Read the coordinates of the areas in the Antares interface, then convert it
# in a map layout.
layout <- readLayout()
ml <- mapLayout(layout)

# visualize mapLayout
plotMapLayout(ml)

# Save the result for future use
save(ml, file = "ml.rda")

}