Skip to content

Commit

Permalink
Merge pull request #145 from gaelforget/codecov02
Browse files Browse the repository at this point in the history
Codecov02
  • Loading branch information
gaelforget authored Sep 15, 2024
2 parents f86be5d + 48634b4 commit 0af3790
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
9 changes: 5 additions & 4 deletions ext/MeshArraysMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,20 @@ function json_to_Makie(file="countries.geojson")

tmp22=Vector{Point2{Float64}}[]
for l1 in tmp2
if isa(l1[1][1],Vector{Float64})
push!(tmp22,geo2basic(l1[1]))
if isa(l1[1][1],Tuple)
push!(tmp22,geo2basic(tuple2vec.(l1[1])))
else
for l2 in l1
push!(tmp22,geo2basic(l2[1]))
push!(tmp22,geo2basic(tuple2vec.(l2[1])))
end
end
end

LineString.(tmp22)
end

tuple2vec(x)=[y for y in x]

"""
shp_to_Makie(file="countries.geojson")
Expand Down Expand Up @@ -520,7 +522,6 @@ function geo2basic(vector::AbstractVector{<:AbstractVector})
end
end


##

"""
Expand Down
16 changes: 14 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,19 @@ end
proj=Proj.Transformation(MA_preset=2,lon0=lon0)
Dint=reshape(Interpolate(D,λ.f,λ.i,λ.j,λ.w),size.lon))

# fil=demo.download_polygons("countries.geojson")
# pol=MeshArrays.read_polygons(fil)
###

fil=demo.download_polygons("countries.geojson")
pol=MeshArrays.read_polygons(fil)

MeshArraysMakieExt = Base.get_extension(MeshArrays, :MeshArraysMakieExt)
dest="+proj=eqearth +lon_0=$(lon0) +lat_1=0.0 +x_0=0.0 +y_0=0.0 +ellps=GRS80"
MeshArraysMakieExt.split(pol,dest)
MeshArraysMakieExt.split(pol,Observable(dest))
MeshArraysMakieExt.split(Observable(pol),Observable(dest))
MeshArraysMakieExt.split(Observable(pol),dest)

###

fil=demo.download_polygons("ne_110m_admin_0_countries.shp")
pol=MeshArrays.read_polygons(fil)
Expand All @@ -236,6 +247,7 @@ end
meta=(colorrange=(0.0,6000.0),cmap=:BrBG_10,ttl="Ocean Depth (m)",lon0=lon0)
data=(lon=λ.lon,lat=λ.lat,var=Dint,meta=meta) #,polygons=pol)
plot_examples(:projmap,data,lon0,proj)
plot_examples(:simple_heatmap,data)

end

Expand Down

0 comments on commit 0af3790

Please sign in to comment.