Skip to content

Rasterio CRS-attribute can be None #1520

Closed
@leeviannala

Description

@leeviannala

open_rasterio does not work when rasterio crs is None. It is also clearly visible from the code that this is the case: Here's the code from line 144 onward

attrs = {}`
    if hasattr(riods, 'crs'):
        # CRS is a dict-like object specific to rasterio
        # We convert it back to a PROJ4 string using rasterio itself
        attrs['crs'] = riods.crs.to_string()
    if hasattr(riods, 'res'):
        # (width, height) tuple of pixels in units of CRS
        attrs['res'] = riods.res
    if hasattr(riods, 'is_tiled'):
        # Is the TIF tiled? (bool)
        # We cast it to an int for netCDF compatibility
        attrs['is_tiled'] = np.uint8(riods.is_tiled)
    if hasattr(riods, 'transform'):
        # Affine transformation matrix (tuple of floats)
        # Describes coefficients mapping pixel coordinates to CRS
        attrs['transform'] = tuple(riods.transform)`

I have version 1.0a9 for rasterio and 0.9.6 for xarray. For what I looked, the issue #1466 is related, but not same issue.

CRS is None when I read ENVI-dataset that has no georeferencing with rasterio.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions