Package 'pruatlas'

Title: The Atlas and Utilities for PRU Maps
Description: A set of utilities for creation of map as used in PRU documents and portal.
Authors: Enrico Spinielli [aut, cre] , EUROCONTROL [cph, fnd]
Maintainer: Enrico Spinielli <[email protected]>
License: GPL-2 | MIT + file LICENSE
Version: 0.0.1.9000
Built: 2024-09-09 04:56:50 UTC
Source: https://github.com/euctrl-pru/pruatlas

Help Index


ACE ANSPs for AIRAC 406 and 481.

Description

A dataset containing the definition of the ANSPs as used in the ACE Benchmarking Report.

Usage

ansps_ace_406

Format

A Simple Feature dataset with airspace definitions for ANSPs:

airac_cfmu

the AIRAC cycle number in CFMU format

id

the ID for the ANSP

name

the name of the ANSP

ace_code

the code of the ANSP used in ACE

min_fl

the minimum flight level of the ANSP

max_fl

the maximum flight level of the ANSP

airspace_type

the type of the airspace (ANSP)

geometry

the Simple Feature describing the ANSP

Source

https://github.com/euctrl-pru/eurocontrol-atlas


Provide base country layer for PRU maps.

Description

Provide base country layer for PRU maps.

Usage

base_map(
  colour_sea = "#D8F4FF",
  colour_land = "grey89",
  colour_border = "#A9A9A9",
  colour_graticule = "#D3D3D3",
  colour_backgroud = "#f5f5f2",
  border_size = 0.2
)

Arguments

colour_sea

colour of the sea

colour_land

colour of the land

colour_border

colour of the country border

colour_graticule

colour of the graticule

colour_backgroud

background colour

border_size

thickness of the border line

Value

a ggplot2 object with world countries in LAEA projection.

Examples

## Not run: 
library(pruatlas)
# Plot a world map in LAEA projection.
bm <- base_map()

## End(Not run)

World countries at 50m scale.

Description

A dataset containing the definition of the world countries.

Usage

countries50m

Format

A Simple Feature dataset with 240 countries and 4 variables:

iso_a3

ISO 3166-1 alpha-3 three-letter country code

iso_n3

ISO 3166-1 numeric three digits country code

admin

Country's English short name according to ISO 3166

geometry

the Simple Feature describing the country

Source

https://github.com/euctrl-pru/eurocontrol-atlas


Extract ANSP polygon at defined flight level

Description

Extract ANSP polygon at defined flight level

Usage

country_ansp(ansps, ansp_id = "ENAV", fl = 300)

Arguments

ansps

the sf holding the ANSP polygons, i.e. pruatlas::ansps_ace_406

ansp_id

optional, the ANSP ID of the relevant country, "ENAV" otherwise. It can be a regular expression, i.e. "DFS|ENAV" for matching Germany and Italy.

fl

the flight level of interest

Value

a polygon for the ANSP(s)

Examples

## Not run: 
country_ansp(ansps_ace_406, "DFS", fl = 350)

# more complicated for Italy/ENAV: there is a hole over Rome.
# if we want to get rid of it we can use smoothr::fill_holes()
enav <- pruatlas::ansps_ace_406 %>%
  country_ansp(ansp_id = "ENAV", fl = 355) %>%
  smoothr::fill_holes(units::set_units(10000, km^2))

## End(Not run)

Return the country FIR for a EUROCONTROL's Member State.

Description

Return the country FIR for a EUROCONTROL's Member State.

Usage

country_fir(firs, icao_id = "LI", fl = 0, merge = TRUE, exclude = NULL)

Arguments

firs

the relevant NM FIRs.

icao_id

optional, the ICAO ID of the relevant country, "LI" otherwise. It can be a regular expression, i.e. "LI|LF" for matching France and Italy.

fl

flight level at which assemble the composing polygons.

merge

Do you want to merge? (Default: TRUE).

exclude

List of IDs to filter out. It can be useful to use when only continental portion of FIR is of interest, i.e. exclude SANTA MARIA FIR for Portugal.

Value

An Simple Feature for the relevant country FIR.

Examples

## Not run: 
# France
country_fir(pruatlas::firs_nm_406, "LF")
# EUROCONTROL's Member States
country_fir(pruatlas::firs_nm_406, icao_id = "E.|L.|UD|UG|GM|UK|GC")
# Consider only continental portion of Portugal FIR
country_fir(pruatlas::firs_nm_406, icao_id = "LP", exclude = c("LPPOFIR"))

## End(Not run)

STATFOR ECAC North East region

Description

STATFOR ECAC North East region

Usage

ecac_northeast(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC North East region

Examples

## Not run: 
ecac_northeast()

## End(Not run)

STATFOR ECAC North West region

Description

STATFOR ECAC North West region

Usage

ecac_northwest(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC North West region

Examples

## Not run: 
ecac_northwest()

## End(Not run)

STATFOR ECAC Oceanic region

Description

STATFOR ECAC Oceanic region

Usage

ecac_oceanic(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC Oceanic region

Examples

## Not run: 
ecac_oceanic()

## End(Not run)

STATFOR ECAC region

Description

STATFOR ECAC region

Usage

ecac_region(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC region

Examples

## Not run: 
ecac_region()

## End(Not run)

STATFOR ECAC South East region

Description

STATFOR ECAC South East region

Usage

ecac_southeast(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC South East region

Examples

## Not run: 
ecac_southeast()

## End(Not run)

STATFOR ECAC South West region

Description

STATFOR ECAC South West region

Usage

ecac_southwest(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR ECAC South West region

Examples

## Not run: 
ecac_southhwest()

## End(Not run)

Return the extent of a set of FIRs.

Description

Return the extent of a set of FIRs.

Usage

extent_fir(firs, crs)

Arguments

firs

the relevant NM FIRs.

crs

the proj projection string.

Value

A data frame of the extent of the input data.

Examples

## Not run: 
crs <- sf::st_crs(3035)
extent_fir(firs_nm_406, crs)

## End(Not run)

NM FIRs for AIRAC 406.

Description

A dataset containing the definition of the FIRs as used by the Network Manager.

Usage

firs_nm_406

Format

A Simple Feature dataset with 111 FIRs and 9 variables:

airac_cfmu

the AIRAC cycle number in CFMU format

icao

the ICAO region code for the FIR

id

the ID for the FIR

min_fl

the minimum flight level of the FIR

max_fl

the maximum flight level of the FIR

name

the name of the FIR

airspace_type

the type of the airspace (FIR)

geometry

the Simple Feature describing the FIR


NM FIRs for AIRAC 481.

Description

A dataset containing the definition of the FIRs as used by the Network Manager.

Usage

firs_nm_481

Format

A Simple Feature dataset with 111 FIRs and 9 variables:

airac_cfmu

the AIRAC cycle number in CFMU format

icao

the ICAO region code for the FIR

id

the ID for the FIR

min_fl

the minimum flight level of the FIR

max_fl

the maximum flight level of the FIR

name

the name of the FIR

airspace_type

the type of the airspace (FIR)

geometry

the Simple Feature describing the FIR


EUROCONTROL's Member States

Description

A data frame with the following fields

name

the country name, e.g. "Italy"

iso3c

the 3-letter ISO code, e.g. "ITA"

iso2c

the 2-letter ISO code, e.g. "IT"

icao

the 2-letter ICAO code, e.g. "LI"

iso3n

the 3-digits ISO code, e.g. "380"

date

the date of status code, e.g. 1996-04-01

status

the status code, e.g. "M" (M Member State, C Comprehensive Agreement State, T Transitional State)

These are useful to grab the right spatial polygons in case of need. Note: Kosovo is also included in the list.

Usage

member_states

Format

An object of class tbl_df (inherits from tbl, data.frame) with 45 rows and 7 columns.


STATFOR North Atlantic region

Description

STATFOR North Atlantic region

Usage

north_atlantic(firs = pruatlas::firs_nm_406)

Arguments

firs

the global FIRs

Value

the FIR-based STATFOR North Atlantic

Examples

## Not run: 
north_atlantic()

## End(Not run)

Parse CRCO Airspace Charging Zone format

Description

parse_airspace_crco reads the airspace CRCO format and returns a tibble where each row describes an airspace. The airspace file can be found on EUROCONTROL website.

Each airspace in CRCO format is described by:

  1. Airspace description (one row):

    • nb_point the number of points

    • latitude the latitude (of the label)

    • longitude the longitude (of the label)

    • flights

    • bottom_level low level of the volume (flight level)

    • top_level high level of the volume (flight level)

    • surface

    • sector_num

    • ⁠flight time⁠

    • ⁠traffic density⁠

    • ⁠x mileage⁠

    • ⁠rte extens.⁠

    • ⁠value 1⁠

    • ⁠value 2⁠

    • name airspace name/code

  2. latitude longitude: coordinates (nb_point rows in minutes decimal)

Usage

parse_airspace_crco(lines)

Arguments

lines

text lines of the PRISME airspace representation

Value

a tibble of airspaces (CRS = 4326)

Examples

## Not run: 
bo <- system.file("extdata", "sbm_bz_20200527.txt", package = "pruatlas")
crco <- readr::read_lines(bo) %>%
  parse_airspace_crco()

## End(Not run)

Plot country and relevant ANSP.

Description

Plot country and relevant ANSP.

Usage

plot_country_ansp(
  ansp_id,
  name,
  fl = 300,
  buffer = 100,
  ansps = pruatlas::ansps_ace_406
)

Arguments

ansp_id

optional, the ANSP ID of the relevant country, "ENAV" otherwise. It can be a regular expression, i.e. "DFS|ENAV" for matching Germany and Italy.

name

The name used to title the plot.

fl

the flight level of interest

buffer

Buffer around ANSP (km)

ansps

the sf holding the ANSP polygons, i.e. pruatlas::ansps_ace_406

Value

A ggplot object with country and relevant ANSP.

Examples

## Not run: 
plot_country_ansp("DFS", "Germany")
# Italy'ENAV has a hole above Rome...
plot_country_ansp("ENAV", "Italy (hole over Rome)")
# ...filling the hole, manually
enav <- pruatlas::ansps_ace_406 %>%
  country_ansp(ansp_id = "ENAV", fl = 355) %>%
  dplyr::mutate(min_fl = 355, max_fl = 355, id = "ENAV") %>%
  smoothr::fill_holes(units::set_units(10000, km^2))
plot_country_ansp(ansp_id = "ENAV", name = "Italy", fl = 355, ansps = enav)

## End(Not run)

Plot country and relevant FIR.

Description

Plot country and relevant FIR.

Usage

plot_country_fir(
  icao_id,
  name,
  fl = 0,
  buffer = 100,
  firs = pruatlas::firs_nm_406,
  merge = TRUE
)

Arguments

icao_id

optional, the ICAO ID of the relevant country, "LI" otherwise. It can be a regular expression, i.e. "LI|LF" for matching France and Italy.

name

The name used to title the plot.

fl

flight level at which assemble the composing polygons.

buffer

Buffer around FIR (km)

firs

the relevant NM FIRs.

merge

Do you want to merge (default: TRUE)

Value

A ggplot object with country and relevant FIR.

Examples

## Not run: 
plot_country_fir("LI", "Italy")
# UK and Portugal have oceanic part...
plot_country_fir("EG", "United Kingdom (oceanic)")
# decoupling oceanic, manually
uk_continental <- firs_nm_406 %>%
  dplyr::filter(icao == "EG", min_fl <= 0, 0 <= max_fl) %>%
  dplyr::filter(!(id %in% c("EGGXFIR", "EGGX")))
plot_country_fir("EG", "United Kingdom (continental)", firs = uk_continental)
# EUROCONTROL
plot_country_fir(icao_id = "E.|L.|UD|UG|GM|UK|GC",
                 "EUROCONTROL Member States",
                 buffer = 350,
                 fl = 200)

## End(Not run)

Default colours for PRU maps.

Description

Default colours for PRU maps.

Usage

pru_colours()

Value

The colours for the various elements of a map, i.e. see, land, fir, ...


pruatlas: A package for PRU maps generation.

Description

The pruatlas package provides function to plot country FIRs, access the underlying FIR or country spatial definitions.

Functions

The pruatlas package provides three sets of functions, one for plottting, the second for accessing the underlying datasets and the last is about helper functions. For example plot_coutry_fir is an high level function that plots the FIR at the country level.

TODOs

  • list/define the colours of the maps (currently hardcoded)

  • provide FIRs for other AIRAC's (separate data packages? lazy-loading of data?)

  • define a function to convert from CFMU AIRAC format to AIP format

  • change airacnm to the AIP format


Return the polygon represent the spherical Earth.

Description

Return the polygon represent the spherical Earth.

Usage

sphere(crs = pruatlas::pru_laea_proj)

Arguments

crs

a proj projection string

Value

A Simple Feature representing the spherical contour of the Earch in the relevant projection.


A special object to represent the spherical Earth in a given projection.

Description

A special object to represent the spherical Earth in a given projection.

Usage

sphere_laea

Format

An object of class sf (inherits from data.frame) with 1 rows and 2 columns.

Source

https://github.com/euctrl-pru/eurocontrol-atlas

See Also

http://stackoverflow.com/q/43207947/963575


PRU theme for maps.

Description

A clean theme for displaying maps.

Usage

theme_map(base_size = 9, base_family = "", ...)

Arguments

base_size

base font size, given in pts.

base_family

base font family

...

other theme parameters