rasterio.rio.helpers module

Helper objects used by multiple CLI commands.


Yield all coordinate coordinate tuples from a geometry or feature. From python-geojson package.

rasterio.rio.helpers.resolve_inout(input=None, output=None, files=None, overwrite=False)

Resolves inputs and outputs from standard args and options.

  • input – a single input filename, optional.

  • output – a single output filename, optional.

  • files – a sequence of filenames in which the last is the output filename.

  • overwrite – whether to force overwriting the output file, bool.


the resolved output filename and input filenames as a tuple of length 2.

If provided, the :param:`output` file may be overwritten. An output file extracted from :param:`files` will not be overwritten unless :param:`overwrite` is True.

rasterio.rio.helpers.to_lower(ctx, param, value)

Click callback, converts values to lowercase.

rasterio.rio.helpers.write_features(fobj, collection, sequence=False, geojson_type='feature', use_rs=False, **dump_kwds)

Read an iterator of (feat, bbox) pairs and write to file using the selected modes.