Skip to content

wxGUI/datacatalog : Add STDS in datacatalog#7608

Draft
saket0187 wants to merge 9 commits into
OSGeo:mainfrom
saket0187:Add-stds-in-datacatalog
Draft

wxGUI/datacatalog : Add STDS in datacatalog#7608
saket0187 wants to merge 9 commits into
OSGeo:mainfrom
saket0187:Add-stds-in-datacatalog

Conversation

@saket0187

@saket0187 saket0187 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This is currently a draft PR for #861.

At the moment, I have implemented the initial Data Catalog integration, added several context menu options, and listed STDS items.

Features added

  • List STDS in the Data Catalog.
  • Lazy load maps inside an STDS when it is double-clicked.
  • Create an STDS from the mapset context menu (only for the current mapset).
  • Add the following context menu actions for STDS objects:
    • Rename
    • Delete
    • Duplicate (current mapset only)
    • Merge (cross-mapset merge is supported as long as the target mapset is in the user's search path; otherwise, the option is disabled)
    • Show Metadata
    • Register Maps (current mapset only)
    • Unregister Maps (current mapset only)
  • Add the following context menu actions for maps inside an STDS:
    • Display
    • Unregister

Current State

Please refer to the video below to see the current state of the PR.

Demo Link - https://drive.google.com/file/d/1LRaPAz6YeEohQXCW6z2DZzOP1jsCky7C/view?usp=share_link

Known Issues

Important

  • Currently, whenever an operation triggers a mapset refresh, all loaded/expanded STDS are collapsed and need to be loaded again. I plan to preserve and restore the loaded state across refreshes, although I'm not yet sure of the best way to implement it.

Notes

Note

  • The icons for STVDS, STRDS, and STR3DS have not been finalized yet. For this demo, I temporarily added a small clock overlay at the bottom-right of the existing icons to distinguish them. These are placeholder icons and will be updated once the final designs are decided.
  • I wasn't able to find clear PNG versions of the existing icons, so I used the ones already available in the repository.

Cc: @ninsbl , @petrasovaa

@github-actions github-actions Bot added GUI wxGUI related Python Related code is in Python labels Jun 26, 2026
@saket0187 saket0187 marked this pull request as draft June 26, 2026 11:31
@petrasovaa petrasovaa moved this from Todo to In Progress in GRASS Google Summer of Code 2026 Jun 26, 2026

@ninsbl ninsbl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good start. Please see my initial feedback below...

Comment thread gui/wxpython/datacatalog/tree.py Outdated
stds_name = self.selected_stds[0].data["name"]
mapset_name = self.selected_mapset[0].data["name"]

cmd = ["t.info", f"type={stds_type}", f"input={stds_name}@{mapset_name}"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You have most of the metadata already from t.list with JSON output. So repeated calls to t.info are probably not needed if you can store the metadata (if feasible)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, But I prefer using t.info on-demand to keep memory usage light and avoid writing a custom formatter, especially since the TGIS import overhead is resolved. @petrasovaa what do you suggest?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Memory is not an issue here I would expect, so without measured numbers, I say don't worry about it. Formatting may or may not be a concern.

Comment thread gui/wxpython/datacatalog/tree.py Outdated
Comment thread gui/wxpython/datacatalog/tree.py Outdated
Comment on lines +939 to +941
"strds": MetaIcon(img="mapset").GetBitmap(bmpsize),
"stvds": MetaIcon(img="mapset").GetBitmap(bmpsize),
"str3ds": MetaIcon(img="mapset").GetBitmap(bmpsize),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed, there are unfortunately no ready icons to use. Here is an example for a temporal raster icon in QGIS:
https://github.com/qgis/QGIS/blob/master/images/themes/default/mIconTemporalRaster.svg
For background: a common icon theme for OSGeo projects was developed almost 20 years ago oriented on the Tango Desktop theme. See: http://robert.szczepanek.pl/icons.php
The QGIS icon is a good start but would need to be acompanied by vector and raster3d variants. Would you be willing to create such icons? Not sure if it would be feasible to give the raster an impression of a series?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The advantage of using the clock is that it's easy to recognize, but I think of temporal data in GRASS more in dates and not hours. But symbol of calendar would not be very recognizable in that size. Stacking would be difficult for 3D rasters. Perhaps an image of a timeline? But maybe we can start with the clock since that is the easiest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried using the clock on the PNG icons. For STRDS and STR3DS, it seems to look okay, but STVDS doesn't look good. You can see this in the screen recording I added to the PR description. Also, I wasn't able to find clear PNG versions of the icons, so I used the ones already available in the repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Icons come from https://github.com/Cracert/GIS-icons, or at least derived from there. We might make svg ones at some point

- Added _popupMenuMultipleStds for multiple temporal dataset selections
- Added 'Register maps' and 'Unregister maps' STDS options
- Added 'Duplicate dataset', 'Rename dataset', and 'Delete dataset' options
- Added 'Merge datasets' option for multiple STDS selections
- Optimized t.connect background checks to prevent unnecessary scanning across all mapsets
…oss-mapset support

- Add active mapset locks for --ui dialogs (Create STDS/Register/Unregister)
- Enable cross-mapset execution for native background tasks (Rename/Delete)
- Implement safe JSON parsing for g.mapsets search path check for Merge STDS option
@ninsbl

ninsbl commented Jun 30, 2026

Copy link
Copy Markdown
Member

As discussed, some screenshots or the like would be very helpful also for others to better grasp the changes in the UI...

self.selected_mapset[i].data["name"],
)

removed, cmd = self._runCommand(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are 2 types, only removing the dataset but keeping the data, or removing dataset including the data. I am not sure what is the more common case (complete removal?) but the question should clearly communicate that.

Comment thread gui/wxpython/datacatalog/tree.py Outdated
Comment thread gui/wxpython/datacatalog/tree.py Outdated
@petrasovaa

Copy link
Copy Markdown
Contributor

It's not working for me, I think the problem is with the recent changes in t.list. If you don't have temporal connection in PERMANENT, t.list doesn't list anything in other mapsets.

@saket0187

Copy link
Copy Markdown
Contributor Author

It's not working for me, I think the problem is with the recent changes in t.list. If you don't have temporal connection in PERMANENT, t.list doesn't list anything in other mapsets.

This should most probably handle both issues.

@ninsbl

ninsbl commented Jul 2, 2026

Copy link
Copy Markdown
Member

Having a context menu entry to plot the timeline (https://grass.osgeo.org/grass-stable/manuals/g.gui.timeline.html) of one ore more selected STDS would be a useful UI component IMHO, what do you think?

@ninsbl

ninsbl commented Jul 2, 2026

Copy link
Copy Markdown
Member

Also modifying metadata (https://grass.osgeo.org/grass-stable/manuals/t.support.html) would make sense to me.

@lindakarlovska

Copy link
Copy Markdown
Contributor

Just a thought on icons: we could already start preparing Data Catalog for region integration here (#7614), specifically by creating subnodes for type groups. For the STDS dataset subnode, we could use either a plain clock icon or a plain timeline icon as suggested by @petrasovaa. The specific STDS items underneath could then use the standard vector and raster icons.

- Removed options: Removed the 'Duplicate dataset' option and removed the standalone 'Display map(s)' method.

- Updated map ID structuring: Upgraded t.*.list queries to fetch id,name natively and store the map_id. This ensures that maps registered in an STDS from other mapsets maintain their correct paths for basic functions.

- Expanded STDS context menu: Added 'Plot timeline' (g.gui.timeline) and 'Modify metadata' (t.support) to the primary Space Time Dataset context menu.

- Standardized map actions: Added a 'Copy name' option to STDS maps and fixed edge cases for 'Display layer' and 'Show metadata' by utilizing the new map_id fallback and safely creating cross-mapset environments.

- Created a dedicated context menu (_popupMenuStdsMap) specifically for maps inside an STDS. This prevents users from accidentally triggering standard spatial tools (g.rename / g.remove) that desync the temporal SQLite database.

- Added temporary UI icons: Replaced duplicate mapset placeholders with temporary STRDS, STVDS, and STR3DS icons in the Data Catalog treeview.
@github-actions github-actions Bot added the docs label Jul 8, 2026
@ninsbl ninsbl added the gsoc Reserved for Google Summer of Code student(s) label Jul 9, 2026
@ninsbl

ninsbl commented Jul 9, 2026

Copy link
Copy Markdown
Member

Hi @saket0187 ,

I have been testing your code locally on my linux machine. I fetched your fork and branch and built from a clean state.

Unfortunately, the data catalog never loads and the progress indicator just keeps spinning. Could you please report load times for the data catalog on your machine (together with a rough estimate of the number of proects, mapsets, and maps)?

I do not have that many maps in my current dev-project:

$ g.list mapset=* type=all | wc -l
209

But the other projects do not contain that much more either...

I do see some critical wx / gtk messages in the console:

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.877: gtk_widget_set_size_request: assertion 'height >= -1' failed

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.877: gtk_widget_set_size_request: assertion 'height >= -1' failed

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.877: gtk_widget_set_size_request: assertion 'height >= -1' failed

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.877: gtk_widget_set_size_request: assertion 'height >= -1' failed

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.902: gtk_widget_set_size_request: assertion 'height >= -1' failed

(wxgui.py:118891): Gtk-CRITICAL **: 11:08:30.902: gtk_widget_set_size_request: assertion 'height >= -1' failed

But I am not sure if they are related....

This is the system I have right now:
g.version -gbre
version=8.6.0dev
date=2026
revision=763b17e9a5
build_date=2026-07-09
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8

./configure --without-pdal
libgis_revision=f37d752dc5
libgis_date=2026-05-28T18:08:24+00:00
proj=9.6.2
gdal=3.10.3
geos=
sqlite=3.47.2

My version of wxpython is 4.2.2 and Python is 3.13.13.

I can update elements if there is indication that it could fix some of the issues. Anyway, it would be great if you could investigate...

I alos tested on Windows Subsystem for Linux (WSL), but there the GUI justs starts and crashes (which may be due to WSL limitations, though other GUI applications do work there).

@echoix

echoix commented Jul 9, 2026

Copy link
Copy Markdown
Member

The gui can work on wsl, but I just wouldn’t consider resolution or visual theme weirdnesses as grass bugs. But it does work enough to see something

@saket0187

saket0187 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @saket0187 ,

I have been testing your code locally on my linux machine. I fetched your fork and branch and built from a clean state.

Unfortunately, the data catalog never loads and the progress indicator just keeps spinning. Could you please report load times for the data catalog on your machine (together with a rough estimate of the number of proects, mapsets, and maps)?

I do not have that many maps in my current dev-project:

$ g.list mapset=* type=all | wc -l
209

But the other projects do not contain that much more either...

On my Mac, the whole GUI launches completely in about ~3-4 seconds. For context on the scale I am testing with, my database has:
3 projects (one with 6 mapsets, two with 1 mapsets (PERMANENT)).
Multiple STDS with around 800 maps registered in them.
1,142 maps in the main project

g.list mapset='*' type=all | wc -l                            
    1142

Python 3.14.6
wxPython 4.2.5

@ninsbl

ninsbl commented Jul 9, 2026

Copy link
Copy Markdown
Member

The gui can work on wsl, but I just wouldn’t consider resolution or visual theme weirdnesses as grass bugs. But it does work enough to see something

Yes, I can confirm that the GUI start and runs on WSL without issues on current main. On this branch it now does start, but it is unstable. I could open the GUI and see some STDS in the data catalog, but the GUI eventually freezes completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related Python Related code is in Python

Projects

Development

Successfully merging this pull request may close these issues.

6 participants