Beispiel #1
0
def test_small_read_only_virtual_geo_raster_wgs84_crop():
    # See https://github.com/satellogic/telluric/issues/61
    roi = GeoVector.from_bounds(xmin=0, ymin=0, xmax=2, ymax=2, crs=WGS84_CRS)
    resolution = 1.0  # deg / px

    raster = GeoRaster2.empty_from_roi(roi, resolution)

    assert raster.crop(roi) == raster.crop(roi, raster.resolution())
Beispiel #2
0
def test_rasters_covering_different_overlapping_areas_on_y():
    affine_a = Affine.translation(1, 2) * Affine.scale(1, -1)
    raster_a = make_test_raster(1, [1], height=20, width=20, affine=affine_a)
    affine_b = Affine.translation(1, -9) * Affine.scale(1, -1)
    raster_b = make_test_raster(2, [1], height=20, width=20, affine=affine_b)
    roi = GeoVector.from_bounds(xmin=1, ymin=-29, xmax=21, ymax=2, crs=constants.WEB_MERCATOR_CRS)
    rasters = [raster_a, raster_b]
    merged = merge_all(rasters, roi)
    assert(merged.affine.almost_equals(affine_a))
    assert(not merged.image.mask.all())
    assert((merged.image.data[0, 0:20, 0:20] == 1).all())
    assert((merged.image.data[0, 21:30, 0:20] == 2).all())