Skip to content

Commit

Permalink
Reduce bin size for raster window grouping to 0.01 degrees to avoid O…
Browse files Browse the repository at this point in the history
…OM errors.

PiperOrigin-RevId: 660461366
  • Loading branch information
jzxu authored and tkiela1 committed Aug 7, 2024
1 parent c5863c7 commit 1d466fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/skai/read_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

# When splitting coordinates into bins for grouping, this is the number of
# degrees in longitude and latitude each bin spans. Since 1 degree ~ 111km,
# and we expect image resolutions around 0.5m, this means approximately 22K
# pixels per bin.
_BIN_SIZE_DEGREES = 0.1
# and we expect image resolutions around 0.5m, this means each bin will be
# approximately 2220 x 2220 pixels.
_BIN_SIZE_DEGREES = 0.01


@dataclasses.dataclass(order=True, frozen=True)
Expand Down
2 changes: 1 addition & 1 deletion src/skai/read_raster_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_get_windows(self):
def _check_windows(windows):
self.assertLen(windows, 2)
for key, window in windows:
self.assertEqual(key, _RasterBin(self.test_image_path, 1784, -167))
self.assertEqual(key, _RasterBin(self.test_image_path, 17848, -1664))
self.assertEqual(window.source_crs, rasterio.crs.CRS.from_epsg(3857))
self.assertEqual(window.target_crs, rasterio.crs.CRS.from_epsg(32760))
if window.window_id == 'A17B32432A1085C1':
Expand Down

0 comments on commit 1d466fa

Please sign in to comment.