Skip to content

v.proj: Seed region from default window to ignore region override#7578

Open
petrasovaa wants to merge 2 commits into
OSGeo:mainfrom
petrasovaa:v.proj-fix-region
Open

v.proj: Seed region from default window to ignore region override#7578
petrasovaa wants to merge 2 commits into
OSGeo:mainfrom
petrasovaa:v.proj-fix-region

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

This came up when i was testing r.in.ssurgo addon in parallel within RegionManager which uses WIND_OVERRIDE. v.proj was throwing:

Unable to open element file <windows> for <local_region@PERMANENT>

Added test.

More info:

Details When v.proj switches into the source project to read the input vector, it seeded its working region with G_get_window(), which honors WIND_OVERRIDE and GRASS_REGION. Those name a region in the caller's mapset, not in the source project, so the read failed with "Unable to open element file " whenever v.proj ran under a named temporary region (e.g. inside RegionManager, use_temp_region(), or parallel pipelines).

Read the source project's default window instead. The seed value is
overwritten field by field from the input vector's extent immediately
afterward, so seeding from the default window is sufficient and does not
consult the override. G_unset_window() is dropped since it only existed
to defeat G_get_window()'s cache.

Add a regression test that runs v.proj with WIND_OVERRIDE naming a region
present only in the target mapset

@github-actions github-actions Bot added vector Related to vector data processing Python Related code is in Python C Related code is in C module tests Related to Test Suite labels Jun 16, 2026
Comment thread vector/v.proj/main.c Outdated
Comment thread vector/v.proj/main.c Outdated
Comment thread vector/v.proj/tests/v_proj_wind_override_test.py Outdated
@petrasovaa petrasovaa requested a review from wenzeslaus June 19, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module Python Related code is in Python tests Related to Test Suite vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants