Science Score: 57.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 3 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.0%) to scientific vocabulary
Keywords
cran
cran-r
jpeg
jpg
maps
png
r
r-package
r-stats
raster
rstats
sf
terra
tif
tiff
Keywords from Contributors
meshing
cff
citation-file-format
citation-files
standardization
r-cran
ggplot-extension
r-spatial
rspatial
rstats-package
Last synced: 4 months ago
·
JSON representation
·
Repository
Convert digital images into georeferenced rasters
Basic Info
- Host: GitHub
- Owner: dieghernan
- License: other
- Language: R
- Default Branch: main
- Homepage: https://dieghernan.github.io/rasterpic/
- Size: 346 MB
Statistics
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 1
- Releases: 9
Topics
cran
cran-r
jpeg
jpg
maps
png
r
r-package
r-stats
raster
rstats
sf
terra
tif
tiff
Created almost 4 years ago
· Last pushed 5 months ago
Metadata Files
Readme
Changelog
Contributing
Funding
License
Citation
Codemeta
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
warning = FALSE,
message = FALSE,
tidy = "styler",
dev = "ragg_png",
fig.path = "man/figures/README-",
dpi = 150,
out.width = "100%"
)
```
# rasterpic
[](https://CRAN.R-project.org/package=rasterpic)
[](https://cran.r-project.org/web/checks/check_results_rasterpic.html)
[](https://github.com/dieghernan/rasterpic/actions/workflows/check-full.yaml)
[](https://github.com/dieghernan/rasterpic/actions/workflows/rhub.yaml)
[](https://app.codecov.io/gh/dieghernan/rasterpic)
[](https://dieghernan.r-universe.dev/rasterpic)
[](https://www.codefactor.io/repository/github/dieghernan/rasterpic)
[](https://doi.org/10.32614/CRAN.package.rasterpic)
[](https://www.repostatus.org/#active)
[](https://CRAN.R-project.org/package=rasterpic)
**rasterpic** is a tiny package with one single goal: to transform an image into
a `SpatRaster` object (see `?terra::SpatRaster`).
## Installation
Install **rasterpic** from
[**CRAN**](https://CRAN.R-project.org/package=rasterpic):
```{r, eval=FALSE}
install.packages("rasterpic")
```
You can install the developing version of **rasterpic** with:
```{r, eval=FALSE}
# install.packages("pak")
pak::pak("dieghernan/rasterpic")
```
Alternatively, you can install **rasterpic** using the
[r-universe](https://dieghernan.r-universe.dev/rasterpic):
```{r, eval=FALSE}
# Install rasterpic in R:
install.packages("rasterpic",
repos = c(
"https://dieghernan.r-universe.dev",
"https://cloud.r-project.org"
)
)
```
## Example
This package allows you to create cool maps by using a wide variety of objects:
- Spatial object created with the **sf** package: `sf`, `sfc`, `sfg` or
`bbox`.
- Spatial objects created with the **terra** package: `SpatRaster`,
`SpatVector`, `SpatExtent`.
- A vector of coordinates with the form `c(xmin, ymin, xmax, yman)`
An example using an `sf` object:
```{r example-basic}
library(rasterpic)
library(sf)
library(terra)
# The flag of the United Kingdom
img <- system.file("img/UK_flag.png", package = "rasterpic")
uk <- read_sf(system.file("gpkg/UK.gpkg", package = "rasterpic"))
class(uk)
# Rasterize!
uk_flag <- rasterpic_img(uk, img)
uk_flag
# Plot it!
# Using ggplot2 + tidyterra
library(tidyterra)
library(ggplot2)
autoplot(uk_flag) +
geom_sf(data = uk, color = alpha("blue", 0.5))
```
We can also play with other parameters, as well as modifying the alignment of
the image with respect to the object:
```{r align-crop-mask}
# Align, crop and mask
uk_flag2 <- rasterpic_img(uk, img, halign = 0.2, crop = TRUE, mask = TRUE)
autoplot(uk_flag2) +
geom_sf(data = uk, fill = NA)
```
## Image formats admitted
**rasterpic** can parse the following image formats:
- `png` files.
- `jpg/jpeg` files.
- `tif/tiff` files.
## Citation
```{r echo=FALSE, results='asis'}
print(citation("rasterpic"), style = "html")
```
A BibTeX entry for LaTeX users is:
```{r echo=FALSE, comment=''}
toBibtex(citation("rasterpic"))
```
## Contributors
All contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [allcontributors](https://allcontributors.org) specification. Contributions of any kind are welcome!
### Code
|
dieghernan |
|
rhijmans |
Owner
- Name: Diego H.
- Login: dieghernan
- Kind: user
- Location: Madrid, ES
- Website: https://dieghernan.github.io/
- Twitter: dhernangomez
- Repositories: 102
- Profile: https://github.com/dieghernan
Citation (CITATION.cff)
# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
cff-version: 1.2.0
message: 'To cite package "rasterpic" in publications use:'
type: software
license: MIT
title: 'rasterpic: Convert Digital Images into ''SpatRaster'' Objects'
version: 0.3.0
doi: 10.32614/CRAN.package.rasterpic
identifiers:
- type: doi
value: 10.32614/CRAN.package.rasterpic
abstract: Generate 'SpatRaster' objects, as defined by the 'terra' package, from digital
images, using a specified spatial object as a geographical reference.
authors:
- family-names: Hernangómez
given-names: Diego
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
preferred-citation:
type: manual
title: 'rasterpic: Convert Digital Images into SpatRaster Objects'
authors:
- family-names: Hernangómez
given-names: Diego
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
doi: 10.32614/CRAN.package.rasterpic
year: '2025'
version: 0.3.0
url: https://dieghernan.github.io/rasterpic/
abstract: Generate SpatRaster objects, as defined by the terra package, from digital
images, using a specified spatial object as a geographical reference.
repository: https://CRAN.R-project.org/package=rasterpic
repository-code: https://github.com/dieghernan/rasterpic
url: https://dieghernan.github.io/rasterpic/
contact:
- family-names: Hernangómez
given-names: Diego
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
keywords:
- cran
- jpeg
- jpg
- maps
- png
- r
- r-package
- r-stats
- raster
- rstats
- sf
- terra
- tif
- tiff
- cran-r
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
institution:
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2025'
version: '>= 3.6.0'
- type: software
title: png
abstract: 'png: Read and write PNG images'
notes: Imports
url: http://www.rforge.net/png/
repository: https://CRAN.R-project.org/package=png
authors:
- family-names: Urbanek
given-names: Simon
email: Simon.Urbanek@r-project.org
year: '2025'
doi: 10.32614/CRAN.package.png
version: '>= 0.1-5'
- 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: '2025'
doi: 10.32614/CRAN.package.sf
version: '>= 1.0.0'
- type: software
title: terra
abstract: 'terra: Spatial Data Analysis'
notes: Imports
url: https://rspatial.org/
repository: https://CRAN.R-project.org/package=terra
authors:
- family-names: Hijmans
given-names: Robert J.
email: r.hijmans@gmail.com
orcid: https://orcid.org/0000-0001-5872-2872
year: '2025'
doi: 10.32614/CRAN.package.terra
version: '>= 1.4-22'
- type: software
title: ggplot2
abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics'
notes: Suggests
url: https://ggplot2.tidyverse.org
repository: https://CRAN.R-project.org/package=ggplot2
authors:
- family-names: Wickham
given-names: Hadley
email: hadley@posit.co
orcid: https://orcid.org/0000-0003-4757-117X
- family-names: Chang
given-names: Winston
orcid: https://orcid.org/0000-0002-1576-2126
- family-names: Henry
given-names: Lionel
- family-names: Pedersen
given-names: Thomas Lin
email: thomas.pedersen@posit.co
orcid: https://orcid.org/0000-0002-5147-4711
- family-names: Takahashi
given-names: Kohske
- family-names: Wilke
given-names: Claus
orcid: https://orcid.org/0000-0002-7470-9261
- family-names: Woo
given-names: Kara
orcid: https://orcid.org/0000-0002-5125-4188
- family-names: Yutani
given-names: Hiroaki
orcid: https://orcid.org/0000-0002-3385-7233
- family-names: Dunnington
given-names: Dewey
orcid: https://orcid.org/0000-0002-9415-4582
- family-names: Brand
given-names: Teun
name-particle: van den
orcid: https://orcid.org/0000-0002-9335-7468
year: '2025'
doi: 10.32614/CRAN.package.ggplot2
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
notes: Suggests
url: https://yihui.org/knitr/
repository: https://CRAN.R-project.org/package=knitr
authors:
- family-names: Xie
given-names: Yihui
email: xie@yihui.name
orcid: https://orcid.org/0000-0003-0645-5666
year: '2025'
doi: 10.32614/CRAN.package.knitr
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
notes: Suggests
url: https://pkgs.rstudio.com/rmarkdown/
repository: https://CRAN.R-project.org/package=rmarkdown
authors:
- family-names: Allaire
given-names: JJ
email: jj@posit.co
- family-names: Xie
given-names: Yihui
email: xie@yihui.name
orcid: https://orcid.org/0000-0003-0645-5666
- family-names: Dervieux
given-names: Christophe
email: cderv@posit.co
orcid: https://orcid.org/0000-0003-4474-2498
- family-names: McPherson
given-names: Jonathan
email: jonathan@posit.co
- family-names: Luraschi
given-names: Javier
- family-names: Ushey
given-names: Kevin
email: kevin@posit.co
- family-names: Atkins
given-names: Aron
email: aron@posit.co
- family-names: Wickham
given-names: Hadley
email: hadley@posit.co
- family-names: Cheng
given-names: Joe
email: joe@posit.co
- family-names: Chang
given-names: Winston
email: winston@posit.co
- family-names: Iannone
given-names: Richard
email: rich@posit.co
orcid: https://orcid.org/0000-0003-3925-190X
year: '2025'
doi: 10.32614/CRAN.package.rmarkdown
- type: software
title: testthat
abstract: 'testthat: Unit Testing for R'
notes: Suggests
url: https://testthat.r-lib.org
repository: https://CRAN.R-project.org/package=testthat
authors:
- family-names: Wickham
given-names: Hadley
email: hadley@posit.co
year: '2025'
doi: 10.32614/CRAN.package.testthat
version: '>= 3.0.0'
- type: software
title: tidyterra
abstract: 'tidyterra: ''tidyverse'' Methods and ''ggplot2'' Helpers for ''terra''
Objects'
notes: Suggests
url: https://dieghernan.github.io/tidyterra/
repository: https://CRAN.R-project.org/package=tidyterra
authors:
- family-names: Hernangómez
given-names: Diego
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
year: '2025'
doi: 10.32614/CRAN.package.tidyterra
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "rasterpic",
"description": "Generate 'SpatRaster' objects, as defined by the 'terra' package, from digital images, using a specified spatial object as a geographical reference.",
"name": "rasterpic: Convert Digital Images into 'SpatRaster' Objects",
"relatedLink": [
"https://dieghernan.github.io/rasterpic/",
"https://CRAN.R-project.org/package=rasterpic"
],
"codeRepository": "https://github.com/dieghernan/rasterpic",
"issueTracker": "https://github.com/dieghernan/rasterpic/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.3.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.5.1 (2025-06-13 ucrt)",
"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": "Diego",
"familyName": "Hernangómez",
"email": "diego.hernangomezherrero@gmail.com",
"@id": "https://orcid.org/0000-0001-8457-4658"
}
],
"copyrightHolder": [
{
"@type": "Person",
"givenName": "Diego",
"familyName": "Hernangómez",
"email": "diego.hernangomezherrero@gmail.com",
"@id": "https://orcid.org/0000-0001-8457-4658"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Diego",
"familyName": "Hernangómez",
"email": "diego.hernangomezherrero@gmail.com",
"@id": "https://orcid.org/0000-0001-8457-4658"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"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=ggplot2"
},
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"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=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
"name": "rmarkdown",
"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=rmarkdown"
},
{
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"version": ">= 3.0.0",
"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=testthat"
},
{
"@type": "SoftwareApplication",
"identifier": "tidyterra",
"name": "tidyterra",
"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=tidyterra"
}
],
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 3.6.0"
},
"2": {
"@type": "SoftwareApplication",
"identifier": "png",
"name": "png",
"version": ">= 0.1-5",
"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=png"
},
"3": {
"@type": "SoftwareApplication",
"identifier": "sf",
"name": "sf",
"version": ">= 1.0.0",
"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"
},
"4": {
"@type": "SoftwareApplication",
"identifier": "terra",
"name": "terra",
"version": ">= 1.4-22",
"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=terra"
},
"SystemRequirements": null
},
"keywords": [
"cran",
"jpeg",
"jpg",
"maps",
"png",
"r",
"r-package",
"r-stats",
"raster",
"rstats",
"sf",
"terra",
"tif",
"tiff",
"cran-r"
],
"fileSize": "1157.267KB",
"citation": [
{
"@type": "SoftwareSourceCode",
"datePublished": "2025",
"author": [
{
"@type": "Person",
"givenName": "Diego",
"familyName": "Hernangómez"
}
],
"name": "{rasterpic}: Convert Digital Images into {SpatRaster} Objects",
"identifier": "10.32614/CRAN.package.rasterpic",
"url": "https://dieghernan.github.io/rasterpic/",
"@id": "https://doi.org/10.32614/CRAN.package.rasterpic",
"sameAs": "https://doi.org/10.32614/CRAN.package.rasterpic"
}
],
"releaseNotes": "https://github.com/dieghernan/rasterpic/blob/main/NEWS.md",
"readme": "https://github.com/dieghernan/rasterpic/blob/main/README.md",
"contIntegration": [
"https://github.com/dieghernan/rasterpic/actions/workflows/check-full.yaml",
"https://github.com/dieghernan/rasterpic/actions/workflows/rhub.yaml",
"https://app.codecov.io/gh/dieghernan/rasterpic"
],
"developmentStatus": "https://www.repostatus.org/#active"
}
GitHub Events
Total
- Create event: 3
- Release event: 2
- Issues event: 4
- Delete event: 2
- Issue comment event: 3
- Push event: 43
- Pull request event: 5
- Fork event: 1
Last Year
- Create event: 3
- Release event: 2
- Issues event: 4
- Delete event: 2
- Issue comment event: 3
- Push event: 43
- Pull request event: 5
- Fork event: 1
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Diego H | d****o@g****m | 108 |
| github-actions[bot] | 4****] | 17 |
| unknown | 7 | |
| dependabot[bot] | 4****] | 4 |
| ImgBotApp | I****p@g****m | 2 |
| imgbot[bot] | 3****] | 2 |
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 11
- Total pull requests: 17
- Average time to close issues: 7 days
- Average time to close pull requests: 1 day
- Total issue authors: 3
- Total pull request authors: 3
- Average comments per issue: 0.55
- Average comments per pull request: 1.41
- Merged pull requests: 15
- Bot issues: 2
- Bot pull requests: 12
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: about 2 hours
- Average time to close pull requests: about 2 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 2.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- dieghernan (9)
- github-actions[bot] (2)
- fossabot (1)
- rhijmans (1)
Pull Request Authors
- imgbot[bot] (7)
- dependabot[bot] (6)
- dieghernan (6)
Top Labels
Issue Labels
Pull Request Labels
dependencies (6)
github_actions (1)
Packages
- Total packages: 1
-
Total downloads:
- cran 284 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 9
- Total maintainers: 1
cran.r-project.org: rasterpic
Convert Digital Images into 'SpatRaster' Objects
- Homepage: https://dieghernan.github.io/rasterpic/
- Documentation: http://cran.r-project.org/web/packages/rasterpic/rasterpic.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.0
published 10 months ago
Rankings
Stargazers count: 15.1%
Forks count: 21.0%
Dependent repos count: 23.9%
Dependent packages count: 28.7%
Average: 29.1%
Downloads: 57.0%
Maintainers (1)
Last synced:
5 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.6.0 depends
- png >= 0.1 imports
- sf >= 1.0.0 imports
- terra >= 1.4 imports
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- tidyterra * suggests
- vdiffr >= 1.0.0 suggests
.github/workflows/check-full.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/lint.yaml
actions
- actions/checkout v3 composite
- github/codeql-action/upload-sarif v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown-gh-pages-clean.yaml
actions
- actions/checkout v3 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/pkgdown-gh-pages.yaml
actions
- actions/checkout v3 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
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/update-citation-cff.yaml
actions
- actions/checkout v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/update-docs.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