Opened 13 years ago
Closed 12 years ago
#1530 closed enhancement (fixed)
g.region shrink / expand parameter
Reported by: | alf | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 6.4.3 |
Component: | Default | Version: | 6.4.1 |
Keywords: | g.region, expand | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Hi,
it would be really nice to have a shrink/expand parameter in g.region for shrinking/expanding the current region.
Best,
Alessandro Frigeri
Change History (7)
comment:1 by , 13 years ago
follow-up: 3 comment:2 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Martin,
Yes, that is basically what I was meaning, it's already there and works, and the manual describe it just fine! Maybe in future the shrink and expand parameters can be introduced fro a quickest working region trimming.
Ciao,
Alessandro
follow-up: 5 comment:3 by , 13 years ago
Replying to alf:
Maybe in future the shrink and expand parameters can be introduced fro a quickest working region trimming.
I agree, I would be able to imagine something like
# g.region n=n+10 s=s-10 w=w-10 e=e+10 g.region offset=10 # g.region n=n-10 s=s+10 w=w+10 e=e-10 g.region offset=-10
Make sense?
comment:4 by , 13 years ago
To add to this idea, I think it would be very useful to grow/shrink the region based on number of pixels instead of current projection units. This would ensure exact alignment when changing a region with non-int units. I currently do this via python.
comment:5 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Replying to martinl:
Replying to alf:
Maybe in future the shrink and expand parameters can be introduced fro a quickest working region trimming.
I agree, I would be able to imagine something like
# g.region n=n+10 s=s-10 w=w-10 e=e+10 g.region offset=10 # g.region n=n-10 s=s+10 w=w+10 e=e-10 g.region offset=-10Make sense?
Yes Martin! For the parameter name I'd rather go with the term 'expand', and the following entry in the manual
(...) expand=value
Expand (positive offset value) or shrink (negative offset value) current region
(...)
Alessandro
comment:6 by , 13 years ago
Keywords: | g.region expand added |
---|---|
Milestone: | 6.4.2 → 6.4.3 |
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
g.region.grow module added to grass6 addons in r55843.
http://grasswiki.osgeo.org/wiki/AddOns/GRASS_6#g.region.grow
Instead of rows=rows+2*n cols=cols+2*n
(or rows=rows-2*n cols=cols-2*n
) I took the easy way and made use of the g.region -a flag, which rounds outwards to the nearest whole-cell. Feel free to reopen the wish if you'd like to see a -c flag added to make the expand= (should it be called amount= or extent=?) refer to cells not map units.
Hamish
Do you mean something like
it's working.