Skip to content

Commit

Permalink
r.in.wms: fix get region extent for WMS query, if location is 'XY loc…
Browse files Browse the repository at this point in the history
…ation (unprojected)'
  • Loading branch information
tmszi committed Jul 30, 2020
1 parent 1fdf752 commit beeff97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/m.proj/m.proj.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,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
17 changes: 10 additions & 7 deletions scripts/r.in.wms/wms_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,16 @@ def _computeBbox(self):
grass.fatal(_("Unable to write data into tempfile"))
finally:
temp_region_opened.close()

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)
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)
if not points:
grass.fatal(_("Unable to determine region, %s failed") % 'm.proj')

Expand Down

0 comments on commit beeff97

Please sign in to comment.