Package 'fisheye'

Title: Transform Base Maps Using Log-Azimuthal Projection
Description: Base maps are transformed to focus on a specific location using an azimuthal logarithmic distance transformation.
Authors: Timothée Giraud [cre, aut] , Luc Guibard [aut]
Maintainer: Timothée Giraud <[email protected]>
License: GPL-3
Version: 0.3.0
Built: 2024-10-26 03:55:25 UTC
Source: https://github.com/riatelab/fisheye

Help Index


Package description

Description

Base maps are transformed to focus on a specific location using an azimuthal logarithmic distance transformation.

Author(s)

Maintainer: Timothée Giraud [email protected] (ORCID)

Authors:

  • Luc Guibard

References

Hägerstrand, T. (1957). Migration and Area: A Survey of a Sample of Swedish Migration Fields and Hypothetical Considerations of their Genesis. Lund Studies in Geography, Series B, Human Geography, Department of Geography, University of Lund, Lund.

See Also

Useful links:


fisheye

Description

This function transform an sf layer with a fisheye transformation. Several methods are available. This is a visualisation method that should not be used for geospatial calculation (area, distances...). The output sf object has no CRS as it is not relevant.

Usage

fisheye(x, centre, method = "log", k = 1)

Arguments

x

an sf object (POINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON) to be transformed. This object needs to be projected (no lon/lat).

centre

an sf object, the center of the transformation. This object must use the same projection as x.

method

transfomation method, either 'log' or 'sqrt'. See Details.

k

integer, factor to adjust the log transformation, higher values soften the deformation. See Details.

Details

The 'log' method transforms distances to center with: d=log(1+10kd){d}' = \log(1 + 10^{-k} * d)
The 'sqrt' method transforms distances to center with: d=(d){d}' = \sqrt(d)

Value

A transformed sf object is returned.

Examples

library(sf)
ncraw <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc <- st_transform(ncraw, 3857)
ncfe <- fisheye(nc, centre = nc[100, ], method = 'log', k = 4)
plot(st_geometry(ncfe), col = "grey70", lwd = .2)
plot(st_geometry(ncfe[100,]), col = NA, lwd = 2, border = "red", add = TRUE)