Pygeoprocessing

Latest version: v2.4.6

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

Scan your dependencies

Page 6 of 11

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".

1.2.1

------------------
* Fixing an issue with ``warp_raster`` that would round off bounding boxes
for rasters that did not fit perfectly into the target raster's provided
pixel size.
* Cautiously ``join``\ing all process pools to avoid a potential bug where a
deamonized subprocess in a process pool may still have access to a raster
but another process may require write access to it.

1.2.0

------------------
* Several PyGeoprocessing functions now take advantage of multiple CPU cores:

* ``raster_calculator`` uses a separate thread to calculate raster
statistics in a ``nogil`` section of Cython code. In timing with a big
rasters we saw performance improvements of about 35%.
* ``align_and_resize_raster_stack`` uses as many CPU cores, up to the number
of CPUs reported by multiprocessing.cpu_count (but no less than 1), to
process each raster warp while also accounting for the fact that
``gdal.Warp`` uses 2 cores on its own.
* ``warp_raster`` now directly uses ``gdal.Warp``'s multithreading directly.
In practice it seems to utilize two cores.
* ``convolve_2d`` attempts to use ``multiprocessing.cpu_count`` cpus to
calculate separable convolutions per block while using the main thread to
aggregate and write the result to the target raster. In practice we saw
this improve runtimes by about 50% for large rasters.
* Fixed a bug that caused some nodata values to not be treated as nodata
if there was a numerical roundoff.
* A recent GDAL upgrade (might have been 2.0?) changed the reference to
nearest neighbor interpolation from 'nearest' to 'near'. This PR changes
PyGeoprocessing to be consistent with that change.
* ``raster_calculator`` can now also take "raw" arguments in the form of a
(value, "raw") tuple. The parameter ``value`` will be passed directly to
``local_op``. Scalars are no longer a special case and need to be passed as
"raw" parameters.
* Raising ``ValueError`` in ``get_raster_info`` and ``get_vector_info`` in
cases where non-filepath non-GIS values are passed as parameters. Previously
such an error would result in an unhelpful error in the GDAL library.

1.1.0

------------------
* PyGeoprocessing now supports Python 2 and 3, and is tested on python 2.7
and 3.6 Testing across multiple versions is configured to be run via
``tox``.
* After testing (tox configuration included under ``tox-libcompat.ini``),
numpy requirement has been dropped to ``numpy>=1.10.0`` and scipy has been
modified to be ``scipy>=0.14.1,!=0.19.1``.
* A dependency on ``future`` has been added for compatibility between python
versions.
* Fixed a crash in ``pygeoprocessing.routing.flow_dir_mfd`` and
``flow_dir_d8`` if a base raster was passed in that did not have a power of
two blocksize.
* ``raster_calculator`` can now take numpy arrays and scalar values along with
raster path band tuples. Arrays and scalars are broadcast to the raster size
according to numpy array broadcasting rules.
* ``align_and_resize_raster_stack`` can now take a desired target projection
which causes all input rasters to be warped to that projection on output.

Page 6 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.