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

Enrich PatchExtractor with a geographic coordinates system defined area #3

Open
tlarcher opened this issue Oct 19, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@tlarcher
Copy link
Collaborator

  • Context

Multi-modal datasets like GeoLifeCLEF's comprise numerous bioclimatic and pedologic variables that can be aggregated to construct rasters, scaling up to countries or continents.

These rasters are then divided into smaller patches that are being fed into the deep learning module by calling the private method environmental_raster.Raster._extract_patch through the PatchExtractor class constructor, by indexing an instance of said class.

During the process, the python module rasterio is used to process input data (Tiff, gTiff...) into a custom, useable dataset object.

  • Problem

Currently, the size of the wanted patch is passed as parameter in the PatchExtractor class constructor (which is then passed on to the Raster class constructor) and is only interpreted as pixel size.

For example : PatchExtractor("./my_rasters", 256) will instanciate a patch of size 256x256 pixels where each pixel maps a certain geographical area in the raster (depending on the resolution of the raster).

However, in order to work on or querry a specific patch, one would need to know the mapping between pixel coordinates and geographic coordinates, which is not trivial.

  • Solution

Introduce a new way of registering patch sizes in the malpolon.data.environmental_raster.Raster class so that users can choose the unit they want to work with.

Maybe add a new parameter size_type: str = "px" with values taken in ["px", "km", "m", "arcseg"] (or similar) and define a coordinates conversion method that would return the corresponding pixel coordinates mapping.

@tlarcher tlarcher added the enhancement New feature or request label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant