Skip to content

Commit

Permalink
Merge pull request #497 from rafaqz/fix_link_image
Browse files Browse the repository at this point in the history
some fixes
  • Loading branch information
lazarusA authored Aug 13, 2023
2 parents 9cd75f6 + e961450 commit edacdba
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
run: |
julia --code-coverage=user --project=docs/ --color=yes docs/genfiles.jl
julia --code-coverage=user --project=docs/ --color=yes docs/make.jl
julia --project=docs/ --color=yes docs/genfiles.jl
julia --project=docs/ --color=yes docs/make.jl
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Rasters

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/rafaqz/Rasters.jl/blob/main/LICENSE)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://rafaqz.github.io/Rasters.jl/stable)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://rafaqz.github.io/Rasters.jl/dev)
[![CI](https://github.com/rafaqz/Rasters.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/rafaqz/Rasters.jl/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/rafaqz/Rasters.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/rafaqz/Rasters.jl)
[![Aqua.jl Quality Assurance](https://img.shields.io/badge/Aquajl-%F0%9F%8C%A2-aqua.svg)](https://github.com/JuliaTesting/Aqua.jl)
[![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Rasters&label=Downloads)](https://pkgs.genieframework.com?packages=Rasters)

<img src="https://rafaqz.github.io/stable/scripts/generated/basics/aus_trim.png" align="center" style="padding-right:10px"; width=100%"></img>

[Rasters.jl](https://rafaqz.github.io/Rasters.jl/dev) defines common types and methods for reading, writing and
manipulating rasterized spatial data.

These currently include raster arrays like GeoTIFF and NetCDF, R grd files,
multi-layered stacks, and multi-file series of arrays and stacks.

![EarthEnv HabitatHeterogeneity layers trimmed to Australia](https://rafaqz.github.io/Rasters.jl/stable/trim_example_after.png)

_A RasterStack of EarthEnv HabitatHeterogeneity layers, trimmed to Australia and plotted with Plots.jl_

## :warning: Packages extensions and Rasters 0.8 and onwards

Expand Down
15 changes: 8 additions & 7 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ theme:
# - content.tabs.link
#- content.tooltips
# - header.autohide
# - navigation.expand
- navigation.expand
#- navigation.indexes
# - navigation.instant
# - navigation.prune
Expand Down Expand Up @@ -104,10 +104,11 @@ plugins:
nav:
- "Home": "index.md"
- "Quick start" : "scripts/generated/basics/first_raster.md"
- "Data Sources" : "scripts/generated/basics/data_sources.md"
- "Methods" : "scripts/generated/basics/methods.md"
- "Arrays operations" : "scripts/generated/basics/array_operations.md"
- "Examples and Plotting" : "scripts/generated/basics/plotting.md"
- "A basic species distribution modelling workflow" : "scripts/generated/basics/gbif_wflow.md"
- "Examples with Makie" : "scripts/generated/basics/plot_makie.md"
- "User Guide":
- "Data Sources" : "scripts/generated/basics/data_sources.md"
- "Methods" : "scripts/generated/basics/methods.md"
- "Arrays operations" : "scripts/generated/basics/array_operations.md"
- "Examples and Plotting" : "scripts/generated/basics/plotting.md"
- "A basic species distribution modelling workflow" : "scripts/generated/basics/gbif_wflow.md"
- "Examples with Makie" : "scripts/generated/basics/plot_makie.md"
- "API Reference" : "reference.md"
39 changes: 38 additions & 1 deletion docs/scripts/basics/plot_makie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,41 @@ Makie.set_theme!() # reset theme

# ```@docs
# Rasters.rplot
# ```
# ```

# ## using more vanilla Makie

using Rasters, RasterDataSources

#the data
layers = (:evenness, :range, :contrast, :correlation)
st = RasterStack(EarthEnv{HabitatHeterogeneity}, layers)
ausbounds = X(100 .. 160), Y(-50 .. -10) # Roughly cut out australia
aus = st[ausbounds...] |> trim
#the plot
#colorbar attributes
colormap = :batlow
flipaxis = false
tickalign=1
width=13
ticksize=13;
#figure
with_theme(theme_ggplot2()) do
fig = Figure(resolution=(800, 600))
axs = [Axis(fig[i,j], xlabel = "lon", ylabel = "lat") for i in 1:2 for j in 1:2]
plt = [Makie.heatmap!(axs[i], aus[l]; colormap) for (i,l) in enumerate(layers)]
[axs[i].title = string(l) for (i,l) in enumerate(layers)]
hidexdecorations!.(axs[1:2]; grid=false, ticks=false)
hideydecorations!.(axs[[2,4]]; grid=false, ticks=false)
Colorbar(fig[1, 0], plt[1]; flipaxis, tickalign, width, ticksize)
Colorbar(fig[1, 3], plt[2]; tickalign, width, ticksize)
Colorbar(fig[2, 0], plt[3]; flipaxis, tickalign, width, ticksize)
Colorbar(fig[2, 3], plt[4]; tickalign, width, ticksize)
colgap!(fig.layout, 5)
rowgap!(fig.layout, 5)
Label(fig[0, :], "RasterStack of EarthEnv HabitatHeterogeneity layers, trimmed to Australia")
fig
end
save("aus_trim.png", current_figure());

# ![aus_trim](aus_trim.png)
21 changes: 14 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Rasters.jl
<img src="/scripts/generated/basics/aus_trim.png" align="center" style="padding-right:10px"; width=100%"></img>


## Rasters.jl

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/rafaqz/Rasters.jl/blob/main/LICENSE)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://rafaqz.github.io/Rasters.jl/stable)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://rafaqz.github.io/Rasters.jl/dev)
[![CI](https://github.com/rafaqz/Rasters.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/rafaqz/Rasters.jl/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/rafaqz/Rasters.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/rafaqz/Rasters.jl)
[![Aqua.jl Quality Assurance](https://img.shields.io/badge/Aquajl-%F0%9F%8C%A2-aqua.svg)](https://github.com/JuliaTesting/Aqua.jl)
[![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Rasters&label=Downloads)](https://pkgs.genieframework.com?packages=Rasters)

[Rasters.jl](https://rafaqz.github.io/Rasters.jl/dev) defines common types and methods for reading, writing and
manipulating rasterized spatial data.

These currently include raster arrays like `GeoTIFF` and `NetCDF`, `R grd` files,
multi-layered stacks, and multi-file series of arrays and stacks.

![EarthEnv HabitatHeterogeneity layers trimmed to Australia](https://rafaqz.github.io/Rasters.jl/stable/trim_example_after.png)

_A RasterStack of EarthEnv HabitatHeterogeneity layers, trimmed to Australia and plotted with Plots.jl_

```@raw html
??? info "Data-source abstraction"
!!! info "Data-source abstraction"

Rasters provides a standardised interface that allows many source data types to
be used with identical syntax.
Expand All @@ -26,7 +34,6 @@ _A RasterStack of EarthEnv HabitatHeterogeneity layers, trimmed to Australia and
by setting the `mappedcrs` keyword on construction. You don't need to know the underlying
projection, the conversion is handled automatically. This means lat/lon
`EPSG(4326)` can be used seamlessly if you need that.
```

!!! warning "Packages extensions and Rasters 0.8 and onwards"

Expand Down

0 comments on commit edacdba

Please sign in to comment.