fisheye

Transform base maps using log-azimuthal projection

https://github.com/riatelab/fisheye

Science Score: 75.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
    Organization riatelab has institutional domain (riate.cnrs.fr)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

map r spatial
Last synced: 4 months ago · JSON representation ·

Repository

Transform base maps using log-azimuthal projection

Basic Info
  • Host: GitHub
  • Owner: riatelab
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 50.9 MB
Statistics
  • Stars: 17
  • Watchers: 4
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
map r spatial
Created about 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Citation Codemeta

README.Rmd

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# fisheye 


![CRAN version](https://www.r-pkg.org/badges/version-ago/fisheye)
[![codecov](https://codecov.io/gh/riatelab/fisheye/branch/main/graph/badge.svg)](https://app.codecov.io/gh/riatelab/fisheye?branch=main)
[![R-CMD-check](https://github.com/riatelab/fisheye/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/riatelab/fisheye/actions/workflows/R-CMD-check.yaml)


The goal of fisheye is to create base maps focusing on a specific location using an azimuthal logarithmic distance transformation.


    

John Bachmann, [New York and environs](https://digitalcollections.nypl.org/items/510d47e3-b9bd-a3d9-e040-e00a18064a99), 1859. 


## Installation

You can install the released version of `fisheye` from
[CRAN](https://cran.r-project.org/package=fisheye) with:

``` r
install.packages("fisheye")
```

Alternatively, you can install the development version of `fisheye` from
GitHub with:

``` r
remotes::install_github("riatelab/fisheye")
```
## Example

This is a basic example:

```{r example, fig.width=10, fig.height = 3, out.width="100%"}
library(sf)
library(fisheye)
library(mapsf)
# Import dataset
ncraw <- st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc <- st_transform(ncraw, 3857)
par(mfrow = c(1,2))
mf_map(nc, col ="grey90")
mf_map(nc[51, ], add = TRUE, col = "grey40")
mf_title("Original Map")
# transform the basemap
nc_fe  <- fisheye(nc, centre = nc[51, ])
mf_map(nc_fe, col ="grey90")
mf_map(nc_fe[51, ], add = TRUE, col = "grey40")
mf_title("Log-Azimuthal Projection")
```

```{r example2,fig.width=10, fig.height = 3, out.width="100%", echo=FALSE }
# data import
par(mfrow = c(1,2))
mf_theme(mar = c(0.5,0.5,0.5,0.5))
center <- st_centroid(st_geometry(nc[51, ]))

buf_size <- c(
  seq(100,1000, 100),
  seq(1000,10000,1000),
  seq(10000, 100000, 10000)
)
lb <- vector("list", length(buf_size))
for (i in seq_along(lb)){
  lb[[i]] <- st_buffer(center, buf_size[i])
}
buf <- st_sf(geom = do.call(c, lb))


mf_init(nc)
mf_map(nc, col ="grey90", border = "white", add = TRUE)
mf_map(buf, add = TRUE, border = "red", col = NA, lwd = .4, lty = 3)
mf_map(buf[c(10,20,30), ], add = TRUE, border = "red", col = NA, 
       lwd = 1, lty = 1)
mf_map(center, pch = 20, add = TRUE)
for (i in c(20, 30)){
  text(x = st_coordinates(center)[1,1], 
       y = st_bbox(buf[i, ])[4], 
       labels = paste0(round(buf_size[i]/1000, 0),  "km")
  )
}


buffe <- fisheye(buf, centre = center, method = "log", k = 1)
ncfe  <- fisheye(nc, centre = center, method = "log", k = 1)
mf_init(buffe)
mf_map(ncfe, add = TRUE)
mf_map(buffe, add = TRUE, border = "red", col = NA, lwd = .4, lty = 3)
mf_map(buffe[c(1,10,20,30), ], add = TRUE, border = "red", col = NA, 
       lwd = 1, lty = 1)
points(0,0,pch = 20)
for (i in c(1,10,20,30)){
  text(x = 0, 
       y = st_bbox(buffe[i, ])[4], 
       labels = paste0(signif(buf_size[i]/1000, 0),  "km")
  )
}


```

See a more detailed example [here](https://github.com/rcarto/fisheye-example/): 

![](https://raw.githubusercontent.com/rCarto/fisheye-example/main/gif/mob.gif)

## 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.

* Snyder, J.P. (1987). "Magnifying-Glass" Azimuthal Map Projections. The American Cartographer, 14:1, 61-68, https://doi.org/10.1559/152304087783875318

* Fairbairn, D., & Taylor, G. (1995). Developing a variable-scale map projection for urban areas. Computers & Geosciences, 21:9, 1053-1064, https://doi.org/10.1016/0098-3004(95)00041-6

* Boutoura, C., Tsioukas, V., & Tsorlini, A. (2012). Experimenting “fisheye-lens functions” in studying digitally particular historic maps. e-Perimetron (ISSN 1790 - 3769). 7. 111-123. http://www.e-perimetron.org/Vol_7_3/Boutoura_et_al.pdf

* Roughan, M. (2017). Log-azimuthal maps. https://roughan.info/math/log-az/

* Rivière, P. (2018). The Log-Azimuthal projection. https://observablehq.com/@fil/log-azimuthal 	

* Jansen, T. (2018). “Magnifying-Glass” projections. https://observablehq.com/@toja/magnifying-glass-projections 	

* Sahasrabuddhe, R., Lambiotte, R., & Alessandretti, L. (2021). From centre to centres: polycentric structures in individual mobility. https://arxiv.org/pdf/2108.08113.pdf

Owner

  • Name: riatelab
  • Login: riatelab
  • Kind: organization
  • Location: Paris

Spatial analysis and mapping software packages created by the Center for Spatial Analysis and Geovisualization - RIATE

Citation (CITATION.cff)

# -----------------------------------------------------------
# CITATION file created with {cffr} R package, v0.5.0
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------
 
cff-version: 1.2.0
message: 'To cite package "fisheye" in publications use:'
type: software
license: GPL-3.0-only
title: 'fisheye: Transform Base Maps Using Log-Azimuthal Projection'
version: 0.2.0
abstract: Base maps are transformed to focus on a specific location using an azimuthal
  logarithmic distance transformation.
authors:
- family-names: Giraud
  given-names: Timothée
  email: timothee.giraud@cnrs.fr
  orcid: https://orcid.org/0000-0002-1932-3323
- family-names: Guibard
  given-names: Luc
repository: https://CRAN.R-project.org/package=fisheye
repository-code: https://github.com/riatelab/fisheye
url: https://github.com/riatelab/fisheye
contact:
- family-names: Giraud
  given-names: Timothée
  email: timothee.giraud@cnrs.fr
  orcid: https://orcid.org/0000-0002-1932-3323
keywords:
- map
- r
- spatial
references:
- type: software
  title: 'R: A Language and Environment for Statistical Computing'
  notes: Depends
  url: https://www.R-project.org/
  authors:
  - name: R Core Team
  location:
    name: Vienna, Austria
  year: '2023'
  institution:
    name: R Foundation for Statistical Computing
  version: '>= 3.5.0'
- type: software
  title: sf
  abstract: 'sf: Simple Features for R'
  notes: Imports
  url: https://r-spatial.github.io/sf/
  repository: https://CRAN.R-project.org/package=sf
  authors:
  - family-names: Pebesma
    given-names: Edzer
    email: edzer.pebesma@uni-muenster.de
    orcid: https://orcid.org/0000-0001-8049-7069
  year: '2023'
- type: software
  title: covr
  abstract: 'covr: Test Coverage for Packages'
  notes: Suggests
  url: https://covr.r-lib.org
  repository: https://CRAN.R-project.org/package=covr
  authors:
  - family-names: Hester
    given-names: Jim
    email: james.f.hester@gmail.com
  year: '2023'
- type: software
  title: tinytest
  abstract: 'tinytest: Lightweight and Feature Complete Unit Testing Framework'
  notes: Suggests
  url: https://github.com/markvanderloo/tinytest
  repository: https://CRAN.R-project.org/package=tinytest
  authors:
  - family-names: van der Loo
    given-names: Mark
    email: mark.vanderloo@gmail.com
    orcid: https://orcid.org/0000-0002-9807-4686
  year: '2023'

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "fisheye",
  "description": "Base maps are transformed to focus on a specific location using an azimuthal logarithmic distance transformation.",
  "name": "fisheye: Transform Base Maps Using Log-Azimuthal Projection",
  "codeRepository": "https://github.com/riatelab/fisheye",
  "issueTracker": "https://github.com/riatelab/fisheye/issues",
  "license": "https://spdx.org/licenses/GPL-3.0",
  "version": "0.2.0",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.3.2 (2023-10-31)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Timothée",
      "familyName": "Giraud",
      "email": "timothee.giraud@cnrs.fr",
      "@id": "https://orcid.org/0000-0002-1932-3323"
    },
    {
      "@type": "Person",
      "givenName": "Luc",
      "familyName": "Guibard"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Timothée",
      "familyName": "Giraud",
      "email": "timothee.giraud@cnrs.fr",
      "@id": "https://orcid.org/0000-0002-1932-3323"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "tinytest",
      "name": "tinytest",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=tinytest"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 3.5.0"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "sf",
      "name": "sf",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=sf"
    },
    "SystemRequirements": null
  },
  "fileSize": "11.216KB"
}

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 247 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: fisheye

Transform Base Maps Using Log-Azimuthal Projection

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 247 Last month
Rankings
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 49.1%
Downloads: 82.1%
Maintainers (1)
Last synced: 4 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • sf * imports
  • covr * suggests
  • tinytest * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite