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

block axis2 #163

Merged
merged 36 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a0270d3
turn GeoAxis into a block and fix projection
SimonDanisch Feb 1, 2023
64a4646
fix imports
SimonDanisch Feb 1, 2023
993fc55
make a few more examples work
SimonDanisch Feb 1, 2023
6859928
use transformed datalimits
SimonDanisch Apr 19, 2023
af22999
basic attempt at theming + spines
asinghvi17 Apr 20, 2023
5c11cb7
Mesh image recipe
asinghvi17 Apr 20, 2023
f601415
good examples
asinghvi17 Apr 20, 2023
024c1a5
add better spines
asinghvi17 Apr 20, 2023
9493e4f
Incorporate Geodesy.jl for Cartesian coordinates for Earth
asinghvi17 Apr 23, 2023
2973f50
Fix multiple crs in one thing
asinghvi17 Apr 23, 2023
138a5de
Move geostationary example to the main folder
asinghvi17 Apr 23, 2023
e7711c6
fix up the docs
asinghvi17 Apr 23, 2023
bb84065
Fix examples up for new Literate stuff a bit
asinghvi17 Apr 23, 2023
a23f684
Minor bugfixes
asinghvi17 Apr 23, 2023
70fa628
Dox the docs
asinghvi17 Apr 24, 2023
09a7525
Use the transformed-space branch of Makie
asinghvi17 Apr 24, 2023
130295d
fix error in docs
asinghvi17 Apr 24, 2023
0543b23
better comments, minor fixes
asinghvi17 Apr 24, 2023
c470b41
add a simpler multicrs example
asinghvi17 Apr 24, 2023
d98b6a2
Fix orthographic example
asinghvi17 Apr 24, 2023
9d55449
fix getting the transformation
asinghvi17 Apr 24, 2023
6a61171
Basic progress towards axis frames
asinghvi17 Apr 24, 2023
43a00d6
allow npoints to be customized, add benchmarks
asinghvi17 Apr 25, 2023
8ca2f4b
Add more detail to the nonlinear transforms page
asinghvi17 Apr 25, 2023
28759ff
try to fix everything
asinghvi17 Apr 25, 2023
2610a12
More doc fixes
asinghvi17 Apr 25, 2023
9c1d6f0
Merge branch 'master' into sd/block-axis2
asinghvi17 Apr 27, 2023
7b0ed9b
merge master and update for [email protected]
SimonDanisch Nov 22, 2023
c410f53
get docs to build
SimonDanisch Nov 23, 2023
ae646d7
add ticks
SimonDanisch Nov 24, 2023
5bfba5f
fix yticks
TabeaW Nov 26, 2023
cb18daa
clean up tick finding
SimonDanisch Jan 3, 2024
c32ddb6
fallback for plots
SimonDanisch Jan 3, 2024
d383cb8
better ticks, x/ylimits and clean up
SimonDanisch Jan 4, 2024
02d62ef
dont use makie master
SimonDanisch Jan 4, 2024
3784227
display projections
SimonDanisch Jan 4, 2024
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
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ version = "0.5.1"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08"
GeoJSON = "61d90e0f-e114-555e-ac52-39dfb47a3ef9"
Geodesy = "0ef565a4-170c-5f04-8de2-149903a85f3d"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -22,10 +24,10 @@ Colors = "0.12"
Downloads = "1"
GeoInterface = "0.5, 1.0"
GeoJSON = "0.6,0.7"
GeometryBasics = "0.4.4, 0.4.5, 0.4.6"
GeometryBasics = "0.4.6"
ImageIO = "0.6"
Makie = "0.19"
Proj = "1.2.0"
Makie = "0.20"
Proj = "1.2"
Reexport = "1"
StructArrays = "0.4, 0.5, 0.6"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ field = [exp(cosd(lon)) + 3(lat/90) for lon in fieldlons, lat in fieldlats]
img = rotr90(GeoMakie.earth())
land = GeoMakie.land()

fig = Figure(resolution = (1000, 1000))
fig = Figure(size = (1000, 1000))

