def test_geographic_crop(self):
    raster = self.read_only_virtual_geo_raster_wgs84()
    rhombus_on_image = Polygon([[0, 2], [1, 1], [2, 2], [1, 3]])
    rhombus_world = raster.to_world(rhombus_on_image)
    cropped = raster.crop(rhombus_world)
    r = raster[0:2, 1:3]
    assert (cropped == r)
def test_geographic_crop(self):
    raster = self.read_only_virtual_geo_raster_wgs84()
    rhombus_on_image = Polygon([[0, 2], [1, 1], [2, 2], [1, 3]])
    rhombus_world = raster.to_world(rhombus_on_image)
    cropped = raster.crop(rhombus_world)
    r = raster[0:2, 1:3]
    assert (cropped == r)