Pygeoprocessing

Latest version: v2.4.7

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

Scan your dependencies

Page 5 of 11

1.7.0

------------------
* Removing support for Python 2.7.
* Adding D8 watershed delineation as
``pygeoprocessing.routing.delineate_watersheds_d8``.
* Corrected an issue with ``pygeoprocessing.create_raster_from_vector_extents``
where a vector with no width or no height (a vector with a single point, for
example) would result in invalid raster dimensions being passed to GDAL.
These edge cases are now guarded against.
* ``pygeoprocessing.calculate_disjoint_polygon_set`` will now raise
``RuntimeError`` if it is passed a vector with no features in it.
* ``pygeoprocessing.rasterize`` will now raise ``RuntimeError`` if the
underlying call to ``gdal.RasterizeLayer`` encounters an error.
* Correcting an issue with the docstring in
``pygeoprocessing.reclassify_raster`` to reflect the current parameters.
* Changed ``zonal_statistics`` to always return a ``dict`` instead of
sometimes a ``defaultdict``. This allows pickling of the result, if desired.
* Adding automated testing via bitbucket pipelines.
* Correcting an issue with ``pygeoprocessing.zonal_statistics`` that was
causing test failures on Python 3.6.
* Pygeoprocessing is now tested against Python 3.7.
* Fixed an issue in distance transform where a vertical striping artifact
would occur in the masked region of some large rasters when distances should
be 0.
* Fixed an issue in all functionality that used a cutline polygon with
invalid geometry which would cause a crash. This was caused by `gdal.Warp`
when using the cutline functionality. Instead this functionality was
replaced with manual rasterization. In turn this introduces two optional
parameters:

* ``rasterize`` and ``mask_raster`` have a ``where_clause`` parameter
which takes a string argument in SQL WHERE syntax to filter
rasterization based on attribute values.
* ``warp_raster`` takes a ``working_dir`` parameter to manage local
temporary mask rasters.

* Removing a temporary working directory that is created when executing
pygeoprocessing.convolve_2d.
* Changed optional parameters involving layer indexes to be either indexes
or string ids. In all cases changing ``layer_index`` to ``layer_id`` in
the functions: ``get_vector_info``, ``reproject_vector``, ``warp_raster``,
``rasterize``, ``calculate_disjoint_polygon_set``, and ``mask_raster``.

1.6.1

------------------
* Added error checking in ``raster_calculator`` to help ensure that the
``target_datatype`` value is a valid GDAL type.
* Fixed an issue in ``distance_transform_edt`` that would occasionally
cause incorrect distance calculations when the x sampling distance was > 1.

1.6.0

------------------
* Changed ``iterblocks`` API to take a raster/path band as an input rather
than a path and a list of bands. Also removed the ``astype_list`` due to
its lack of orthogonality.
* Fixed bugs in ``convolve_2d`` involving inputs with nodata masking.
* Changing default raster creation compression algorithm from LZW to DEFLATE,
this is to address issues where we were seeing recreatable, but
unexplainable LZWDecode errors in large raster data.
* Fixed an issue that could cause the distance transform to be incorrect when
the sampling distance was in the noninclusive range of (0.0, 1.0).

1.5.0

------------------
* Specific type checking for ``astype_list`` in ``iterblocks`` to avoid
confusing exceptions.
* Renamed test suite to be consistent with the pattern
``test_[component].tif``.
* Added a function ``pygeoprocessing.routing.extract_streams_mfd`` that
creates a contiguous stream layer raster to accounts for the divergent flow
that can occur with multiple flow direction. If the flow direction raster is
otherwise directly thresholded, small disjoint streams can appear where
the downstream flow drops below the threshold level.
* Fixed an issue that could cause some custom arguments to geotiff creation
options to be ignored.
* Added a ``mask_raster`` function that can be used to mask out pixels in
an existing raster that don't overlap with a given vector.
* Fixed a bug in the ``distance_transform_edt`` function that would cause
incorrect distances to be calculated in the case of nodata pixels in the
region raster. The algorithm has been modified to treat nodata as though
pixel values were 0 (non-region) and the distance transform will be defined
for the entire raster.
* Added a ``sampling_distance`` parameter to ``distance_transform_edt`` that
linearly scales the distance transform by this value.
* Fixed an issue in ``calculate_slope`` that would raise an exception if the
input dem did not have a nodata value defined.
* Changed the behavior of ``zonal_statistics`` for polygons that that do not
intersect any pixels. These FIDs are now also included in the result from
``zonal_statistics`` where previously they were absent. This is to remain
consistent with how other GIS libraries calculate zonal stats.

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.

Page 5 of 11

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.