[GRASS-user] r.proj: fixing a failure

Daniel Victoria daniel.victoria at gmail.com
Tue Dec 22 13:38:52 EST 2009


Could it be that the vector created by v.in.region is messed up, or
it's covering a larger area that you are not interested in?

Last time I used r.proj here is how I did it:
1) Go to source location and set the region to match the area I want to project
2) Create a bounding box (v.in.region)
3) Write down the resolution and number of columns, rows of the region
4) Exit grass and start over in new location
5) Bring in bounding box (v.proj)
6) Set region to bounding box (g.region vect=) and set resolution
(g.region res=xx). Here I follow Hamish advice and try to set the
number of col and row a bit higher then the number in the original
region.
7) Bring in raster (r.proj)

Cheers
Daniel

On Tue, Dec 22, 2009 at 3:59 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> On Tue, 22 Dec 2009, Daniel Victoria wrote:
>
>> So, in order to know where you projected raster will fall, you can use
>> the v.in.region trick. The command will create a bounding box in your
>> map and you can project the vector (using v.proj), and not wory about
>> the current region. Then you set your region to the recently projected
>> vector (g.region vect=box) and fix your resolution. Now you are ready
>> to project your raster and you know the current region matches the
>> region where your raster is coming from.
>
> Daniel,
>
>  Despite my reading the r.proj man page I missed the critical point that
> you and Hamish tried pointing out: that v.in.region is run on the raster
> location, not the target location.
>
>  Working my way through the r.proj man page note (as you summarize above),
> I end with screwy region results.
>
>  v.in.region worked; I call the output area (it should be area and not
> line, correct?) 'dembox.' Exiting grass and restarting to reset the location
> to that of the project, I ran 'v.proj input=dembox
> location=dem10m_northwest' without error. However, running 'g.region
> vect=dembox' followed by 'g.region -p' shows:
>
> projection: 99 (Lambert Conformal Conic)
> zone:       0
> datum:      nad83
> ellipsoid:  grs80
> north:      1735231.4372465
> south:      1120657.13248051
> west:       -768668.81031769
> east:       40643.22944943
> nsres:      32.8315778
> ewres:      32.83479551
> rows:       18719
> cols:       24648
> cells:      461385912
>
>  Before running 'g.region vect=dembox' 'g.region -p' showed:
>
> proj:       99
> zone:       0
> north:      1326000
> south:      1278000
> east:       817000
> west:       766500
> cols:       1538
> rows:       1462
> e-w resol:  32.83485046
> n-s resol:  32.83173735
> top:        1
> bottom:     0
> cols3:      50500
> rows3:      48000
> depths:     1
> e-w resol3: 1
> n-s resol3: 1
> t-b resol:  1
>
>  Both north and south were extended, but the east-west bounds seem totally
> unrealistic.
>
>  What might I have missed here? To what should I change the e-w and n-s
> resolutions after fixing the first issue?
>
> Thanks,
>
> Rich
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list