def test_crop_image_from_and_get_win_do_the_same_full_resolution(self):
    bounds = (20, 13, 40, 15)
    win = rasterio.windows.Window(bounds[0], bounds[1], (bounds[2] - bounds[0]), (bounds[3] - bounds[1]))
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        saved_raster = GeoRaster2.open(rf.name)
        cropped_win = saved_raster.get_window(win)
    cropped_image = raster._crop(bounds)
    self.assertEqual(cropped_image, cropped_win)
def test_crop_image_from_and_get_win_do_the_same_full_resolution(self):
    bounds = (20, 13, 40, 15)
    win = rasterio.windows.Window(bounds[0], bounds[1], (bounds[2] - bounds[0]), (bounds[3] - bounds[1]))
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        saved_raster = GeoRaster2.open(rf.name)
        cropped_win = saved_raster.get_window(win)
    cropped_image = raster._crop(bounds)
    self.assertEqual(cropped_image, cropped_win)