-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move GDAL constraint into constraints file and update to GDAL 3.8 #1546
Changes from all commits
1ddaff0
91ececb
316e4dd
e87dcaf
f9051f5
a289f98
fa213e5
7a148dd
8d6164b
1c2476c
b5d8576
4c35b1a
a2e79d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file contains package constraints needed to run the invest test suite. | ||
# It follows the pip constraints file format: | ||
# https://pip.pypa.io/en/stable/user_guide/#constraints-files | ||
|
||
# A gdal bug caused our test suite to fail, but this issue is unlikely to | ||
# occur with regular use of invest. https://github.com/OSGeo/gdal/issues/8497 | ||
GDAL!=3.6.*,!=3.7.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -415,9 +415,9 @@ def ndr_eff_calculation( | |
|
||
# create direction raster in bytes | ||
def _mfd_to_flow_dir_op(mfd_array): | ||
result = numpy.zeros(mfd_array.shape, dtype=numpy.int8) | ||
result = numpy.zeros(mfd_array.shape, dtype=numpy.uint8) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this always should've been I'm not sure exactly why it worked before, but it probably broke because of changes in GDAL's handling of signed 8-bit integers in 3.7.0. |
||
for i in range(8): | ||
result[:] |= (((mfd_array >> (i*4)) & 0xF) > 0) << i | ||
result[:] |= ((((mfd_array >> (i*4)) & 0xF) > 0) << i).astype(numpy.uint8) | ||
return result | ||
|
||
pygeoprocessing.raster_calculator( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2112,6 +2112,7 @@ def test_spatial_overlap_error(self): | |
layer = vector.CreateLayer('layer', vector_srs, ogr.wkbPoint) | ||
new_feature = ogr.Feature(layer.GetLayerDefn()) | ||
new_feature.SetGeometry(ogr.CreateGeometryFromWkt('POINT (1 1)')) | ||
layer.CreateFeature(new_feature) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The feature wasn't being added to the layer, so the layer was actually empty. I'm not sure what determines the extent of an empty layer, but I'm guessing it's undefined behavior. Some change in GDAL (or GEOS or PROJ?) caused the extent to include a By adding a feature to the layer, we get the expected behavior. |
||
|
||
new_feature = None | ||
layer = None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the intent was to apply
ALL_TOUCHED=TRUE
when rasterizing habitats and stressors, but that was not happening becausetarget_simplified_vector
, notsource_filepath
, is used.