Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-spatial/slideview
Compare Rasters Side by Side with a Slider
https://github.com/r-spatial/slideview
Last synced: about 1 month ago
JSON representation
Compare Rasters Side by Side with a Slider
- Host: GitHub
- URL: https://github.com/r-spatial/slideview
- Owner: r-spatial
- License: other
- Created: 2019-02-11T20:00:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-07T07:10:25.000Z (4 months ago)
- Last Synced: 2024-10-07T11:47:23.785Z (2 months ago)
- Language: R
- Homepage: https://r-spatial.github.io/slideview/
- Size: 4.35 MB
- Stars: 25
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-leaflet - slideview: Compare Rasters Side by Side with a Slider
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
eval = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# Interactively Explore (Raster)Images side-by-side
[![R-CMD-check](https://github.com/r-spatial/slideview/workflows/R-CMD-check/badge.svg)](https://github.com/r-spatial/slideview/actions)
![monthly](http://cranlogs.r-pkg.org/badges/slideview)
![total](http://cranlogs.r-pkg.org/badges/grand-total/slideview)
[![CRAN](http://www.r-pkg.org/badges/version/slideview?color=009999)](https://cran.r-project.org/package=slideview)
[![status](https://tinyverse.netlify.com/badge/slideview)](https://CRAN.R-project.org/package=slideview)`slideview` enables interactive exploration of (raster)images side-by-side by
providing a mouse-controlled slider. This can be especially useful for comparing
images of the same region at different time stamps (change detection).## Installation
You can install the released version of `slideview` from [CRAN](https://CRAN.R-project.org) with:
```{r, eval=FALSE}
install.packages("slideview")
```## Example
```{r, eval=FALSE}
### example taken from
### http://www.news.com.au/technology/environment/nasa-images-reveal-
### aral-sea-is-shrinking-before-our-eyes/story-e6frflp0-1227074133835
library(jpeg)
library(raster)
library(slideview)# 2000
web_img2000 <- "http://cdn.newsapi.com.au/image/v1/68565a36c0fccb1bc43c09d96e8fb029"
jpg2000 <- readJPEG(readBin(web_img2000, "raw", 1e6))# Convert imagedata to raster
rst_blue2000 <- raster(jpg2000[, , 1])
rst_green2000 <- raster(jpg2000[, , 2])
rst_red2000 <- raster(jpg2000[, , 3])img2000 <- brick(rst_red2000, rst_green2000, rst_blue2000)
# 2013
web_img2013 <- "http://cdn.newsapi.com.au/image/v1/5707499d769db4b8ec76e8df61933f2a"
jpg2013 <- readJPEG(readBin(web_img2013, "raw", 1e6))# Convert imagedata to raster
rst_blue2013 <- raster(jpg2013[, , 1])
rst_green2013 <- raster(jpg2013[, , 2])
rst_red2013 <- raster(jpg2013[, , 3])img2013 <- brick(rst_red2013, rst_green2013, rst_blue2013)
slideView(img2000, img2013, label1 = "before", label2 = "after")
```![](man/figures/slideview.gif)
### Code of Conduct
Please note that the 'slideview' project is released with a [Contributor Code of Conduct](https://github.com/r-spatial/slideview/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.