[Fwd: Re: [GRASS-dev] Change the resolution in the output map]

Juan Diego Giraldo Osorio Juan.Giraldo at upct.es
Mon Dec 3 10:21:34 EST 2007


Thanks. It was easy to create the new code after your help.

Juan

> 
> 
> -------- Original Message --------
> Subject: 	Re: [GRASS-dev] Change the resolution in the output map
> Date: 	Sat, 1 Dec 2007 04:36:48 +0000
> From: 	Glynn Clements <glynn at gclements.plus.com>
> To: 	Juan Diego Giraldo Osorio<Juan.Giraldo at upct.es>
> CC: 	grass-dev at grass.itc.it
> References: 	<200711301610.lAUGAbP18736 at pyxis.si.upct.es> 
> <1228557177jdgiraldo at upct.es>
> 
> 
> 
> Juan Diego Giraldo Osorio wrote:
> 
> > I'm working with grass62. I'm triying to create a raster map with finer
> > resolution from another with coarse resolution. The problem is the next:
> > 
> > - My coarse resolution map (input map) have 500 m of resolution, with
> > 1000x1000 rows*cols. This information is the same as the current region .
> > - I want to create a finer resolution map (output map) with 100 m of
> > resolution, with 5000x5000 rows*cols.
> > - I have been trying with the next code:
> > 
> > 	/* Adjust the region to new resolution */
> > 	region.rows = nsubpixel*nrows;
> > 	region.cols = nsubpixel*ncols;
> > 	region.format = 0;
> > 	region.compressed = 1;
> > 	G_adjust_Cell_head( &region , 1 , 1 );
> > 	G_set_window(&region);
> > 
> >   nsubpixel is 5 (500/100), and I'm writing a new header file with this
> > new information (region.rows=5000, region.cols=5000, region.ew_res=100,
> > region.ns_res=100) but when I read the new map, the next message error
> > is shows:
> > 
> >   WARNING: error reading null row 115
> >   ... a lot of times.
> 
> If you want to work with different resolutions, you need to
> continually switch between the two. Opening and reading the input map
> must be done with the source region active, while opening, reading and
> closing the output map must be done with the destination region
> active.
> 
> See the r.resamp.interp and r.resamp.stats modules for examples.
> 
> -- 
> Glynn Clements <glynn at gclements.plus.com>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
> 
> 
> 


--
********************************
Juan Diego Giraldo Osorio
Tel. 968 327 047
Departamento de Ingenier�a Térmica y de Fluidos
Universidad Politécnica de Cartagena
Espa�a
********************************





More information about the grass-dev mailing list