Skip to content

Commit

Permalink
r.import: Use temp region for resolution=value (#197)
Browse files Browse the repository at this point in the history
Temp region was not used when g.region was called with resolution and -a.
Use same temp region settings as for extent=input.
  • Loading branch information
wenzeslaus authored and neteler committed Dec 23, 2019
1 parent 6c686fa commit 889bf2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/r.import/r.import.py
Expand Up @@ -351,8 +351,10 @@ def main():
if flags['e']:
continue

if options['extent'] == 'input':
if options['extent'] == 'input' or tgtres == 'value':
grass.use_temp_region()

if options['extent'] == 'input':
grass.run_command('g.region', n=n, s=s, e=e, w=w)

res = None
Expand Down Expand Up @@ -384,7 +386,7 @@ def main():
if grass.raster_info(outfile)['min'] is None:
grass.fatal(_("The reprojected raster <%s> is empty") % outfile)

if options['extent'] == 'input':
if options['extent'] == 'input' or tgtres == 'value':
grass.del_temp_region()

if flags['e']:
Expand Down

0 comments on commit 889bf2b

Please sign in to comment.