Pygeoprocessing

Latest version: v2.4.3

Safety actively analyzes 630094 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 10

1.4.1

------------------
* Hotfix that fixes an issue that would cause ``zonal_statistics`` to crash if
a polygon were outside of the raster's bounding box.

1.4.0

------------------
* Adding error checking to ensure that ``target_pixel_size`` passed to
``warp_raster`` and ``align_and_resize_raster_stack`` are validated to ensure
they are in the correct format. This solves an issue where an incorrect
value, such as a single numerical value, resolve into readable exception
messages.
* Added a ``gdal_warp_options`` parameter to ``align_and_resize_raster_stack``
and ``warp_raster`` whose contents get passed to gdal.Warp's ``warpOptions``
parameter. This was implemented to expose the CUTLINE_TOUCH_ALL
functionality but could be used for any gdal functionality.
* Modified ``rasterize`` API call to make ``burn_values`` and ``option_list``
both optional parameters, along with error checking to ensure a bad input's
behavior is understood.
* Exposing GeoTIFF creation options for all the ``pygeoprocessing.routing``
functions which create rasters. This is consistent with the creation
options exposed in the main ``pygeoprocessing`` API.
* Removing ``'mean_pixel_size'`` as a return value from ``get_raster_info``,
this is because this parameter is easily misused and easily calculated if
needed. This is a "What good programmers need, not what bad programmers
want." feature.

1.3.1

------------------
* Hotfix to patch an infinite loop when aggregating upstream or downstream
with custom rasters.

1.3.0

------------------
* Fixed a handful of docstring errors.
* Improved runtime of ``zonal_statistics`` by a couple of orders of magnitude
for large vectors by using spatial indexes when calculating disjoint polygon
overlap sets, using database transactions, and memory buffers.
* Improved runtime performance of ``reproject_vector`` by using database
transactions.
* Improved logging for long runtimes in ``zonal_statistics``.
* Changed ``zonal_statistics`` API and functionality to aggregate across the
FIDs of the aggregate vector. This is to be consistent with QGIS and other
zonal statistics functionality. Additionally, fixed a bug where very small
polygons might not get aggregated if they lie in the same pixel as another
polygon that does not intersect it. The algorithm now runs in two passes:

* aggregate pixels whose centers intersect the aggregate polygons
* any polygons that were not aggregated are geometrically intersected
with pixels to determine coverage.

* Removed the ``calculate_raster_stats`` function since it duplicates GDAL
functionality, but with a slower runtime, and now functions in
``pygeoprocessing`` that create rasters also calculate stats on the fly if
desired.
* Fixes an issue in ``get_raster_info`` and ``get_vector_info`` where the path
to the raster/vector includes non-standard OS pathing (such as a NETCDF),
info will still calculate info.
* Added functionality to ``align_raster_stack`` and ``warp_raster`` to define
a base spatial reference system for rasters if not is not defined or one
wishes to override the existing one. This functionality is useful when
reprojecting a rasters that does not have a spatial reference defined in the
dataset but is otherwise known.
* Added a ``weight_raster_path_band`` parameter to both
``flow_accumulation_d8`` and ``flow_accumulation_mfd`` that allows the
caller to use per-pixel weights from a parallel raster as opposed to
assuming a weight of 1 per pixel.
* Added a ``weight_raster_path_band`` parameter to both
``distance_to_channel_mfd`` and ``distance_to_channel_d8`` that allows the
caller to use per-pixel weights from a parallel raster as opposed to
assuming a distance of 1 between neighboring pixels or sqrt(2) between
diagonal ones.
* Added an option to ``reproject_vector`` that allows a caller to specify
which fields, if any, to copy to the target vector after reprojection.
* Adding a check in ``align_and_resize_raster_stack`` for duplicate target
output paths to avoid problems where multiple rasters are being warped to
the same path.
* Created a public ``merge_bounding_box_list`` function that's useful for
union or intersection of bounding boxes consistent with the format in
PyGeoprocessing.
* Added functionality in ``align_and_resize_raster_stack`` and ``warp_raster``
to use a vector to mask out pixel values that lie outside of the polygon
coverage area. This parameter is called ``vector_mask_options`` and is
fully documented in both functions. It is similar to the cutline
functionality provided in ``gdal.Warp``.
* Fixed an issue in the ``flow_accumulation_*`` functions where a weight
raster whose values were equal to the nodata value of the flow accumulation
raster OR simply nodata would cause infinite loops.

1.2.3

------------------
* Exposing a parameter and setting reasonable defaults for the number of
processes to allocate to ``convolve_2d`` and ``warp_raster``. Fixes an issue
where the number of processes could exponentiate if many processes were
calling these functions.
* Fixing an issue on ``zonal_statistics`` and ``convolve_2d`` that would
attempt to both read and write to the target raster with two different GDAL
objects. This caused an issue on Linux where the read file was not caught up
with the written one. Refactored to use only one handle.
* Fixing a rare race condition where an exception could occur in
``raster_calculator`` that would be obscured by an access to an object that
had not yet been assigned.
* ``align_and_resize_raster_stack`` now terminates its process pool.
* Increased the timeout in joining ``raster_calculator``'s stats worker.
On a slow system 5 seconds was not quite enough time.

1.2.2

------------------
* Hotfixed a bug that would cause numpy arrays to be treated as broadcastable
even if they were passed in "raw".

Page 5 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.