Skip to content

Commit

Permalink
more details in show
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Dec 6, 2022
1 parent 8aa85c3 commit faab23d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/show.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@

function DD.show_after(io::IO, mime::MIME"text/plain", A::AbstractRaster)

printstyled(io, "extent: "; color=:light_black)
show(io, mime, Extents.extent(A))
println()
if missingval(A) !== nothing
printstyled(io, "with missingval: "; color=:light_black)
printstyled(io, "missingval: "; color=:light_black)
print(io, string(missingval(A)), "\n")
end
if crs(A) !== nothing
printstyled(io, "crs: "; color=:light_black)
print(io, convert(String, crs(A)), "\n")
end
if mappedcrs(A) !== nothing
printstyled(io, "mappedcrs: "; color=:light_black)
print(io, convert(String, mappedcrs(A)), "\n")
end
if parent(A) isa DiskArrays.AbstractDiskArray
if parent(A) isa FileArray
printstyled(io, "\nfrom file:\n"; color=:light_black)
print(io, filename(parent(A)))
end
else
printstyled(io, "values: "; color=:light_black)
DD.print_array(io, mime, A)
end
end

function DD.show_after(io, mime, stack::AbstractRasterStack)
if parent(stack) isa FileStack
printstyled(io, "\nfrom file:\n"; color=:light_black)
printstyled(io, "from file:\n"; color=:light_black)
println(io, filename(stack))
end
end
Expand Down

0 comments on commit faab23d

Please sign in to comment.