Skip to content

Rasters.jlManipulating spatial data

a powerful package that simplifies the handling of rasterized spatial data in Julia.

Rasters

How to Install Rasters.jl? ​

Since Rasters.jl is registered in the Julia General registry, you can simply run the following command in the Julia REPL:

julia
julia> using Pkg
julia> Pkg.add("Rasters.jl")
# or
julia> ] # ']' should be pressed
pkg> add Rasters

If you want to use the latest unreleased version, you can run the following command:

julia
pkg> add Rasters#main

Package extensions ​

Before using a specific backend or feature, you must install and load its corresponding package,

julia
using Pkg
Pkg.add("ArchGDAL")
julia
using Pkg
Pkg.add("NCDatasets")
julia
# built-in
julia
using Pkg
Pkg.add("HDF5")
julia
using Pkg
Pkg.add("GRIBDatasets")
julia
using Pkg
Pkg.add(["GLMakie"])
julia
using Pkg
Pkg.add(["RasterDataSources"]) # which includes Worldclim{Climate}
julia
using Pkg
Pkg.add(["CoordinateTransformations"]) # transformations for gdal rasters

and as an example, to use the GDAL backend and download files, you will need to do:

julia
using Rasters, ArchGDAL, RasterDataSources

πŸžπŸ“Œ Bugs ​

Bugs, errors and making issues for Rasters.jl

Because there are so many raster file types and variations of them, most of the time we need the exact file that caused your problem to know how to fix it, and be sure that we have actually fixed it when we are done. So fixing a Rasters.jl bug nearly always involves downloading some file and running some code that breaks with it (if you can trigger the bug without a file, that's great! but its not always possible).

To make an issue we can fix quickly (or at all) there are three key steps:

  1. Include the file in an accessible place on web without authentication or any other work on our part, so we can just get it and find your bug. You can put it on a file hosting platform (e.g. google drive, drop box, whatever you use) and share the url.

  2. Add a minimum working example to the issue template that first downloads the file, then runs the function that triggers the bug.

  3. Paste the complete stack trace of the error it produces, right to the bottom, into the issue template. Then we can be sure we reproduced the same problem.

Good issues are really appreciated, but they do take just a little extra effort with Rasters.jl because of this need for files.