Skip to content

Commit

Permalink
test all touched
Browse files Browse the repository at this point in the history
  • Loading branch information
daanvaningen committed Feb 22, 2024
1 parent 9847f6e commit c2efb23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion threedigrid_builder/grid/grid_refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def rasterize(geoms, values, origin, width, height, cell_size, no_data_value):

# ATTRIBUTE=BURN_ATTR burns the BURN_ATTR value of each feature
# ALL_TOUCHED turns off the special GDAL algorithm for lines
options = ["ATTRIBUTE=" + burn_attr, "ALL_TOUCHED=1"]
options = ["ATTRIBUTE=" + burn_attr, "ALL_TOUCHED=TRUE"]

with Dataset(array, **dataset_kwargs) as dataset:
gdal.RasterizeLayer(dataset, (1,), layer, options=options)
Expand Down
4 changes: 1 addition & 3 deletions threedigrid_builder/tests/test_grid_refinements.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ def test_rasterize_line_refinement2(refinements):


def test_rasterize_poly_refinement(refinements):
refinements.the_geom[0] = shapely.box(
13.0 + EPSILON, 11.0 + EPSILON, 14.0 + EPSILON, 13.0 + EPSILON
)
refinements.the_geom[0] = shapely.box(13.0, 11.0, 14.0, 13.0)
actual = refinements.rasterize(
origin=(12.0, 10.0), height=8, width=6, cell_size=0.5, no_data_value=3
)
Expand Down

0 comments on commit c2efb23

Please sign in to comment.