104 G_debug(2,
"G__read_Cell_head_array");
117 cellhd->compressed = -1;
118 cellhd->ew_res = 0.0;
119 cellhd->ew_res3 = 1.0;
120 cellhd->ns_res = 0.0;
121 cellhd->ns_res3 = 1.0;
122 cellhd->tb_res = 1.0;
128 cellhd->bottom = 0.0;
133 for (line = 1; (buf = array[i++]); line++) {
137 switch (scan_item(buf, label, value)) {
139 G_fatal_error(_(
"Syntax error in cell header, line %d: %s"), line,
146 if (strncmp(label,
"proj", 4) == 0) {
150 if (!scan_int(value, &cellhd->proj))
156 if (strncmp(label,
"zone", 4) == 0) {
160 if (!scan_int(value, &cellhd->zone))
174 for (line = 1; (buf = array[i++]); line++) {
175 G_debug(3,
"region item: %s", buf);
176 switch (scan_item(buf, label, value)) {
178 G_fatal_error(_(
"Syntax error in cell header, line %d: %s"), line,
186 if (strncmp(label,
"proj", 4) == 0)
188 if (strncmp(label,
"zone", 4) == 0)
191 if (strncmp(label,
"nort", 4) == 0) {
199 if (strncmp(label,
"sout", 4) == 0) {
207 if (strncmp(label,
"east", 4) == 0) {
215 if (strncmp(label,
"west", 4) == 0) {
223 if (strncmp(label,
"top", 3) == 0) {
226 if (!scan_double(value, &cellhd->top))
231 if (strncmp(label,
"bottom", 6) == 0) {
234 if (!scan_double(value, &cellhd->bottom))
239 if (strncmp(label,
"e-w ", 4) == 0 && strlen(label) == 9) {
244 if (cellhd->ew_res <= 0.0)
249 if (strncmp(label,
"e-w resol3", 10) == 0) {
253 G_fatal_error(_(
"Invalid 3D e-w resolution field: %s"), value);
254 if (cellhd->ew_res3 <= 0.0)
255 G_fatal_error(_(
"Invalid 3D e-w resolution field: %s"), value);
259 if (strncmp(label,
"n-s ", 4) == 0 && strlen(label) == 9) {
264 if (cellhd->ns_res <= 0.0)
269 if (strncmp(label,
"n-s resol3", 10) == 0) {
273 G_fatal_error(_(
"Invalid 3D n-s resolution field: %s"), value);
274 if (cellhd->ns_res3 <= 0.0)
275 G_fatal_error(_(
"Invalid 3D n-s resolution field: %s"), value);
279 if (strncmp(label,
"t-b ", 4) == 0) {
282 if (!scan_double(value, &cellhd->tb_res))
284 if (cellhd->tb_res <= 0.0)
289 if (strncmp(label,
"rows", 4) == 0 && strlen(label) == 4) {
292 if (!scan_int(value, &cellhd->rows))
294 if (cellhd->rows <= 0)
299 if (strncmp(label,
"rows3", 5) == 0) {
302 if (!scan_int(value, &cellhd->rows3))
304 if (cellhd->rows3 <= 0)
309 if (strncmp(label,
"cols", 4) == 0 && strlen(label) == 4) {
312 if (!scan_int(value, &cellhd->cols))
314 if (cellhd->cols <= 0)
319 if (strncmp(label,
"cols3", 5) == 0) {
322 if (!scan_int(value, &cellhd->cols3))
324 if (cellhd->cols3 <= 0)
329 if (strncmp(label,
"depths", 6) == 0) {
332 if (!scan_int(value, &cellhd->depths))
334 if (cellhd->depths <= 0)
339 if (strncmp(label,
"form", 4) == 0) {
342 if (!scan_int(value, &cellhd->format))
347 if (strncmp(label,
"comp", 4) == 0) {
350 if (!scan_int(value, &cellhd->compressed))
355 G_fatal_error(_(
"Syntax error in cell header, line %d: %s"), line, buf);
390 cellhd->ew_res3 = cellhd->ew_res;
391 cellhd->ns_res3 = cellhd->ns_res;
392 cellhd->cols3 = cellhd->cols;
393 cellhd->rows3 = cellhd->rows;