geedim icon indicating copy to clipboard operation
geedim copied to clipboard

Q mosaic gives strange artifacts

Open orbitfold opened this issue 2 years ago • 3 comments

See the uploaded image. Other methods look fine (ish) with the same settings.

Bildschirm­foto 2022-11-07 um 14 07 45

orbitfold avatar Nov 07 '22 13:11 orbitfold

q-mosaic will not give good results in all situations, but this does look a bit odd. Please could you provide code, or a command line to re-create this image.

dugalh avatar Nov 07 '22 17:11 dugalh

GeoJSON

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "coordinates": [
          [
            [
              3.2320803252100063,
              6.60534144003347
            ],
            [
              3.2320803252100063,
              6.317907838094598
            ],
            [
              3.5334997324700907,
              6.317907838094598
            ],
            [
              3.5334997324700907,
              6.60534144003347
            ],
            [
              3.2320803252100063,
              6.60534144003347
            ]
          ]
        ],
        "type": "Polygon"
      }
    }
  ]
}

Code:

    polygon = data["features"][0]["geometry"]
    coll = gd.MaskedCollection.from_name('COPERNICUS/S2_SR_HARMONIZED')
    coll = coll.search(start_date="2019-01-01", end_date="2020-01-01", region=polygon, cloudless_portion=0.0)
    comp_im = coll.composite(method='q-mosaic', region=polygon)
    comp_im.download(output_path, region=polygon, crs='EPSG:32735', scale=10, max_tile_size=8)

orbitfold avatar Nov 08 '22 12:11 orbitfold

q-mosaic is working correctly for your example from what I can tell. The component images span a range of wet/dry conditions, and the composite consists of parts of these different images where they happened to have the largest distance to cloud.

dugalh avatar Nov 08 '22 16:11 dugalh