knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of rgdalwinhdf4 is to read HDF4 on Windows, using Appveyor. It works on both 32-bit and 64-bit, relying on Rtools being available, and the rforge/rgdal clone source with the rwinlibs/gdal2 (>= 2.2.3) tooling.
Until rgdal is on CRAN with version (> 1.2-16) you will need devtools and the Rtools set up on Windows.
(Untested, see this repo appveyor set up for ).
devtools::install_github("rforge/rgdal/pkg") devtools::install_github("dis-organization/rgdalwinhdf4")
There's a nice HDF4 sea ice data set for testing with.
## install.packages(c("viridis", "raster", "maptools")) library(rgdalwinhdf4) x <- read_hdf4() ## system.file("extdata/asi-AMSR2-s6250-20171211-v5.hdf", package = "rgdalwinhdf4") library(raster) r <- flip(raster(x), "y") extent(r) <- extent(-3950000, 3950000, -3950000, 4350000) projection(r) <- "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs" plot(r, col = viridis::viridis(100)) data("wrld_simpl", package = "maptools") plot(sp::spTransform(wrld_simpl, projection(r)), add = TRUE) print(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.