Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q mosaic gives strange artifacts #12

Closed
orbitfold opened this issue Nov 7, 2022 · 3 comments
Closed

Q mosaic gives strange artifacts #12

orbitfold opened this issue Nov 7, 2022 · 3 comments

Comments

@orbitfold
Copy link

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

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

@dugalh
Copy link
Collaborator

dugalh commented Nov 7, 2022

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.

@orbitfold
Copy link
Author

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)

@dugalh
Copy link
Collaborator

dugalh commented Nov 8, 2022

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 dugalh closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants