- Fix for an issue with GDAL 3.10.1 on Linux whereby we hit deadlock in GDAL when using parallel save in Yirgacheffe. All workers seemed to deadlock in GDAL, which was stopped by disabling GDAL from using multiple threads when invoked by the workers.
- Don't attempt to use float64 for GPU path.
- Added module level
to_geotiffwhich allows creation of multiband geotiffs. - Support for "sum" resampling method on reprojected layers.
- Support left shift and right shift of layers by either other layers or a constant.
- If you provide a calculation to an output layer that is a different size, don't error, but use the output size. This in theory should not be a change if you've only ever used newer APIs (1.7 and up).
- If you have a global constant layer on an operator that has union composition (addition) keep with the global layer until the top of the expression, then crop to real data.
- Be more nuanced in trying to correct GDAL's abuse of RuntimeError for OSError.
- If an expression throws a runtime error in the calculation during
to_geotiff, it now cleans up the temporary file that was being written. - If creating a file in a directory that doesn't exist, create that directory first. In theory this was already happening but the check was in the wrong place.
- Added unary negative and positive operator.
- If the indicates parallelism should be used, tell GDAL to use multiple threads also, significantly improving LZW compression performance.
- Reduce initial import time.
- Make area per pixel layer work with GeoTiffs with non-geographic projections that lack bounds in the projection description.
- Added a new area-per-pixel layer, which when given a map projection with pixel scale generates a new raster layer where the value in each pixel is the square metre area of that pixel.
- Added a
to_graphvizcall for expressions to help with debugging. - Support sparse GeoTIFF creation.
- Ensure datatype is correctly propegated through
astypeoperator.
- Added
yg.sum,yg.all,yg.anyto build layers from lists of layers. - Cache limits applied to GDAL and MLX which tend to assume that they are the only thing using memory. You can override these by adjusting
yg.constants.GDAL_CACHE_LIMITandyg.constants.MLX_CACHE_LIMIT.
- Added some type checking on read_rasters due to people misunderstand the API.
- Issue found where conv2d interacted badly with group layers.
- Added new file opening
read_raster_likethat will dynamically reproject a raster to the map projection of another layer using the specified resampling method.
- Allow
Area.project_liketo convert between projections. - Provide a version of
uniquesimilar to that found in numpy.
- Fixed issue where due to GDAL behaviour layers read in with EPSG:5845 would save with an altered projection that didn't maintain quality when reloaded.
- Fixed issue with using map projections that don't align origin with EPSG:4326.
- Add
nodatasupport toto_geotiff.
- Fixed a bug whereby the grid to which polygons was rasterized would wobble depending on the context of the reading the array.
- Ensure that nearest neighbour is applied consistently when using layers that are at the same geospatial resolution but not exactly aligned.
- Allow set operations | (union) and & (intersection) on Area types.
- Approximations used in comparing pixel scales and rounding down/up arrays are now projection aware, rather than always done in EPSG:4326.
- Fix issue with creating data layers from numpy arrays where an exception was thrown due to rounding issues on projection math.
- Improved consistency between Numpy and MLX backends when calling sum
- Detect if
to_geotiffis being targetted at a GDAL virtual file, in which case don't use a temporary directory.
- Added
sizeofto the DataType enumeration to get number of bytes a given type requires.
- Support for reverse operators, so that now you can write
1 + layerjust as you could writelayer + 1, rather than having to cast left hand constants toyg.constant(1) + layer - Implemented common subexpression elimination to improve performance.
- Area and Window @dataclass types are marked as frozen (i.e., are immutable).
- Test elements for
isincan now include sets, not just lists and tuples.
- Grow on Window class calculated updated y offset incorrectly, which impacted
conv2dusage.
- Added
from_arraymethod to generate layer from numpy array directly.
- Exposed the callback parameter to
to_geotiff.
- Unit tests now covered by mypy checks
- Exposed operator functions on top level, so you can do
yg.whererather thanyg.operators.where, ready for 2.0.
- Calling
showwith too little data gave a downsample skip of zero. Now don't downsample if data is too few.
- Added a
showmethod to layers/expressions to render them using matplotlib.
- Moved
latlng_for_pixelandpixel_for_latlngtoLayerMathMixinso they can be called on expressions as well as concrete layers.
- Added code of conduct to project.
- Added the ability to call
read_arrayon expressions (before you could only call it on layers).
- The first argument of MapProjection, the string defining the projection used is now validated with the pyproj library, and can be in any from the pyproj
from_stringtakes: Well Known Text (WKT) or "epsg:4326" or "esri:54009" etc. The name function still returns the WKT representation for backwards compatibility. - The functions
pixel_from_latlngandlatlng_from_pixelwill work regardless of the underlying map projection.
- Fixed issue whereby calling
set_window_for_intersectionwould fail if the pixel alignment on a vector layer was rounded unfortunately.
- More documentation updates.
- Mkdocs based documentation.
- Modernised type hints to use latest Python standards.
- Fix type inference for expressions so that
to_geotiffselects correct GeoTIFF file type to store results as.
- Improved typing of methods that take a filename to use both Path and str.
- Added marker for mypy that Yirgacheffe has type annotations
- Automatically set rlimit for NOFILES so that parallel operations of machines with many cores don't run out of file descriptors.
- Removed internal classes
LayerOperation,LayerMathMixin, andLayerConstantfrom public interface.
- Fixed issue whereby vector layers without explicit projection would use the abstract rather than concrete area value when generating a target raster.
- Added a core wrapper
constantto save people usingConstantLayerexplicitly - Added a core wrapper
read_narrow_rasterto save people usingUniformAreaLayerexplicitly
- Minor improvements to GitHub Actions workflows
- Fixed bug whereby reads from within a single tile that has nodata values in a group layer used the wrong numpy call to check for nan.
- Added
isnanoperator.
- Fixed an issue introduced in 1.7.0 where
find_intersectionandfind_unionused the raw, non-pixel aligned area envelope.
- Added the option to set
parallelism=Truerather than just a number when callingto_geotiff, allowing Yirgacheffe to select the number of CPU cores to use for parallel operations.
- Fixed an issue whereby if you used the MLX backend and called
read_arraythe return value was sometimes an mlx array rather than a numpy array.
- Support the ability to create VectorLayers that don't have a pixel scale or projection added. These layers will have the correct pixel scale and projection calculated when calculations on layers are saved or aggregated based on the other raster layers used in the calculation.
- Added MapProjection object to replace PixelScale objects and projection strings being separate parameters.