Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.in.wms: fix get region extent for WMS query, if location is 'XY location (unprojected)' #853

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/m.proj/m.proj.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def main():
# set up projection params
s = gcore.read_command("g.proj", flags="j")
kv = parse_key_val(s)
if "XY location" in kv["+proj"] and (ll_in or ll_out):
if "XY location" in kv:
gcore.fatal(_("Unable to project to or from a XY location"))

in_proj = None
Expand Down
22 changes: 13 additions & 9 deletions scripts/r.in.wms/wms_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,20 @@ def _computeBbox(self):
grass.fatal(_("Unable to write data into tempfile"))
finally:
temp_region_opened.close()
try:
points = grass.read_command(
"m.proj",
flags="d",
proj_out=self.proj_srs,
proj_in=self.proj_location,
input=temp_region,
quiet=True,
) # TODO: stdin
except CalledModuleError:
points = None
finally:
grass.try_remove(temp_region)

points = grass.read_command(
"m.proj",
flags="d",
proj_out=self.proj_srs,
proj_in=self.proj_location,
input=temp_region,
quiet=True,
) # TODO: stdin
grass.try_remove(temp_region)
if not points:
grass.fatal(_("Unable to determine region, %s failed") % "m.proj")

Expand Down
Loading