ga1 = GeoAxis(fig[1, 1]; dest = "+proj=ortho", coastlines = true, lonlims = (-90, 90), title = "Orthographic\n ")
ga2 = GeoAxis(fig[1, 2]; dest = "+proj=moll", title = "Image of Earth\n ")
ga3 = GeoAxis(fig[2, 1]; coastlines = false, title = "Plotting polygons")
ga4 = GeoAxis(fig[2, 2]; dest = "+proj=natearth", title = "Auto limits") # you can plot geodata on regular axes too

surface!(ga1, fieldlons, fieldlats, field; colormap = :rainbow_bgyrm_35_85_c69_n256, shading = false)
surface!(ga1, fieldlons, fieldlats, field; colormap = :rainbow_bgyrm_35_85_c69_n256, shading = NoShading)
image!(ga2, -180..180, -90..90, img; interpolate = false) # this must be included
poly!(ga3, land[50:100]; color = 1:51, colormap = (:plasma, 0.5))
poly!(ga4, land[22]); datalims!(ga4)
Expand Down
1 change: 1 addition & 0 deletions assets/ne_10m_populated_places_simple.geojson

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/ne_110m_land.geojson

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions assets/vector/countries.geo.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
GeoJSON = "61d90e0f-e114-555e-ac52-39dfb47a3ef9"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
Geodesy = "0ef565a4-170c-5f04-8de2-149903a85f3d"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"

[compat]
Documenter = "0.27"
64 changes: 0 additions & 64 deletions docs/generate_examples.jl

This file was deleted.

45 changes: 39 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using Documenter, GeoMakie, CairoMakie
CairoMakie.activate!()
using Documenter, Literate
using GeoMakie, CairoMakie, Makie
# Set some global settings
# Good quality CairoMakie with PNG
CairoMakie.activate!(px_per_unit = 2, type = :png)
# Rasters should download into the artifacts folder (so they can be cached :D)
ENV["RASTERDATASOURCES_PATH"] = joinpath(first(Base.DEPOT_PATH), "artifacts")

# invoke some geomakie things to be sure
GeoMakie.coastlines()
Expand All @@ -11,18 +16,46 @@ if deploy && !haskey(ENV, "GITHUB_TOKEN")
deploy = false
end

include("generate_examples.jl")
# use Literate for examples
examples = readdir(joinpath(dirname(@__DIR__), "examples"); join = true)
exclude = Set(["geodesy.jl", "makiecon_examples.jl", "multiple_crs.jl"])
filter!(examples) do file
isfile(file) && !(basename(file) in exclude) && endswith(file, ".jl")
end
for example in examples
Literate.markdown(example, joinpath(@__DIR__, "src"); documenter = true)
end

makedocs(;
modules=[GeoMakie],
doctest=false,
format=Documenter.HTML(; prettyurls=deploy, collapselevel=3),
pages=[
"GeoMakie.jl" => "index.md",
"Examples" => "examples.md"
"Nonlinear transforms" => "nonlinear_transforms.md",
"Examples" => [
"Basic examples" => "basic.md",
"New API" => "new.md",
"Orthographic projection" => "orthographic.md",
"Geostationary satellite image" => "geostationary_image.md",
"Contourf" => "contourf.md",
# "Multiple CRS" => "multiple_crs.md",
"World Population centers" => "world_population.md",
"Field and countries" => "field_and_countries.md",
"Mesh image recipe" => "meshimage.md",
# "Geodetic transformation to the sphere" => "geodesy.md",
"Axis configuration" => "axis_config.md",
# "Italy's states" => "italy.md",
"Most Projections" => "most_projections.md",
"Projections" => "projections.md",
# "GraphMakie with GeoMakie" => "graph_on_usa.md",
],
"Developer documentation" => [
"Architecture" => "architecture.md",
]
],
sitename="GeoMakie.jl",
authors="Makie.jl contributors",
strict=true)
authors="Anshul Singhvi and the Makie.jl contributors",
)

deploy && deploydocs(; repo="github.com/MakieOrg/GeoMakie.jl", target="build", push_preview=true)
Empty file added docs/src/architecture.md
Empty file.
41 changes: 41 additions & 0 deletions docs/src/axis_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
```@meta
EditURL = "../../examples/axis_config.jl"
```

