Skip to content

Commit

Permalink
fixed wrong encoding of mask arrays; fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
cnavacch committed Aug 22, 2022
1 parent a07b3a7 commit c77e16c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

Version 0.2.2
=============

- fixed wrong encoding of mask arrays
- added geometry reprojection to mosaic methods
- added new `poi2tile()` method

Version 0.2.1
=============

Expand Down
6 changes: 3 additions & 3 deletions src/geospade/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2291,9 +2291,9 @@ def _mask_tile(self, tile) -> Tile:
"""
if tile.mask is None:
if tile.mosaic_topology == 'INNER':
tile.mask = np.ones(tile.shape)
tile.mask = np.ones(tile.shape, dtype=np.uint8)
elif tile.mosaic_topology == 'OUTER':
tile.mask = np.zeros(tile.shape)
tile.mask = np.zeros(tile.shape, dtype=np.uint8)
elif tile.mosaic_topology == 'BOUNDARY':
intrsct_geom = self.boundary.Intersection(tile.boundary)
# first, using 'outer_boundary_extent' as a pixel buffer for generating the rasterised
Expand Down Expand Up @@ -2721,7 +2721,7 @@ def select_tiles_by_geom(self, geom, sref=None, active_only=True, apply_mask=Tru
"""

intsctd_raster_geom = self._raster_geom.slice_by_geom(geom, True, False)
intsctd_raster_geom = self._raster_geom.slice_by_geom(geom, snap_to_grid=True, inplace=False)
if intsctd_raster_geom is None:
return None
intsctd_mosaic_height, intsctd_mosaic_width = intsctd_raster_geom.shape
Expand Down

0 comments on commit c77e16c

Please sign in to comment.