Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bookcover (and source files) #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ book:
author: "Maarten Pronk, Rafael Schouten, Anshul Singhvi, Felix Cremer and Jakub Nowosad"
description: |
An introductory resource for working with geographic data in Julia
# cover-image: https://geocompx.org/static/img/book_cover_py_tmp_small.png
cover-image: cover/cover_small-fs8.png
site-url: https://jl.geocompx.org
repo-url: https://github.com/geocompx/geocompjl/
repo-branch: main
Expand Down
4 changes: 4 additions & 0 deletions cover/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"
15 changes: 15 additions & 0 deletions cover/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Making the cover

The cover is made as an A4 in Illustrator, with the title set in Tamil NM Bold 48pt, compressed by 40 to look like the Julia logo (https://github.com/JuliaLang/julia-logo-graphics?tab=readme-ov-file#construction-the-julia-language-logo). The logo is https://github.com/JuliaLang/julia-logo-graphics/blob/master/images/julia-logo-dark.svg.

The graphic is made by running the `cover.jl` file. Specifically what we see is the CopernicusDEM elevation model around Prague (where this book was born), both as a surface, as its white contours. No GeoMakie is used.

The author names are set in Montserrat 18pt.

Finally the cover is exported as png, `pngquant` is run for compression.

## Improvements
- [ ] Ditch Illustrator
- [ ] Fix labels intersecting ticks
- [ ] Improve surface (maybe rotate to the right as well)

29 changes: 29 additions & 0 deletions cover/cover.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using GLMakie
using Rasters
using ArchGDAL
dir = @__DIR__

dem = Raster(joinpath(dir, "copdem_prague.tif"))
evetion marked this conversation as resolved.
Show resolved Hide resolved

GLMakie.activate!()
GLMakie.activate!(ssao=true)

GLMakie.closeall() # close any open screen

x = lookup(dem, X) # if X is longitude
y = lookup(dem, Y) # if Y is latitude
zmin, zmax = minimum(dem), maximum(dem)
cmap = :viridis

set_theme!(theme_dark())
# backgroundcolor is julia purple with blacks set to 80% to match Python cover
fig = Figure(size=(2400, 2400), fontsize=22, backgroundcolor="#371135")
ax = Axis3(fig[1, 1], aspect=:equal, perspectiveness=1, elevation=π / 5,
zgridcolor=:white, ygridcolor=:white, xgridcolor=:white, xlabel="Longitude", ylabel="Latitude")
xlims!(ax, extrema(x)...)
ylims!(ax, extrema(y)...)
zlims!(ax, 0, zmax + 100)
sm = surface!(ax, x, y, dem; colormap=cmap, colorrange=(zmin, zmax))
contour!(ax, x, y, dem; levels=100, linewidth=0.1, color=:white,
colorrange=(zmin, zmax), transparency=true)
save("test.png", ax.scene; px_per_unit=2)
Binary file added cover/cover_small-fs8.png
evetion marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cover/prague_elevation.tif
Binary file not shown.
Loading