Closed ricardogsilva closed 3 years ago
@ricardogsilva - I worry a bit about this:
Datasets can be located everywhere on the user's machine, just as long as their respective .json file is under the Trends.Earth base dir. This means that inside the json file there must be a property that informs the plugin of the full path to the dataset. The current implementation features a file property, which we can continue using, but with a full path instead of just a filename.
That would mean that if a user for example gets dataset and imports it into trends.earth, it would lead to generation of a .json being generated for that dataset under the Trends.Earth base dir. That makes sense. That json would then point to the location of the relevant tif if it were elsewhere on their machine, correct? But then if the user moved that tif the file location would no longer be known to the plugin, so they would have to re-import it. For a trends.earth generated file this wouldn't be big deal, as each tif already has its own json file with information on the dataset type and algorithm used to generate it. But for other types of data a user might import (land cover, for example) import can take some time due to the need for a user to assign classes to the codes within the file, perhaps resample it, etc.
Long way of saying - we'll need a way for users to link datasets within the "datasets" tab back to their respective tif files (or vrt file if the file is tiled) if the data file is moved from the location specified in the json under the trends.earth main directory.
@ricardogsilva - I worry a bit about this:
Datasets can be located everywhere on the user's machine, just as long as their respective .json file is under the Trends.Earth base dir. This means that inside the json file there must be a property that informs the plugin of the full path to the dataset. The current implementation features a file property, which we can continue using, but with a full path instead of just a filename.
That would mean that if a user for example gets dataset and imports it into trends.earth, it would lead to generation of a .json being generated for that dataset under the Trends.Earth base dir. That makes sense. That json would then point to the location of the relevant tif if it were elsewhere on their machine, correct? But then if the user moved that tif the file location would no longer be known to the plugin, so they would have to re-import it. For a trends.earth generated file this wouldn't be big deal, as each tif already has its own json file with information on the dataset type and algorithm used to generate it. But for other types of data a user might import (land cover, for example) import can take some time due to the need for a user to assign classes to the codes within the file, perhaps resample it, etc.
Long way of saying - we'll need a way for users to link datasets within the "datasets" tab back to their respective tif files (or vrt file if the file is tiled) if the data file is moved from the location specified in the json under the trends.earth main directory.
a multi file solution has not solution about consistency! nor using json, vrt, absolute or relative paths... the two way to reduce this problems are:
1) using a a DB (a geopackage container) ti maintain images... but do not remove the problem to import/export 2) embed trends.earth json as HEX string in a TIFF custom tag so the image would remain always linked. Drawback is tiff modification (equivalent to a import)
obviously remain the solution to live with a suboptimal solution with some drawback that is maintain a trends.earth data repo/folder-tree and link external data with wrt of json or whatever.
@ricardogsilva it't not completely clear to me the possible values for Source of a dataset. e.g. what kind of data type... I'm trying to create a model and would be better to create it more generic as possible and well typed. Possible values for source a a Algorithm datatype or something that says that the alg is generated from 'Default data'?... can you explain?
@luipir
a dataset's source
refers to what originated it. It is what is shown in the above mockup in the Generated by
part of the dataset list. It can be one of:
Land Productivity (sub-indicator1) Algorithm
Downloaded from sample dataset server
(or something similar to this)Imported from local files
(or something similar to this)@ricardogsilva @Samweli what about this first draft of the list?
I added a progress bar and a graphic element (to be shown alternatively basing on status)
I contionued to use a tree model instead of a list view to have more flexibility in case we need to add some sub-element to the Dataset item. BTW it is represented as a list view
Looking good @luipir !
I'm not sure what that Generated by: ?????
means, but I guess this is work in progress, right? Would also be nice to have some icons in the buttons instead of text, but I think that can come later on, once we get the basics working. Keep it up :smile_cat:
@ricardogsilva "???" is a placeholder waiting for your answer in https://github.com/ConservationInternational/trends.earth/issues/371#issuecomment-804826913 BTW this demostrate that the value is dinamyc. About icons... I would completly remove any button string substituting with icons to reduce localization problems,.
a dataset's
source
refers to what originated it
so it's a string... not necessary to pass the entire AlgorigthmDescriptor instance
Better... I used qgis icons (copied into plugin icon folder to avoid dependency). BTW We should have a style directive. I'm not the best person to choose stylish icons and UX :)
This is a first draft of integration
Looking good, nice work! A few remarks:
Delete
icon should be the last one and we should probably move it to the far right and the others to the far left (with a spacer) in order to make it harder for the user to accidentally press delete
. We should also show an additional modal dialogue to ask for confirmation when the user presses deleteAdd Raster layer
icon instead of the generic plus
icondetails
icon would be better with the generic information
icon, as used also in the QGIS layer properties Information
sectionImport
and the Download raw data
buttons. The Import
one has a cloud, which seems to imply that the import consists in downloading some resource from the web, which is not the case. The Download raw data
seems to bee too generic and not really convey the concept of a download.I am happy if we work on these additional remarks as further issues in the future. They do not need to be included in scope for this issue. Unless you feel like it is faster to just go ahead and do them now. I'll leave it for you to decide. Just keep in mind that most of these can also be done in parallel with @Samweli's help if done later.
Asi' mejor
solo dos notas: 3) Scroll bar appear only if necessary in authomatic form 6) I did't changed this icons waiting a more clear indication... I do not like too... but at the same time I prefer to focus on code logic than estetic
I prepare the PR
The plugin dock has a
Datasets
tab. This is meant to be the primary place where the user manages and interacts with Trends.Earth data.As depicted by the above mockup, the datasets tab can be split into three areas:
An actionable list of known datasets.
This list shall be scrollable, in order to accomodate a large number of entries.
Each entry in the list represents a known dataset. It shall feature the following:
Some UI controls to operate on the list as a whole
These allow filtering and ordering the list and also performing a manual refresh.
In this context, refreshing means performing both:
base_dir
in order to discover any new datasetsAdditional UI controls to import new datasets
These shall allow the user to introduce new datasets to Trends.Earth by either:
known datasets
Known datasets are those whose metadata can be extracted by inspection of the Trends.Earth
base_dir
(as configured in the settings dialogue).These datasets are generated by either:
Each known dataset is described by an auxiliary
.json
file that carries all relevant metadata about it. These json files must be located inside the base dir in order for Trends.Earth to be able to find the respective dataset.Datasets can be located everywhere on the user's machine, just as long as their respective
.json
file is under the Trends.Earth base dir. This means that inside the json file there must be a property that informs the plugin of the full path to the dataset. The current implementation features afile
property, which we can continue using, but with a full path instead of just a filename.Trends.Earth base dir
The structure of the base dir shall be:
downloaded-sample-datasets
- This directory is used to put all json files and all datasets that are downloaded from Trends.Earth data serversimported-datasets
- This directory is used to put all json files of datasets that are imported. It may optionally also be used to copy the imported files (but we'll likely provide a UI control for the user to decide if the dataset shall be copied or not)in-transit-datasets
- This directory is used to put all json files of datasets that are still being generated on a remote server. The contents of this directory are therefore volatile.outputs
- All datasets and json files that are generated by a Trends.Earth algorithm shall be placed under this directory. It is further discretized according to each algorithm's group and name and execution date (as in year, month, day)Objective
Implement an initial version of the datasets tab that has the following:
dataset list, with existing datasets being scanned from the base dir, as mentioned above. for now it is OK to only add:
We shall add the remaining features later. Polling the remote server is alos not in scope for the current issue, we shall implement it later
dataset import section, with two buttons (Import and download sample data), as shown in the mockup. These buttons shall reuse the existing dialogues
list controls section. Implement only the
refresh
button for now. We will be adding list sorting and filtering later