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

XY refactor #11

Merged
merged 17 commits into from Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions odc/geo/__init__.py
Expand Up @@ -10,6 +10,22 @@

from ._version import __version__

from .types import (
XY,
Index2d,
Resolution,
SomeShape,
SomeResolution,
SomeIndex2d,
xy_,
yx_,
res_,
resxy_,
resyx_,
ixy_,
iyx_,
)

from .crs import (
CRS,
CRSError,
Expand All @@ -26,6 +42,12 @@

__all__ = [
"__version__",
"XY",
"Index2d",
"Resolution",
"SomeShape",
"SomeResolution",
"SomeIndex2d",
"BoundingBox",
"CoordList",
"CRS",
Expand All @@ -34,4 +56,11 @@
"Geometry",
"MaybeCRS",
"SomeCRS",
"xy_",
"yx_",
"res_",
"resxy_",
"resyx_",
"ixy_",
"iyx_",
]
6 changes: 3 additions & 3 deletions odc/geo/_xr_interop.py
Expand Up @@ -280,9 +280,9 @@ def _locate_geo_info(src: XarrayObject) -> GeoState:
crs = _get_crs_from_attrs(src, sdims)

if transform is not None:
width = _xx.shape[0]
height = _yy.shape[0]
geobox = GeoBox(width, height, transform, crs)
nx = _xx.shape[0]
ny = _yy.shape[0]
geobox = GeoBox((ny, nx), transform, crs)

return GeoState(spatial_dims=sdims, transform=transform, crs=crs, geobox=geobox)

Expand Down