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

Codecov02 #145

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading