Skip to content

Inconsistency between sieve() docstring and behavior #3383

@jtsilverio

Description

@jtsilverio

The rasterio.features.sieve function docs states that it works with integer and float32 types. However, the code and actual behavior of rasterio.features.sieve only accepts interger types:

valid_dtypes = ('int16', 'int32', 'uint8', 'uint16')

Running the code belowe always returns ValueError: image dtype must be one of: rasterio.int16, rasterio.int32, rasterio.uint8, rasterio.uint16, despite documentation saying it would accept float32.

import numpy
from rasterio.features import sieve

m = numpy.eye(5, dtype=numpy.float32)
res = sieve(m, 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions