[GRASS5] r.in.gdal updates?

Markus Neteler neteler at itc.it
Thu Apr 17 04:37:49 EDT 2003


On Fri, Mar 14, 2003 at 10:05:41PM -0800, Eric G. Miller wrote:
> On Fri, Mar 14, 2003 at 02:29:42PM +0100, Markus Neteler wrote:
> > On Thu, Mar 13, 2003 at 07:22:46AM -0800, Eric G. Miller wrote:
> > > On Thu, Mar 13, 2003 at 01:49:46PM +0100, Markus Neteler wrote:

r.in.gdal update:

> > > > Outstanding issue:
> > > > The CELL compression - I don't know how to apply that suggestion

Find attached a patch for testing from Eric Miller. Some test maps are
compressed now much (!) better - some files consumed only 10% of the space
after patching main.c of r.in.gdal.

Before submitting to CVS it needs tested with all possible raster types.

patch -p0 main.c < ringdal_main.c.diff

Enjoy,

 Markus

PS: I have used cvs diff to create the file, hopefully in the right way.
-------------- next part --------------
555a556
>     int (*raster_open_new_func)(char *, RASTER_MAP_TYPE) = G_open_raster_new;
570,577c571,586
<       case GDT_CInt16:
<       case GDT_CInt32:
<       case GDT_CFloat32:
<       case GDT_CFloat64:
<         data_type = FCELL_TYPE;
<         eGDT = GDT_CFloat32;
<         complex = TRUE;
<         break;	
---
>       case GDT_Byte:
>         data_type = CELL_TYPE;
>         eGDT = GDT_Int32;
>         complex = FALSE;
>         G_set_cell_format(0);
>         raster_open_new_func = G_open_raster_new_uncompressed;
>         break;
> 
>       case GDT_Int16:
>       case GDT_UInt16:
>         data_type = CELL_TYPE;
>         eGDT = GDT_Int32;
>         complex = FALSE;
>         G_set_cell_format(1);
>         raster_open_new_func = G_open_raster_new_uncompressed;
>         break;
582a592
> 	G_set_cell_format(3);
595c605
<         cfR = G_open_raster_new((char *)outputReal, data_type);
---
>         cfR = (*raster_open_new_func)((char *)outputReal, data_type);
604c614
<         cfI = G_open_raster_new((char *)outputImg, data_type);
---
>         cfI = (*raster_open_new_func)((char *)outputImg, data_type);
624c634
<         cf = G_open_raster_new((char *)output, data_type);
---
>         cf = (*raster_open_new_func)((char *)output, data_type);


More information about the grass-dev mailing list