github rasterio/rasterio 1.4a1

latest releases: 1.4a3, 1.4a2
pre-release2 months ago

The first 1.4 pre-release is on the package index this morning. There are a number of changes to be aware of. Not all tests pass on Windows yet due to some not yet understood behavior around the default data type of Numpy arrays on the GitHub runners for that platform.

Python support

Rasterio 1.4 requires Python version 3.9 or newer.

Deprecations

  • The is_tiled property of a dataset will be removed in a future version and a pending deprecation warning will be raised if it is used (#3015). This warning may be changed to a deprecation warning at version 1.5.0. Please consider copying the body of the property to your own project. It's just one line.
  • The is_valid property of the CRS class is not useful and will be removed in version 2.0 (#2919).
  • The FilePath class has been supplanted by rasterio.open's new opener keyword argument and its associated GDAL virtual filesystem plugin. It will be removed in version 2.0 (#2919).

New Features

  • The Window class has a new round() method (#3022). It has the same parameter as Python's built in round() and applies it to the window's offsets and lengths. It is used internally to avoid sub-pixel errors when reading from and writing to datasets.
  • The merge tool and merge CLI command can create very large output datasets without using more memory than the user chooses (#3022). Merge output is processed in chunks that default to 64 MB.
  • Errors that GDAL handles internally within GDALDatasetRasterIO() and GDALRasterIO() and WarpAndChunk() are chained together to be visible and accessable from Python (#2526).
  • The new "rio create" command allows creation of new, empty datasets (#3023).
  • An optional range keyword argument (like that of numpy.histogram()) has been added to show_hist() (#2873, #3001).
  • Datasets stored in proprietary systems or addressable only through protocols not directly supported by GDAL can be accessed using the new opener keyword argument of rasterio.open() (#2898, #2907). This new feature is intended to completely replace the FilePath class introduced in 1.3.0.
  • Deallocate list of warp extras in _reproject(), fixing a potential leak (#494).
  • Adjust several tests to small differences in output between GDAL 3.7 and 3.8 (#2959).
  • The output file size limits of rio-warp were made redundant by changes to the GTiff driver in GDAL 2.1 and have been removed (#2889). A --dry-run option has been added to the command. If used, the profile of the output dataset will be printed and no warping will occur.

Bug fixes

  • Avoid squeezing narrow 2-D arrays to 1-D (#3008).
  • Operations on closed MemoryFile and ZipMemoryFile objects now raise ValueError as with other Python file objects (#2870, #).
  • Delay clamping of I/O windows until just before GDAL methods calls to improve accuracy of sub-pixel reads (#2864).

Other changes

  • The logic of is_tiled has been simplified to match GDAL's own internal logic and do nothing more. It's now only a test that a raster's block width is not equal to the raster width (#3015).
  • rasterize() better matches the behavior of Numpy array constructors. It no longer reduces the bit width of output, returning either float64 or int64 arrays unless a data type is explicitly selected, and the fill parameter no longer has an effect on the default data type (#3003).
  • Rasterio now vendors and modifies the snuggs module (#2956).
  • Given an empty shapes argument, rasterize() now returns an empty array (#2993).
  • AffineTransformer's bulk transformations have been sped up by replacing a loop with a Numpy ufunc (#2936).
  • The crop and invert mutual exclusivity test in raster_geometry_mask() has been removed (#2702).

Don't miss a new rasterio release

NewReleases is sending notifications on new releases.