@framing
def test_crop_and_get_tile_do_the_same_when_image_is_populated_first_high_zoom(self):
    coords = mercantile.xy_bounds(*tiles[17])
    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)
        raster = GeoRaster2.open(rf.name)
        raster._populate_from_rasterio_object(read_image=True)
        tile17 = raster.get_tile(*tiles[17])
        cropped_17 = raster.crop(shape, MERCATOR_RESOLUTION_MAPPING[17])
        self.assertEqual(tile17, cropped_17)
@framing
def test_crop_and_get_tile_do_the_same_when_image_is_populated_first_high_zoom(self):
    coords = mercantile.xy_bounds(*tiles[17])
    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)
        raster = GeoRaster2.open(rf.name)
        raster._populate_from_rasterio_object(read_image=True)
        tile17 = raster.get_tile(*tiles[17])
        cropped_17 = raster.crop(shape, MERCATOR_RESOLUTION_MAPPING[17])
        self.assertEqual(tile17, cropped_17)