Skip to content

Comments

wxGUI/history: Display saved region name if stored#7095

Open
saket0187 wants to merge 2 commits intoOSGeo:mainfrom
saket0187:Add-region-name
Open

wxGUI/history: Display saved region name if stored#7095
saket0187 wants to merge 2 commits intoOSGeo:mainfrom
saket0187:Add-region-name

Conversation

@saket0187
Copy link
Contributor

@saket0187 saket0187 commented Feb 16, 2026

This PR adds the feature referred in #5283

Here are the outputs:

  • When it matches in MAPSET/windows
Screenshot 2026-02-16 184215
  • When it doesn't match in MAPSET/windows
Screenshot 2026-02-16 182910

Added two new methods to support region name display:

  • _get_saved_region_name(): Searches MAPSET/windows for matching saved regions
  • _compare_regions(): Compares regions with epsilon tolerance for floating-point precision

These methods are separate from the existing region match logic to avoid modifying
working functionality and keep changes minimal and isolated.
Let me know if this needs any changes.

@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Feb 16, 2026
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

The comparison needs more reasoning (epsilon, 3D, ...). Similarly, please describe behavior for the different situations.

As for the details here, user may still want to update to the named (saved) region. The GUI element alignment is wrong.

@saket0187
Copy link
Contributor Author

Thank you for the review. Just wanted to clarify few things before making commit.

The comparison needs more reasoning (epsilon, 3D, ...). Similarly, please describe behavior for the different situations.

I assume this means I should compare all other values like 3d items. right?

As for the details here, user may still want to update to the named (saved) region. The GUI element alignment is wrong.

Can you explain this a little more what do you mean here if you don't mind.

@wenzeslaus
Copy link
Member

Yes, you should also compare the values for 3D.

@saket0187
Copy link
Contributor Author

I know there are still some changes needed, but I wanted to check if I’m heading in the right direction or just overcomplicating things.

Currently, history.py command info provides 2D region values as far as i was able to understand. I modified it to return 3D values by using region3d=True.

I also switched to format="shell" instead of JSON because the JSON output was returning verbose keys like "north" instead of short keys like "n", which simplifies parsing.

Additionally, I added translation keys for the new 3D fields, although these can be removed if not needed.

From what I could find , when region 3D values aren’t present, they are set to defaults automatically, so converting from a 2D region to 3D will provide reasonable default values right?

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

Labels

GUI wxGUI related libraries Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants