def test_crop_in_memory_and_off_memory_without_resizing_are_the_same(self):
    coords = mercantile.xy_bounds(*tiles[18])
    shape = GeoVector(Polygon.from_bounds(*coords), WEB_MERCATOR_CRS)
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        raster2 = GeoRaster2.open(rf.name)
        off_memory_crop = raster2.crop(shape)
        raster2.image
        in_memory_crop = raster2.crop(shape)
        self.assertEqual(off_memory_crop, in_memory_crop)
def test_crop_in_memory_and_off_memory_without_resizing_are_the_same(self):
    coords = mercantile.xy_bounds(*tiles[18])
    shape = GeoVector(Polygon.from_bounds(*coords), WEB_MERCATOR_CRS)
    raster = self.read_only_virtual_geo_raster()
    with NamedTemporaryFile(mode='w+b', suffix='.tif') as rf:
        raster.save(rf.name)
        raster2 = GeoRaster2.open(rf.name)
        off_memory_crop = raster2.crop(shape)
        raster2.image
        in_memory_crop = raster2.crop(shape)
        self.assertEqual(off_memory_crop, in_memory_crop)