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

Fix issue if xarray/rioxarray dataset does not have a crs value #1020

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

niowniow
Copy link
Contributor

@niowniow niowniow commented Dec 13, 2024

Adds a check to the array_to_memory_file function that verifies if the crs provided by the array (from array.rio.crs) is not None.

Without it, there is no way to overwrite the crs using the keyword arguments of the array_to_memory_file function and as a consequence the given error message ("crs must be provided if source is not provided, such as EPSG:3857") is confusing because setting the crs argument has no effect.

Just for completeness, the current workaround would be to set crs before calling array_to_memory_file

array.rio.write_crs("EPSG:3857", inplace=True)

@giswqs giswqs merged commit d5ce31b into opengeos:master Dec 13, 2024
14 of 15 checks passed
@niowniow niowniow deleted the fix_crs_in_array_to_memory_file branch December 13, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants