Skip to content

Commit 476adde

Browse files
authored
add Makie extension (#84)
* add Makie extension * fixes * fix Aqua * better extension name * test fixes * fix Aqua * import GeoInterfaceRecipes in tests * remove show * stop supporting < 1.9 * a typeo
1 parent becfc84 commit 476adde

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
version:
16-
- '1.6'
16+
- '1.9'
1717
- '1'
1818
- 'nightly'
1919
os:

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- uses: julia-actions/setup-julia@v1
1818
with:
19-
version: '1.6'
19+
version: '1.9'
2020
- name: Install dependencies
2121
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2222
- name: Build and deploy

Project.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version = "0.7.3"
77
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
88
GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f"
99
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
10+
GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08"
1011
GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a"
1112
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
1213
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
@@ -18,19 +19,28 @@ DataFrames = "1.6"
1819
Extents = "0.1"
1920
GeoFormatTypes = "0.4"
2021
GeoInterface = "1.2.1"
22+
GeoInterfaceMakie = "0.1"
2123
GeoInterfaceRecipes = "1"
2224
JSON3 = "1.13"
25+
Makie = "0.20"
2326
Plots = "1.39"
2427
StructTypes = "1"
2528
Tables = "1"
2629
Test = "<0.0.1,1"
27-
julia = "1.6"
30+
julia = "1.9"
31+
32+
[weakdeps]
33+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
34+
35+
[extensions]
36+
GeoJSONMakieExt = "Makie"
2837

2938
[extras]
3039
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3140
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
41+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
3242
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
3343
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3444

3545
[targets]
36-
test = ["Aqua", "DataFrames", "Plots", "Test"]
46+
test = ["Aqua", "DataFrames", "Makie", "Plots", "Test"]

ext/GeoJSONMakieExt.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module GeoJSONMakieExt
2+
using GeoInterfaceMakie: GeoInterfaceMakie
3+
using GeoJSON: GeoJSON
4+
5+
GeoInterfaceMakie.@enable GeoJSON.AbstractGeometry
6+
7+
end

test/runtests.jl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
using GeoJSON
22
import GeoInterface as GI
3+
import GeoInterfaceRecipes
34
import GeoFormatTypes
45
import Aqua
56
using Extents
67
using JSON3
78
using Tables
89
using Test
910
using Plots
11+
using Makie
1012
using DataFrames
1113

1214
include("geojson_samples.jl")
1315

1416
@testset "GeoJSON" begin
17+
@testset "Aqua.jl" begin
18+
Aqua.test_all(
19+
GeoJSON;
20+
ambiguities=(exclude=[GeoInterfaceRecipes.RecipesBase.apply_recipe],),
21+
stale_deps=(ignore=[:GeoInterfaceMakie],),
22+
)
23+
end
1524

1625
@testset "Features" begin
1726
geometries = [
@@ -47,7 +56,8 @@ include("geojson_samples.jl")
4756
geom = GeoJSON.geometry(GeoJSON.read(s))
4857
if !isnothing(geom)
4958
@test GeoJSON.coordinates(geom) == g
50-
plot(geom)
59+
Plots.plot(geom)
60+
Makie.plot(geom)
5161
end
5262
end
5363
end
@@ -65,9 +75,12 @@ include("geojson_samples.jl")
6575
(-170.0f0, 40.0f0),
6676
]],
6777
]
78+
Plots.plot(geom)
79+
Makie.plot(geom)
6880

6981
geom = GeoJSON.read(Samples.bbox)
70-
plot(geom)
82+
Plots.plot(geom)
83+
Makie.plot(geom)
7184
@test geom isa GeoJSON.LineString
7285
@test GI.crs(geom) == GeoFormatTypes.EPSG(4326)
7386
@test GeoJSON.coordinates(geom) == [(-35.1f0, -6.6f0), (8.1f0, 3.8f0)]
@@ -363,6 +376,4 @@ include("geojson_samples.jl")
363376
"{\"type\":\"Point\",\"coordinates\":[1.0,2.0,3]}"
364377
end
365378

366-
Aqua.test_all(GeoJSON)
367-
368379
end # testset "GeoJSON"

0 commit comments

Comments
 (0)