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

adapt s2 importer to work without Google BigQuery #295

Merged
merged 9 commits into from
Mar 21, 2022

Conversation

griembauer
Copy link
Contributor

@griembauer griembauer commented Jan 6, 2022

This PR adapts the actinia importer process for the importing of Sentinel-2 data. Sentinel-2 data (indicated by a scene-ID) can now be imported directly from Google Cloud Storage without providing any credentials using i.sentinel.download and i.sentinel.import in the background. This PR currently uses the standard implementation of the importer: each import_description can be used to import exactly ONE raster map. For Sentinel-2 data, this means that each band has to be specified individually.

Note: The current implementation (query via Google Cloud BigQuery interface etc.) is not removed in this PR, the new functionality without login is simply added.

perspective TODOs:

  • implement extent (bbox): import processes are automatically put before grass (or other) processes in a process chain. This means that no region can be set via a grass module before running the import. Limiting the import data to a certain extent has to be done via the extent parameter of the importer. This still needs to be implemented.
  • correct null value: When importing a scene, i.sentinel.import reprojects the map if it does not match the current projection. This may interfere with 0-values, that should be treated as NULL-values and removed via r.null or i.zero2null. This problem should probably be solved in r.import
  • improve i.sentinel.download such that it can directly download individual bands (and required metadata) instead of the entire scene, (and maybe even cut it to the current region)
  • implement query such that all S2 data from region and time of interest are imported (e.g. using i.sentinel.coverage + t.sentinel.import). This is currently implemented with the BigQuery approach and should be replaced.

Example PC:

{
 "list": [
          {"id": "importer_1",
          "module": "importer",
          "inputs": [{"import_descr": {"source": "S2B_MSIL1C_20210809T101559_N0301_R065_T32UNB_20210809T124430",
                                       "type": "sentinel2",
                                       "sentinel_band": "B04"},
                      "param": "map",
                      "value": "B04"},
                     {"import_descr": {"source": "S2B_MSIL1C_20210809T101559_N0301_R065_T32UNB_20210809T124430",
                                       "type": "sentinel2",
                                       "sentinel_band": "B08"},
                      "param": "map",
                      "value": "B08"}]},
          {
      			"id": "dummy_region",
      			"comment": "Set the region to raster",
      			"module": "g.region",
      			"inputs": [
      				{
      					"param": "raster",
      					"value": "B04"
      				}
      			],
      			"flags": "p"
      		},
          {
      			"id": "dummy_mapcalc",
      			"comment": "just a dummy module",
      			"module": "r.mapcalc",
      			"inputs": [
      				{
      					"param": "expression",
      					"value": "test_raster = B04 + B08"
      				}
      			]
      		}
         ],
 "version": "1"
}

@griembauer griembauer marked this pull request as ready for review January 17, 2022 07:45
Copy link
Member

@anikaweinmann anikaweinmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

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

Successfully merging this pull request may close these issues.

error in NDVI example Create importer for Sentinel data from different data source
4 participants