How to mess with GeoAxis
!!! warning
This was written for the old API and doesn't work for the new one!

````@example axis_config
using Makie, CairoMakie, GeoMakie

fig = Figure(size = (500,1000))
````

GeoAxis defaults to DataAspect()
Set source projection and destination projection
source can be overwritten per plot

````@example axis_config
ax1 = GeoAxis(fig[1, 1]; aspect=nothing, source="+proj=latlong", dest="+proj=ortho")
xlims!(ax1, -90, 90) # xlims!, ylims! and limits! are supported
````

But supports any other Makie aspect ratio

````@example axis_config
ax2 = GeoAxis(fig[2, 1]; aspect=AxisAspect(1.3), xgridstyle=:dashdot, xgridcolor = :blue,
ygridcolor=(:orange, 0.5), ygridwidth=5.0)
````

axis 3 - customizing ticks

````@example axis_config
ax2 = GeoAxis(fig[3, 1]; xticks = -180:2:180)
fig
````

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

51 changes: 51 additions & 0 deletions docs/src/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
```@meta
EditURL = "../../examples/basic.jl"
```

````@example basic
using GeoMakie

lons = -180:180
lats = -90:90
````

Create some field of values across `lons` and `lats`
This grid can be of any density, but note that the
time it takes to plot scales with the grid size!

````@example basic
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]
using GLMakie
GLMakie.activate!(float=true)
````

Surface example

````@example basic
fig = Figure()
ax = GeoAxis(fig[1,1])
sp = surface!(ax, lons, lats, field; shading = NoShading)
fig
````

To save, run e.g. `save("surf_example.png", fig; px_per_unit=2)`.

Scatter example

````@example basic
slons = rand(lons, 2000)
slats = rand(lats, 2000)
sfield = [exp(cosd(l)) + 3(y/90) for (l,y) in zip(slons, slats)]

fig = Figure()
ax = GeoAxis(fig[1,1])
scatter!(slons, slats; color = sfield)
fig
````

To save, run e.g. `save("scatter_example.png", fig; px_per_unit=2)`.

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

32 changes: 32 additions & 0 deletions docs/src/contourf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
```@meta
EditURL = "../../examples/contourf.jl"
```

````@example contourf
using Makie, GeoMakie, CairoMakie

lons = -180:180
lats = -90:90
````

Create some field of values across `lons` and `lats`
This grid can be of any density, but note that the
time it takes to plot scales with the grid size!

````@example contourf
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]
````

Surface example

````@example contourf
fig = Figure()
ax = GeoAxis(fig[1,1])
contourf!(ax, lons, lats, field; shading = NoShading)
fig
````

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

56 changes: 56 additions & 0 deletions docs/src/field_and_countries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
```@meta
EditURL = "../../examples/field_and_countries.jl"
```

This example was taken from Lazaro Alonso's
BeautifulMakie.jl repository. It has some really
good stuff - check it out!

````@example field_and_countries
using Makie, CairoMakie, GeoMakie
import Downloads
using GeoMakie.GeoJSON
using GeometryBasics
using GeoMakie.GeoInterface
````

https://datahub.io/core/geo-countries#curl # download data from here

````@example field_and_countries
path = GeoMakie.assetpath("vector", "countries.geo.json")
json_str = read(path, String)
worldCountries = GeoJSON.read(json_str)
n = length(worldCountries)
lons = -180:180
lats = -90:90
field = [exp(cosd(l)) + 3(y/90) for l in lons, y in lats]

fig = Figure(size = (1200,800), fontsize = 22)

ax = GeoAxis(
fig[1,1];
dest="+proj=wintri",
title = "World Countries",
tellheight = true,
)

hm1 = surface!(ax, lons, lats, field; shading = NoShading)
translate!(hm1, 0, 0, -10)

hm2 = poly!(
ax, worldCountries;
color= 1:n,
colormap = Reverse(:plasma),
strokecolor = :black,
strokewidth = 0.25
)

cb = Colorbar(fig[1,2]; colorrange = (1, n), colormap = Reverse(:plasma), label = "variable, color code", height = Relative(0.65))

fig
````

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

Loading
Loading