00001
00002
00003 #include <grass/gis.h>
00004
00005 int G__write_Cell_head ( FILE *fd,
00006 struct Cell_head *cellhd,int is_cellhd)
00007 {
00008 char buf[1024];
00009 int fmt;
00010
00011 fmt = cellhd->proj;
00012
00013 fprintf (fd, "proj: %d\n", cellhd->proj);
00014 fprintf (fd, "zone: %d\n", cellhd->zone);
00015
00016 G_format_northing (cellhd->north,buf,fmt);
00017 fprintf (fd, "north: %s\n", buf);
00018
00019 G_format_northing (cellhd->south,buf,fmt);
00020 fprintf (fd, "south: %s\n", buf);
00021
00022 G_format_easting (cellhd->east,buf,fmt);
00023 fprintf (fd, "east: %s\n", buf);
00024
00025 G_format_easting (cellhd->west,buf,fmt);
00026 fprintf (fd, "west: %s\n", buf);
00027
00028 fprintf (fd, "cols: %d\n", cellhd->cols);
00029 fprintf (fd, "rows: %d\n", cellhd->rows);
00030
00031 G_format_resolution (cellhd->ew_res,buf,fmt);
00032 fprintf (fd, "e-w resol: %s\n", buf);
00033
00034 G_format_resolution (cellhd->ns_res,buf,fmt);
00035 fprintf (fd, "n-s resol: %s\n", buf);
00036
00037 if (is_cellhd)
00038 {
00039 fprintf(fd,"format: %d\n", cellhd->format);
00040 fprintf(fd,"compressed: %d\n", cellhd->compressed);
00041 }
00042
00043 return 1;
00044 }
00045
00046 int G__write_Cell_head3 ( FILE *fd,
00047 struct Cell_head *cellhd,int is_cellhd)
00048 {
00049 char buf[1024];
00050 int fmt;
00051
00052 fmt = cellhd->proj;
00053
00054 G__write_Cell_head ( fd, cellhd, is_cellhd );
00055
00056 fprintf (fd, "top: %g\n", cellhd->top);
00057 fprintf (fd, "bottom: %g\n", cellhd->bottom);
00058
00059 fprintf (fd, "cols3: %d\n", cellhd->cols3);
00060 fprintf (fd, "rows3: %d\n", cellhd->rows3);
00061 fprintf (fd, "depths: %d\n", cellhd->depths);
00062
00063 G_format_resolution (cellhd->ew_res3,buf,fmt);
00064 fprintf (fd, "e-w resol3: %s\n", buf);
00065
00066 G_format_resolution (cellhd->ns_res3,buf,fmt);
00067 fprintf (fd, "n-s resol3: %s\n", buf);
00068
00069 G_format_resolution (cellhd->tb_res,buf,fmt);
00070 fprintf (fd, "t-b resol: %s\n", buf);
00071
00072 return 1;
00073 }