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

Breaking: Standardise cf standards and missingval handling #695

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 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
2 changes: 1 addition & 1 deletion docs/src/gbif_wflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Or convert them to a `DataFrame`:
using DataFrames
df = DataFrame(predictors)
df[1:5,:]
````
````
20 changes: 20 additions & 0 deletions ext/GeometryOpsDimensionalDataExt/GeometryOpsDimensionalDataExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module GeometryOpsDimensionalDataExt
Copy link
Collaborator

@asinghvi17 asinghvi17 Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we close the PR that does this in GeometryOps?

Copy link
Owner Author

@rafaqz rafaqz Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I must have added that by mistake lol


import DimensionalData as DD
import GeometryOps as GO
import GeoInterface as GI

function GO.polygonize(A::DD.AbstractDimArray; dims=(DD.X(), DD.Y()), crs=GI.crs(A), kw...)
lookups = DD.lookup(A, dims)
bounds_vecs = if DD.isintervals(lookups)
map(DD.intervalbounds, lookups)
else
@warn "`polygonsize` is not possible for `Points` sampling, as polygons cover space by definition. Treating as `Intervals`, but this may not be appropriate"
map(lookups) do l
Dd.intervalbounds(DD.set(l, DD.Intervals()))
end
end
GO.polygonize(bounds_vecs..., DD.AbstractDimArray; crs, kw...)
end

end
13 changes: 6 additions & 7 deletions ext/RastersArchGDALExt/RastersArchGDALExt.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module RastersArchGDALExt

@static if isdefined(Base, :get_extension) # julia < 1.9
using Rasters, ArchGDAL
else
using ..Rasters, ..ArchGDAL
end
using Rasters
using ArchGDAL

import DiskArrays,
Extents,
Expand All @@ -16,13 +13,15 @@ using DimensionalData,

using Rasters.Lookups
using Rasters.Dimensions
using Rasters: GDALsource, AbstractProjected, RasterStackOrArray, FileArray, NoKW,
using Rasters: GDALsource, AbstractProjected, AbstractRaster, AbstractRasterStack,
RasterStackOrArray, FileArray, NoKW,
RES_KEYWORD, SIZE_KEYWORD, CRS_KEYWORD, FILENAME_KEYWORD, SUFFIX_KEYWORD, EXPERIMENTAL,
GDAL_EMPTY_TRANSFORM, GDAL_TOPLEFT_X, GDAL_WE_RES, GDAL_ROT1, GDAL_TOPLEFT_Y, GDAL_ROT2, GDAL_NS_RES,
_no_crs_error

import Rasters: reproject, resample, warp, cellsize, nokw
import Rasters: reproject, resample, warp, cellsize, nokw, isnokw, isnokwornothing

const AG = ArchGDAL
const RA = Rasters
const DD = DimensionalData
const DA = DiskArrays
Expand Down
Loading
Loading