Skip to content

gui: Display EPSG codes next to project names in Data Catalog#7427

Draft
polucifier wants to merge 1 commit into
OSGeo:mainfrom
polucifier:gui-display-epsg-codes
Draft

gui: Display EPSG codes next to project names in Data Catalog#7427
polucifier wants to merge 1 commit into
OSGeo:mainfrom
polucifier:gui-display-epsg-codes

Conversation

@polucifier
Copy link
Copy Markdown
Contributor

Description

This PR enhances the Data Catalog tree view by displaying the EPSG code next to each georeferenced project (location) name in square brackets (e.g., project_name [EPSG:XXXX]). This provides immediate spatial context to users directly within the main window interface.

Technical Details

  • Native Extraction: Uses g.proj -g inside a temporary isolated environment (gs.create_environment).
  • Lazy Caching: The EPSG code is fetched once and cached in the node's internal data dictionary (data["epsg"]), ensuring that tree sorting and filtering remain instantaneous.
  • Fallback: Safely returns None for unreferenced locations (like XY), rendering them without any extra markup.

How to Test

  1. Open the Data Catalog panel in the GRASS main window.
  2. Verify that georeferenced projects now show their EPSG codes in square brackets (e.g., nc_spm_08_grass7 [EPSG:3358]).
  3. Verify that the tree filtering and sorting remain fast and responsive.

Visuals

image

@ecodiv
Copy link
Copy Markdown
Contributor

ecodiv commented May 23, 2026

Would it be possible to make this optional? I can see why this is possibly handy, but for me it would add clutter.

@polucifier polucifier marked this pull request as draft May 23, 2026 14:10
@github-actions github-actions Bot added GUI wxGUI related Python Related code is in Python labels May 23, 2026
@echoix
Copy link
Copy Markdown
Member

echoix commented May 23, 2026

Could it show up in the tooltip if it already doesn’t do it normally?

@echoix
Copy link
Copy Markdown
Member

echoix commented May 23, 2026

Having it optional, enable per project would avoid having to do these calls only for the GUI, (slowing down the initial loading). Similar to how the number of features of a layer isn’t systematically counted and displayed in QGIS, you have to enable it for the layer if wanted.

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

Labels

GUI wxGUI related Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants