[rasterio] `pyproj.CRS` typing
As far as I'm aware, all methods that take a CRSInput should be able to take pyproj.CRS so this type should be added to the TypeAlias. Is there any objections, limitations, or considerations before I take a look into adding this @thomas-maschler ?
I raise this as our codebase supplies a few differernt rasterio methods we use with a pyproj.CRS, and now these get flagged by our linting tools as invalid argument types. Methods we use with pyproj.CRS and work include:
rasterio.warp.transform_boundsrasterio.warp.reprojectrasterio.io.MemoryFile.open
I have no experience with the rasterio package, but maybe the CRSInput type should be extended according to what is accepted by CRS.from_user_input?
https://github.com/rasterio/rasterio/blob/5044f0c8cd08655c63c8b2e452618254c15d8f29/rasterio/crs.pyx#L816
Last thing I recall is that they have similar features but are not the same
I am currently traveling and don't have access for my keyboard to verify. I can check once back in two weeks.
@jack-volantautonomy I looked into this. pyproj is not part of the dependency tree. rasterio converts the foreign CRS type into rasterio.CRS using CRS.from_user_input. This will work for all objects that expose a to_wkt method, not just pyproj.CRS.
In my PR I added a protocol to capture this, similar to what we already have for geometries with a geo_interface.
Have reviewed the PR and approved. Nice work.