Skip to content

Commit

Permalink
Implement crs for AbstractGeoTable
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Nov 7, 2024
1 parent 03a1cdb commit 216cf04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GeoTables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import DataAPI: nrow, ncol
import Meshes: partitioninds
import Meshes: sampleinds
import Meshes: sortinds
import Meshes: crs
import TransformsBase: apply, revert, reapply

# required for VSCode table viewer
Expand Down
2 changes: 2 additions & 0 deletions src/abstractgeotable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ function Base.parentindices(geotable::AbstractGeoTable)
end
end

crs(geotable::AbstractGeoTable) = crs(domain(geotable))

# -----------
# IO METHODS
# -----------
Expand Down
5 changes: 5 additions & 0 deletions test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
@test parentindices(dat) == inds
@test isnothing(values(pdat))

# coordinate reference system (crs)
dom = CartesianGrid(2, 2)
dat = dummy((a=[1, 2, 3, 4], b=[5, 6, 7, 8]), dom)
@test crs(dat) == crs(dom)

# Tables interface
dom = CartesianGrid(2, 2)
dat = dummy((a=[1, 2, 3, 4], b=[5, 6, 7, 8]), dom)
Expand Down

0 comments on commit 216cf04

Please sign in to comment.