Skip to contents

Render a complete planisphere from a projected object created with project(). The display includes the projected sphere outline, graticule, and geographic features.

Usage

display(x, title = NULL, extent = NULL)

Arguments

x

A list returned by project(), containing three sf objects:

  • basemap: projected geographic features

  • sphere: outline of the projected globe

  • graticule: projected latitude/longitude grid

title

Character string. Optional title to add to the plot. Default is NULL.

extent

object. A spatial extent used to clip or define the mapping area (`sf`, `sfc`, or `bbox`).

Value

a base R plot.

Details

The visualization follows the D3.js spherical projection model used in the package. The rendering order is: 1. Sphere background 2. Graticule 3. Projected landmass (basemap) 4. Sphere outline

All geometries are expected to be already projected in spherical coordinates. This function is intended for fast visualization and exploration of D3-based projections.

Examples

library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
world <- st_read(
  system.file("gpkg/land.gpkg", package = "planisphere"),
  quiet = TRUE
)

result <- planisphere::project(
  x = world,
  proj = "Eckert1",
  additional_layers = TRUE
)
planisphere::display(result)