-
Notifications
You must be signed in to change notification settings - Fork 107
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
expand xarray capabilities #755
Conversation
@@ -118,7 +120,7 @@ def info(self) -> Info: | |||
|
|||
meta = { | |||
"bounds": self.bounds, | |||
"crs": CRS_to_uri(self.crs), | |||
"crs": CRS_to_uri(self.crs) or self.crs.to_wkt(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match what we do in io.rasterio.Reader
"attrs": { | ||
k: (v.tolist() if isinstance(v, (numpy.ndarray, numpy.generic)) else v) | ||
for k, v in self.input.attrs.items() | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a possible issue in titiler where pydantic wouldn't be able to serialize the attrs
because pydantic do not handle well numpy arrays
height=height, | ||
reproject_method=reproject_method, | ||
resampling_method=resampling_method, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature() now use part()
method (as we do in io.rasterio.Reader)
assert info | ||
assert info.model_dump() | ||
assert info.model_dump(mode="json") | ||
assert info.model_dump_json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test pydantic serialization
self.bounds[0] + xres / 2 < -180 | ||
or self.bounds[1] + yres / 2 < -90 | ||
or self.bounds[2] - xres / 2 > 180 | ||
or self.bounds[3] - yres / 2 > 90 | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @noahgolmant
closes #754
…756) * check if the Y bounds are inverted and flip the image on the Y axis * Update tests/test_io_xarray.py Co-authored-by: Henry Rodman <[email protected]> * Update tests/test_io_xarray.py Co-authored-by: Henry Rodman <[email protected]> --------- Co-authored-by: Henry Rodman <[email protected]>
This PR does:
preview()
andstatistics()
method to the XarrayReaderpreview
,part
andfeature
methodscc @abarciauskas-bgse @maxrjones @hrodmn
To Do