# This file contains metadata for your plugin.

# This file should be included when you package your plugin.
# Mandatory items:

[general]
name=Cloud removal from sentinel 2
qgisMinimumVersion=3.22
qgisMaximumVersion=4.99
description=Builds cloud-free Sentinel-2 and Landsat composites over a date range, or opens single acquisitions one layer each, for a Vietnamese province or commune or a rectangle drawn anywhere.

version=0.7
author=GFD
email=hoa.lq@gfd.com.vn

about=Searches Sentinel-2 surface reflectance (COPERNICUS/S2_SR_HARMONIZED) and Landsat 4, 5, 8 and 9 surface reflectance (Collection 2 Level-2) over a date range. A range can be read two ways: mosaicked into one cloud-free composite per satellite, or searched image by image, ticking the days worth keeping in the preview gallery so that each becomes its own layers and its own export, named for its day. Several satellites can be searched over the same period; each keeps its own products at its own pixel size, and its own colour throughout the interface. Clouds are removed the way each satellite allows, and each has a threshold of its own: a per pixel cloud probability from COPERNICUS/S2_CLOUD_PROBABILITY for Sentinel-2, and the QA_PIXEL flags plus a limit on the reported scene cloud cover for Landsat. Bands are harmonised, so true colour, NDVI and NBR mean the same thing whichever satellite they come from. The area of interest is a Vietnamese administrative unit (province or commune, 2025 units, read from bundled GeoJSON and searchable by typing) or a rectangle drawn on the canvas, which works worldwide; an administrative unit can be cut to its outline or to the box around it. The preview gallery folds out beside the form and shows one thumbnail per acquisition day and satellite with its cloud cover, marking the days the cloud filter is going to discard. Each of the three products, the colour composite, NDVI and NBR, is ticked separately for the map and for Google Drive. The interface is bilingual, English and Vietnamese. Requirements: this plugin does not process imagery locally, it needs the "Google Earth Engine" plugin installed in the same QGIS profile, signed in with a registered Earth Engine account, plus an internet connection. Exports are written to the Google Drive of that account and run as Earth Engine tasks. Restrictions: the bundled administrative boundaries cover Vietnam only, other regions must use the rectangle tool. Developed by GFD (http://gfd.com.vn/)

tracker=https://github.com/lequynhhoa/sentinel2_removed_cloud_rec/issues
repository=https://github.com/lequynhhoa/sentinel2_removed_cloud_rec
# End of mandatory metadata

# Recommended items:

hasProcessingProvider=no

changelog=0.7 - The explanation of each search mode moved into an "i" badge beside it. Spelled
      out in full the two of them were four wrapped lines of prose above a form of eight
      controls; hovering the badge, or the mode itself, still gives the whole text. The
      tooltip is broken into a line per sentence, English then Vietnamese, because Qt puts
      a plain text tooltip on a single line however long it is.
    - The cloud filter is two numbers now, because there are two ways of removing
      cloud. Sentinel-2 comes with a per pixel cloud probability, so its threshold masks
      pixels and never drops a scene; 20 stays the default there, since that is what
      does the cloud removal. Landsat has only the QA_PIXEL bitmask, which removes cloudy
      pixels whatever the threshold, so all its threshold can do is throw away whole
      scenes by their reported cover: the default is 100, which keeps every scene found
      and still returns a cloud-free composite. Sharing one number was the mistake — 20
      reads as a sensible pixel probability and as a brutal scene limit, and in a cloudy
      climate it discarded nearly every Landsat scene, so picking three satellites
      returned layers for one. Each row is hidden when no chosen satellite uses it.
    - Fixed the top of the Sentinel-2 range dropping the very pixels it should keep. The
      comparison was strict, so at the top of the range the pixels the mask is surest of,
      probability exactly 100, were still masked out. It is inclusive now, like the
      Landsat scene filter, so 100 means what it says.
    - An empty Landsat result no longer blames the cloud filter when that filter is
      already at 100, where it drops nothing: advice the user cannot act on.
    - Fixed the scrolling page freezing the width it needed. It was measured once, before
      the Landsat threshold row existed, so ticking a Landsat left that row cut off with
      nothing to scroll sideways with. The page reports the width it needs as it changes.
    - A date range can be read two ways, chosen under "Search mode".
      "Composite the range" is what the plugin has always done: every cloud-free image in
      the range is mosaicked into one picture per satellite. Nothing is picked and nothing
      is chosen there: the cards carry no controls at all, because the gallery is simply
      the list of what the range holds, read before settling on the dates.
    - "Open the images separately" is the new one. The gallery lists the days that hold
      imagery, each card carries a tick box, and every ticked image becomes its own
      layers and its own export, named for its day. Nothing is mixed across dates, so a
      cloudy day stays cloudy and two dates can be compared side by side.
    - The boundary search can now be cut to the box around the unit instead of to its
      outline, chosen under "Cut to" beside the two lists. The outline gives a picture of
      exactly that province or commune with everything outside it empty; the box is a
      plain filled rectangle, smaller to export but reaching past the unit. The choice
      applies to the layers, the exports and the preview thumbnails alike, so what is
      previewed is what is downloaded. A drawn rectangle already is its own box, so that
      dialog offers no choice.
    - "Preview" searches again instead of folding the gallery away. As a toggle, pressing
      it a second time to refresh the search closed the panel, which looked like a popup
      flashing and vanishing. Folding it away is what the Collapse button in the panel is
      for.
    - Reloading the gallery no longer freezes the dialog. Stopping the old search waited
      for the thumbnail request it was in the middle of, up to five seconds of a frozen
      window; the worker is cut loose instead and left to notice in its own time. Only
      closing the dialog still waits, because it must.
    - The gallery no longer looks ragged: every card is given the height of the tallest,
      so a card carrying a cloud warning does not push its row out of line, and the two
      controls on a card sit on separate lines instead of squeezing each other until the
      button label disappears. Cards are a little roomier, so text no longer runs into
      the frame beside it.
    - The preview gallery now judges a day by the same cloud threshold the search
      uses, so the two can no longer disagree. The list of days was built from every scene
      there is while the search drops whole Landsat scenes cloudier than the threshold, so
      picking three satellites could produce layers for only one of them with nothing on
      screen to explain it. A day the filter will drop is now marked on its card, cannot
      be ticked or used, and the card says how many of its scenes get through.
    - An empty Landsat result now says to raise the cloud filter, which is nearly always
      the reason for it.
    - Which products reach the map is now a choice of its own. The export group has
      become a small table: one row per product, a "Map" tick and a "Drive" tick. Only the
      ticked products become layers, and a ticked one comes in switched on. Every
      satellite and every picked day produces all three, so a search over three
      satellites used to drop nine layers into the tree and bury the one that was wanted.
      The colour composite is ticked for the map by default, the two indices are not, and
      a search with nothing ticked in either column is refused.
    - The export products are named for what they are rather than for their bands:
      "Colour composite / Tổ hợp màu", "NDVI Index / Chỉ số thực vật NDVI" and
      "NBR Index / Chỉ số tỷ lệ cháy NBR". The old "RGB (B4-B3-B2)" named Sentinel-2 band
      numbers, which stopped being true once Landsat could be searched as well; the bands
      each product is built from are in its tooltip now. Layer and file names are
      unchanged.
    - A date range can now be read two ways, chosen under "Search mode".
      "Composite over the range" is what the plugin has always done: every cloud-free
      image in the range is mosaicked into one picture per satellite, so cloud on one
      day is filled in from another.
    - "Pick single days" is the new one. The range becomes a search: the preview gallery
      lists the days that hold imagery, each card gets a tick box, and every day ticked
      is composited, added to the map and exported on its own. Nothing is mixed across
      dates, so a cloudy day stays cloudy and two dates can be compared side by side.
      The layers and the files carry the day, "<prefix>_<satellite>_<product>_<day>".
    - The daily previews open beside the form instead of in a window of their own.
      "Preview" folds a gallery out on the right of the same dialog, the split between
      the two can be dragged, and the button folds it away again, giving the dialog its
      old width back.
    - The gallery now says when a range holds more days than it can show. It fits forty
      cards, filled with the acquisition days from the start date on, so a range of
      several years stops part way through it. Nothing on screen explained that: the note
      about it was written into the "loading" line, which the "ready" line replaced the
      moment the thumbnails arrived. A standing notice above the cards now says how many
      days the range really holds and to shorten it to reach the rest.
    - Changing the dates, the area or the satellites while the gallery is open says it
      no longer matches the form and offers to fetch it again, rather than reloading by
      itself: every card is one Earth Engine request.
    - The dialogs fit a laptop. The form scrolls inside the dialog, so the header, the
      tabs, the warning line and the buttons stay on screen however short the screen is,
      and no dialog opens larger than the screen has room for. Folding the gallery out on
      a narrow screen takes the width from the form first, down to its own minimum, so
      the previews keep their columns for as long as there is anything left to give.
    - Every satellite has a colour of its own, worn by its chip in the picker and by the
      badge on every preview card, so several satellites searched over one period can be
      told apart at a glance.
    - The two calendars are limited to the period the ticked satellites cover together.
      Ticking a satellite that stopped acquiring pulls a later date back into range and
      says so, and a line under the calendars always names the period available.
    - Fixed the dialogs squeezing their own rows on top of each other: the province and
      commune boxes, and the two calendars, could overlap. Both dialogs declared a
      minimum size smaller than their contents, which let Qt shrink them past the point
      where the layout still fits. The declaration is gone, so the minimum is the one Qt
      computes from the widgets, and the dialogs now open large enough to hold them.
    0.6 - Landsat 4, 5, 8 and 9 (Collection 2 Level-2) can be searched next to Sentinel-2,
      and several satellites can be picked for the same period. Each one gets its own
      composite, its own layers and its own export, at its own pixel size.
    - Clouds are handled per satellite: the threshold is a per pixel cloud probability
      for Sentinel-2, and the highest accepted scene cloud cover for Landsat, whose
      QA_PIXEL cloud, shadow, dilated cloud and cirrus pixels are always removed.
    - Bands are harmonised onto one naming and one reflectance scale, so the true colour
      stretch, NDVI and NBR are comparable across satellites. The Sentinel-2 NBR now
      uses B12, the 2.2 um band it is defined on, instead of B11.
    - The dialogs say which years each satellite covers and warn when the chosen period
      falls outside them, which it often does: Landsat 4 and 5 stopped acquiring years
      before Landsat 8 and Sentinel-2 started.
    - Every preview card names the satellite it came from.
    0.5 - Rectangle tool: "Preview" and "OK" are available straight away, since the
      drawn rectangle already is the area. The file name box only turns on once an
      output is ticked for export.
    - Boundary tool: the commune list holds communes only and is ready for typing as
      soon as a province is chosen; leaving it empty takes the whole province.
    - Quieter dialogs: the "pick a province" and "provinces ready" lines are gone, and
      the warning line only appears when something is actually wrong.
    - First release published on plugins.qgis.org: the package now ships its GPL-2
      LICENSE and a real README, and the leftover Plugin Builder notes are gone.
    0.4 - "Preview" and "OK" stay disabled until the inputs are complete, and a line
      above the buttons says what is still missing. No province is preselected any more.
    - Previews are much faster again: they run over the bounding box of the area,
      resolved once into plain coordinates, and the date list is a single metadata
      request instead of a cloud reduction per day.
    0.3 - The province and commune lists can be searched by typing, with or without
      accents, and anywhere in the name ("hue" finds "Thành phố Huế").
    - Much faster searches and previews: both Sentinel-2 collections are now filtered
      before they are joined, instead of joining the whole archive first.
    - Preview thumbnails are fetched in parallel over a simplified area of interest, so
      the gallery fills in seconds rather than one image at a time.
    0.2 - New "Preview" gallery: one true colour thumbnail per acquisition day with
      its cloud cover, and a shortcut to search that single day.
    - Fixed NDVI and NBR: palettes are proper colour lists, exports use a server side
      region, a larger pixel budget and transliterated task names, so the two index
      products no longer fail on Google Drive.
    - The rectangle tool no longer needs a second click after using the boundary tool.
    - Both date bounds are inclusive.
    0.1 - Busy window while Earth Engine runs, plus a message telling the user which
      files are being exported to the Google Drive of the signed-in account.
    - Only the RGB composite is switched on when layers are added; NDVI and NBR come in
      unchecked.
    - Dates can only be picked from the calendar, not typed.
    - Resizable dialogs with colour coded sections and a themed calendar popup.
    - Runs on QGIS 4 (Qt6) and QGIS 3: scoped enums, icons loaded from disk
      instead of compiled Qt resources, guarded Earth Engine imports.
    - Two-level Vietnam administrative boundaries (province / commune, 2025) read from
      bundled GeoJSON instead of a remote API.
    - Cloud masking with COPERNICUS/S2_CLOUD_PROBABILITY, threshold adjustable in the UI.
    - Redesigned dialogs with progress feedback while boundaries load, palette aware so
      they match the QGIS light and dark themes.

# Tags are comma separated with spaces allowed
tags=sentinel2, sentinel-2, landsat, landsat8, cloud, cloud mask, cloud removal, mosaic, composite, ndvi, nbr, earth engine, google earth engine, remote sensing, satellite, raster, vietnam

homepage=https://github.com/lequynhhoa/sentinel2_removed_cloud_rec
category=Plugins
icon=icon.png
# experimental flag
experimental=False

# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False

# Since QGIS 3.8, a comma separated list of plugins to be installed
# (or upgraded) can be specified.
# Check the documentation for more information.
plugin_dependencies=Google Earth Engine

# Python packages needed at runtime. They come with the "Google Earth Engine"
# plugin above, this only spells out what the plugin actually imports.
external_deps=earthengine-api

# If the plugin can run on QGIS Server.
server=False

