orthomap: Create a World map in orthographic projection

Description Usage Arguments Value See Also Examples

Description

This function corrects a bug (some polygons are not correctly projected) in the function maps:map() when it is used in orthographic projection. The function orthomap() also returns projected polygons in the sp:SpatialPolygons format.

Usage

1
2
3
4
orthomap(query = NULL, centre = c(0, 0), border.color = NA,
  border.type = 1, border.size = 0.25, fill = "#909090",
  globe = "transparent", grid = TRUE, nx = 10, ny = 10,
  grid.color = "#969696", grid.type = 1, grid.size = 0.25, ...)

Arguments

query

The name of a country to center the map on.

centre

Latitude and longitude of the map center. Ignored if query is not NULL.

border.color

Color of polygons border.

border.type

Type of polygons border line (see argument lty).

border.size

Size of polygons border line (see argument lwd).

fill

Color of polygons.

globe

Color of globe background.

grid

If TRUE, grid (i.e. graticules) are added to the map.

nx

Number of longitude lines.

ny

Number of latitude lines.

grid.color

Color of the grid.

grid.type

Type of grid (see argument lty).

grid.size

Line width of the grid (see argument lwd).

...

Additional graphical parameters (see par).

Value

A SpatialPolygons of world countries in orthographic projection without aberrations.

See Also

map

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Default settings
world <- orthomap()

class(world)
length(world)
sp::plot(world)

# Center map based on country name
world <- orthomap(query = "France")

# Center map based on coordinates
world <- orthomap(centre = c(45, 125))

# Customize map
world <- orthomap(
  centre       = c(45, 125),
  border.color = "#dddddd",
  border.type  = 1,
  border.size  = 0.25,
  fill         = c("#0868ac", "#016c59", "#b30000"),
  globe        = "#b3d0d1",
  grid         = TRUE,
  nx           = 20,
  ny           = 20,
  grid.color   = "#969696",
  grid.type    = 1,
  grid.size    = 0.25,
  mar          = rep(0, 4),
  bg           = "#dddddd"
)

ahasverus/orthomap documentation built on May 30, 2019, 11:52 a.m.