input.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. ************************************************************
  3. * MODULE: r.le.patch/input.c *
  4. * Version 5.0 Nov. 1, 2001 *
  5. * *
  6. * AUTHOR: W.L. Baker, University of Wyoming *
  7. * BAKERWL@UWYO.EDU *
  8. * *
  9. * PURPOSE: To analyze attributes of patches in a landscape *
  10. * input.c reads the user's requests from the *
  11. * and sets appropriate flags *
  12. * *
  13. * COPYRIGHT: (C) 2001 by W.L. Baker *
  14. * *
  15. * This program is free software under the GNU General *
  16. * Public License(>=v2). Read the file COPYING that comes *
  17. * with GRASS for details *
  18. * *
  19. ************************************************************/
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <grass/config.h>
  23. #include "patch.h"
  24. extern struct CHOICE *choice;
  25. void user_input(int argc, char **argv)
  26. {
  27. int i, count = 0;
  28. /* setup the GRASS parsing routine
  29. structures to be used to read
  30. in the user's parameter choices */
  31. struct Flag *cor;
  32. struct Flag *pat;
  33. struct Flag *bound;
  34. struct Flag *trace;
  35. struct Flag *units;
  36. struct Option *name;
  37. struct Option *sampling_method;
  38. struct Option *region;
  39. struct Option *att;
  40. struct Option *size;
  41. struct Option *edge;
  42. struct Option *core;
  43. struct Option *shape;
  44. struct Option *shape_m;
  45. struct Option *boundary;
  46. struct Option *perimeter;
  47. struct Option *out;
  48. /* use the GRASS parsing routines
  49. to read in the user's parameter
  50. choices */
  51. cor = G_define_flag();
  52. cor->key = 'c';
  53. cor->description =
  54. "Output map 'interior' with patch cores (specify co1 & co2)";
  55. pat = G_define_flag();
  56. pat->key = 'n';
  57. pat->description = "Output map 'num' with patch numbers";
  58. bound = G_define_flag();
  59. bound->key = 'p';
  60. bound->description = "Include sampling area boundary as perimeter";
  61. trace = G_define_flag();
  62. trace->key = 't';
  63. trace->description = "Use 4 neighbor instead of 8 neighbor tracing";
  64. units = G_define_flag();
  65. units->key = 'u';
  66. units->description =
  67. "Output maps 'units_x' with sampling units for each scale x ";
  68. name = G_define_option();
  69. name->key = "map";
  70. name->description = "Raster map to be analyzed";
  71. name->type = TYPE_STRING;
  72. name->gisprompt = "old,cell,raster";
  73. name->required = YES;
  74. sampling_method = G_define_option();
  75. sampling_method->answer = "w";
  76. sampling_method->key = "sam";
  77. sampling_method->description =
  78. "Sampling method (choose only 1 method): \n"
  79. "\tw = whole map u = units m = moving window r = regions";
  80. sampling_method->type = TYPE_STRING;
  81. sampling_method->multiple = NO;
  82. sampling_method->required = NO;
  83. region = G_define_option();
  84. region->key = "reg";
  85. region->description =
  86. "Name of regions map, only when sam = r; omit otherwise";
  87. region->type = TYPE_STRING;
  88. region->gisprompt = "old,cell,raster";
  89. region->required = NO;
  90. att = G_define_option();
  91. att->key = "att";
  92. att->description = "a1 = mn. pixel att. \t\ta2 = s.d. pixel att.\n"
  93. "\ta3 = mn. patch att. \t\ta4 = s.d. patch att.\n"
  94. "\ta5 = cover by gp \t\ta6 = density by gp\n"
  95. "\ta7 = total density \t\ta8 = eff. mesh number";
  96. att->options = "a1,a2,a3,a4,a5,a6,a7,a8";
  97. att->type = TYPE_STRING;
  98. att->multiple = YES;
  99. att->required = NO;
  100. size = G_define_option();
  101. size->key = "siz";
  102. size->description = "s1 = mn. patch size\t\ts2 = s.d. patch size\n"
  103. "\ts3 = mn. patch size by gp\ts4 = s.d. patch size by gp \n"
  104. "\ts5 = no. by size class\t\ts6 = no. by size class by gp\n"
  105. "\ts7 = eff. mesh size \t\ts8 = deg. landsc. division";
  106. size->options = "s1,s2,s3,s4,s5,s6,s7,s8";
  107. size->type = TYPE_STRING;
  108. size->multiple = YES;
  109. size->required = NO;
  110. edge = G_define_option();
  111. edge->key = "co1";
  112. edge->description =
  113. "Depth-of-edge-influence in pixels (integer) for use with co2";
  114. edge->type = TYPE_INTEGER;
  115. edge->required = NO;
  116. core = G_define_option();
  117. core->key = "co2";
  118. core->description =
  119. "Core size measures (required if co1 was specified):\n"
  120. "\tc1 = mn. core size\t\tc2 = s.d. core size\n"
  121. "\tc3 = mn. edge size\t\tc4 = s.d. edge size\n"
  122. "\tc5 = mn. core size by gp\tc6 = s.d. core size by gp\n"
  123. "\tc7 = mn. edge size by gp\tc8 = s.d. edge size by gp\n"
  124. "\tc9 = no. by size class\t\tc10 = no. by size class by gp";
  125. core->options = "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10";
  126. core->type = TYPE_STRING;
  127. core->multiple = YES;
  128. core->required = NO;
  129. shape = G_define_option();
  130. shape->key = "sh1";
  131. shape->description = "Shape index (choose only 1 index):\n"
  132. "\tm1 = per./area m2 = corr. per./area m3 = rel. circum. circle";
  133. shape->type = TYPE_STRING;
  134. shape->multiple = NO;
  135. shape->required = NO;
  136. shape_m = G_define_option();
  137. shape_m->key = "sh2";
  138. shape_m->description = "Shape measures (required if sh1 was specified):\n"
  139. "\th1 = mn. patch shape\t\th2 = s.d. patch shape\n"
  140. "\th3 = mn. patch shape by gp\th4 = s.d. patch shape by gp\n"
  141. "\th5 = no. by shape class \th6 = no. by shape class by gp";
  142. shape_m->options = "h1,h2,h3,h4,h5,h6";
  143. shape_m->type = TYPE_STRING;
  144. shape_m->multiple = YES;
  145. shape_m->required = NO;
  146. boundary = G_define_option();
  147. boundary->key = "bnd";
  148. boundary->description =
  149. "n1 = mn. twist number n2 = s.d. twist number\n"
  150. "\tn3 = mn. omega index n4 = s.d. omega index";
  151. boundary->options = "n1,n2,n3,n4";
  152. boundary->type = TYPE_STRING;
  153. boundary->multiple = YES;
  154. boundary->required = NO;
  155. perimeter = G_define_option();
  156. perimeter->key = "per";
  157. perimeter->description =
  158. "p1 = sum of perims.\t\tp4 = sum of perims. by gp\n"
  159. "\tp2 = mn. per.\t\t\tp5 = mn. per. by gp\n"
  160. "\tp3 = s.d. per.\t\t\tp6 = s.d. per. by gp";
  161. perimeter->options = "p1,p2,p3,p4,p5,p6";
  162. perimeter->type = TYPE_STRING;
  163. perimeter->multiple = YES;
  164. perimeter->required = NO;
  165. out = G_define_option();
  166. out->key = "out";
  167. out->description =
  168. "Name of output file for individual patch measures, when sam=w,u,r;\n"
  169. "\tif out=head, then column headings will be printed";
  170. out->type = TYPE_STRING;
  171. out->required = NO;
  172. if (G_parser(argc, argv))
  173. exit(EXIT_FAILURE);
  174. /* record the user inputs for map,
  175. sam and out parameters */
  176. strcpy(choice->fn, name->answer);
  177. choice->wrum = sampling_method->answer[0];
  178. if (out->answer && choice->wrum != 'm')
  179. strcpy(choice->out, out->answer);
  180. else if (out->answer && choice->wrum == 'm') {
  181. fprintf(stderr, "\n");
  182. fprintf(stderr,
  183. " ***************************************************\n");
  184. fprintf(stderr,
  185. " You can use the out parameter only when sam=w,u,r \n");
  186. fprintf(stderr,
  187. " ***************************************************\n");
  188. exit(EXIT_FAILURE);
  189. }
  190. else
  191. strcpy(choice->out, "");
  192. /* check for unacceptable values for
  193. input parameters for sam */
  194. if (strcmp(sampling_method->answer, "w") &&
  195. strcmp(sampling_method->answer, "u") &&
  196. strcmp(sampling_method->answer, "m") &&
  197. strcmp(sampling_method->answer, "r")) {
  198. fprintf(stderr, "\n");
  199. fprintf(stderr,
  200. " ***************************************************\n");
  201. fprintf(stderr,
  202. " You input an unacceptable value for parameter sam \n");
  203. fprintf(stderr,
  204. " ***************************************************\n");
  205. exit(EXIT_FAILURE);
  206. }
  207. /* check for unacceptable values for
  208. input parameters for sh1 */
  209. if (shape->answer) {
  210. if (strcmp(shape->answer, "m1") &&
  211. strcmp(shape->answer, "m2") && strcmp(shape->answer, "m3")) {
  212. fprintf(stderr, "\n");
  213. fprintf(stderr,
  214. " ***************************************************\n");
  215. fprintf(stderr,
  216. " You input an unacceptable value for parameter sh1 \n");
  217. fprintf(stderr,
  218. " ***************************************************\n");
  219. exit(EXIT_FAILURE);
  220. }
  221. }
  222. /* check for multiple values for
  223. parameters that accept only 1 */
  224. if (sampling_method->answer)
  225. if (sampling_method->answers[1]) {
  226. fprintf(stderr, "\n");
  227. fprintf(stderr,
  228. " **********************************************\n");
  229. fprintf(stderr,
  230. " You input multiple values for parameter sam, \n");
  231. fprintf(stderr,
  232. " but only one is allowed \n");
  233. fprintf(stderr,
  234. " **********************************************\n");
  235. exit(EXIT_FAILURE);
  236. }
  237. if (shape->answer)
  238. if (shape->answers[1]) {
  239. fprintf(stderr, "\n");
  240. fprintf(stderr,
  241. " **********************************************\n");
  242. fprintf(stderr,
  243. " You input multiple values for parameter sh1, \n");
  244. fprintf(stderr,
  245. " but only one is allowed \n");
  246. fprintf(stderr,
  247. " **********************************************\n");
  248. exit(EXIT_FAILURE);
  249. }
  250. /* if the core flag -c is specified,
  251. then set the choice->coremap flag
  252. to 1 */
  253. choice->coremap = 0;
  254. if (!strcmp(sampling_method->answer, "w") && cor->answer)
  255. choice->coremap = 1;
  256. else if (strcmp(sampling_method->answer, "w") && cor->answer) {
  257. fprintf(stderr, "\n");
  258. fprintf(stderr,
  259. " ***********************************************\n");
  260. fprintf(stderr,
  261. " You requested output of map 'core' with patch \n");
  262. fprintf(stderr,
  263. " cores, by using flag -c, but this option \n");
  264. fprintf(stderr,
  265. " is only available when sam=w \n");
  266. fprintf(stderr,
  267. " ***********************************************\n");
  268. exit(EXIT_FAILURE);
  269. }
  270. /* if the pat flag -n is specified,
  271. then set the choice->coremap flag
  272. to 1 */
  273. choice->patchmap = 0;
  274. if (!strcmp(sampling_method->answer, "w") && pat->answer)
  275. choice->patchmap = 1;
  276. else if (strcmp(sampling_method->answer, "w") && pat->answer) {
  277. fprintf(stderr, "\n");
  278. fprintf(stderr,
  279. " **********************************************\n");
  280. fprintf(stderr,
  281. " You requested output of map 'num' with patch \n");
  282. fprintf(stderr,
  283. " numbers, by using flag -n, but this option \n");
  284. fprintf(stderr,
  285. " is only available when sam=w \n");
  286. fprintf(stderr,
  287. " **********************************************\n");
  288. exit(EXIT_FAILURE);
  289. }
  290. /* if the 4 neighbor tracing flag -t
  291. is specified, then set the
  292. choice->trace flag to 0 */
  293. choice->trace = 1;
  294. if (trace->answer)
  295. choice->trace = 0;
  296. /* if the -p flag is specified, then
  297. set the choice->perim2 flag to 0 */
  298. if (bound->answer)
  299. choice->perim2 = 0;
  300. else
  301. choice->perim2 = 1;
  302. /* if the -u flag is specified, then
  303. set the choice->units flag to 1 */
  304. choice->units = 0;
  305. if (!strcmp(sampling_method->answer, "u") && units->answer)
  306. choice->units = 1;
  307. else if (strcmp(sampling_method->answer, "u") && units->answer) {
  308. fprintf(stderr, "\n");
  309. fprintf(stderr,
  310. " ***************************************************\n");
  311. fprintf(stderr,
  312. " You requested output of map 'units' with sampling \n");
  313. fprintf(stderr,
  314. " units, by using flag -u, but this option is only \n");
  315. fprintf(stderr,
  316. " available when sam=u \n");
  317. fprintf(stderr,
  318. " ***************************************************\n");
  319. exit(EXIT_FAILURE);
  320. }
  321. /* if the co1 parameter is specified,
  322. then save the value of edge width
  323. in choice->edge */
  324. choice->edge = 0;
  325. if (edge->answer) {
  326. choice->edge = atoi(edge->answer);
  327. if (choice->edge < 0 ||
  328. choice->edge >= Rast_window_rows() ||
  329. choice->edge >= Rast_window_cols()) {
  330. fprintf(stderr, "\n");
  331. fprintf(stderr,
  332. " ***********************************************\n");
  333. fprintf(stderr,
  334. " You chose values for co1 that are either less \n");
  335. fprintf(stderr,
  336. " than 0 or too large \n");
  337. fprintf(stderr,
  338. " ***********************************************\n");
  339. exit(EXIT_FAILURE);
  340. }
  341. }
  342. /* if sampling_method is by REGION
  343. get region file name. Check to see
  344. that the name was input */
  345. if (!strcmp(sampling_method->answer, "r")) {
  346. if (region->answer)
  347. strcpy(choice->reg, region->answer);
  348. else {
  349. fprintf(stderr, "\n");
  350. fprintf(stderr,
  351. " ***********************************************\n");
  352. fprintf(stderr,
  353. " You requested sampling by region, but did not \n");
  354. fprintf(stderr,
  355. " input the name of the region using the reg= \n");
  356. fprintf(stderr,
  357. " parameter \n");
  358. fprintf(stderr,
  359. " ***********************************************\n");
  360. exit(EXIT_FAILURE);
  361. }
  362. }
  363. if (region->answer)
  364. if (strcmp(sampling_method->answer, "r")) {
  365. fprintf(stderr, "\n");
  366. fprintf(stderr,
  367. " ***********************************************\n");
  368. fprintf(stderr,
  369. " You requested sampling by region, by using \n");
  370. fprintf(stderr,
  371. " the reg= parameter, but did not input the \n");
  372. fprintf(stderr,
  373. " sam=r parameter \n");
  374. fprintf(stderr,
  375. " ***********************************************\n");
  376. exit(EXIT_FAILURE);
  377. }
  378. /* initialize flag arrays in choice
  379. data structure. */
  380. for (i = 0; i < 3; i++)
  381. choice->Mx[i] = 0;
  382. for (i = 0; i < 9; i++)
  383. choice->att[i] = 0;
  384. for (i = 0; i < 9; i++)
  385. choice->size[i] = 0;
  386. for (i = 0; i < 11; i++)
  387. choice->core[i] = 0;
  388. for (i = 0; i < 8; i++)
  389. choice->shape[i] = 0;
  390. for (i = 0; i < 5; i++)
  391. choice->boundary[i] = 0;
  392. for (i = 0; i < 8; i++)
  393. choice->perim[i] = 0;
  394. if (att->answer) {
  395. choice->att[0] = 1; /* flag for attribute computations. */
  396. for (i = 0; att->answers[i] != NULL; i++) {
  397. count++;
  398. if (!strcmp(att->answers[i], "a1"))
  399. choice->att[1] = 1;
  400. else if (!strcmp(att->answers[i], "a2"))
  401. choice->att[2] = 1;
  402. else if (!strcmp(att->answers[i], "a3"))
  403. choice->att[3] = 1;
  404. else if (!strcmp(att->answers[i], "a4"))
  405. choice->att[4] = 1;
  406. else if (!strcmp(att->answers[i], "a5"))
  407. choice->att[5] = 1;
  408. else if (!strcmp(att->answers[i], "a6"))
  409. choice->att[6] = 1;
  410. else if (!strcmp(att->answers[i], "a7"))
  411. choice->att[7] = 1;
  412. else if (!strcmp(att->answers[i], "a8"))
  413. choice->att[8] = 1;
  414. }
  415. }
  416. if (size->answer) {
  417. choice->size[0] = 1; /* flag for size computations. */
  418. for (i = 0; size->answers[i] != NULL; i++) {
  419. count++;
  420. if (!strcmp(size->answers[i], "s1"))
  421. choice->size[1] = 1;
  422. else if (!strcmp(size->answers[i], "s2"))
  423. choice->size[2] = 1;
  424. else if (!strcmp(size->answers[i], "s3"))
  425. choice->size[3] = 1;
  426. else if (!strcmp(size->answers[i], "s4"))
  427. choice->size[4] = 1;
  428. else if (!strcmp(size->answers[i], "s5"))
  429. choice->size[5] = 1;
  430. else if (!strcmp(size->answers[i], "s6")) {
  431. choice->size[6] = 1;
  432. choice->size2 = 1;
  433. }
  434. else if (!strcmp(size->answers[i], "s7"))
  435. choice->size[7] = 1;
  436. else if (!strcmp(size->answers[i], "s8"))
  437. choice->size[8] = 1;
  438. }
  439. }
  440. if (core->answer || edge->answer || cor->answer) {
  441. if (core->answer && edge->answer) {
  442. choice->core[0] = 1; /* flag for core computations. */
  443. for (i = 0; core->answers[i] != NULL; i++) {
  444. count++;
  445. if (!strcmp(core->answers[i], "c1"))
  446. choice->core[1] = 1;
  447. else if (!strcmp(core->answers[i], "c2"))
  448. choice->core[2] = 1;
  449. else if (!strcmp(core->answers[i], "c3"))
  450. choice->core[3] = 1;
  451. else if (!strcmp(core->answers[i], "c4"))
  452. choice->core[4] = 1;
  453. else if (!strcmp(core->answers[i], "c5"))
  454. choice->core[5] = 1;
  455. else if (!strcmp(core->answers[i], "c6"))
  456. choice->core[6] = 1;
  457. else if (!strcmp(core->answers[i], "c7"))
  458. choice->core[7] = 1;
  459. else if (!strcmp(core->answers[i], "c8"))
  460. choice->core[8] = 1;
  461. else if (!strcmp(core->answers[i], "c9"))
  462. choice->core[9] = 1;
  463. else if (!strcmp(core->answers[i], "c10")) {
  464. choice->core[10] = 1;
  465. choice->core2 = 1;
  466. }
  467. }
  468. }
  469. else {
  470. if (cor->answer) {
  471. fprintf(stderr, "\n");
  472. fprintf(stderr,
  473. " ***********************************************\n");
  474. fprintf(stderr,
  475. " You requested output of map 'core' with patch \n");
  476. fprintf(stderr,
  477. " cores, by using flag -c, but did not input \n");
  478. fprintf(stderr,
  479. " both parameter co1 and co2 \n");
  480. fprintf(stderr,
  481. " ***********************************************\n");
  482. exit(EXIT_FAILURE);
  483. }
  484. else {
  485. fprintf(stderr, "\n");
  486. fprintf(stderr,
  487. " ***********************************************\n");
  488. fprintf(stderr,
  489. " You requested core size measures, but did not \n");
  490. fprintf(stderr,
  491. " input both parameter co1 and co2 \n");
  492. fprintf(stderr,
  493. " ***********************************************\n");
  494. exit(EXIT_FAILURE);
  495. }
  496. }
  497. }
  498. if (shape->answer || shape_m->answer) {
  499. if (shape->answer && shape_m->answer) {
  500. if (!strcmp(shape->answer, "m1"))
  501. choice->Mx[1] = 1;
  502. else if (!strcmp(shape->answer, "m2"))
  503. choice->Mx[2] = 1;
  504. else if (!strcmp(shape->answer, "m3"))
  505. choice->Mx[3] = 1;
  506. choice->shape[0] = 1; /* flag for shape computations. */
  507. for (i = 0; shape_m->answers[i] != NULL; i++) {
  508. count++;
  509. if (!strcmp(shape_m->answers[i], "h1"))
  510. choice->shape[1] = 1;
  511. else if (!strcmp(shape_m->answers[i], "h2"))
  512. choice->shape[2] = 1;
  513. else if (!strcmp(shape_m->answers[i], "h3"))
  514. choice->shape[3] = 1;
  515. else if (!strcmp(shape_m->answers[i], "h4"))
  516. choice->shape[4] = 1;
  517. else if (!strcmp(shape_m->answers[i], "h5"))
  518. choice->shape[5] = 1;
  519. else if (!strcmp(shape_m->answers[i], "h6")) {
  520. choice->shape[6] = 1;
  521. choice->shape2 = 1;
  522. }
  523. }
  524. }
  525. else {
  526. fprintf(stderr, "\n");
  527. fprintf(stderr,
  528. " **********************************************\n");
  529. fprintf(stderr,
  530. " You requested shape measurement, but did not \n");
  531. fprintf(stderr,
  532. " input both parameter sh1 and sh2 \n");
  533. fprintf(stderr,
  534. " **********************************************\n");
  535. exit(EXIT_FAILURE);
  536. }
  537. }
  538. if (boundary->answer) {
  539. choice->boundary[0] = 1; /* flag for boundary complex. comput. */
  540. for (i = 0; boundary->answers[i] != NULL; i++) {
  541. count++;
  542. if (!strcmp(boundary->answers[i], "n1"))
  543. choice->boundary[1] = 1;
  544. else if (!strcmp(boundary->answers[i], "n2"))
  545. choice->boundary[2] = 1;
  546. else if (!strcmp(boundary->answers[i], "n3"))
  547. choice->boundary[3] = 1;
  548. else if (!strcmp(boundary->answers[i], "n4"))
  549. choice->boundary[4] = 1;
  550. }
  551. }
  552. if (perimeter->answer) {
  553. choice->perim[0] = 1; /* flag for perim. computations. */
  554. for (i = 0; perimeter->answers[i] != NULL; i++) {
  555. count++;
  556. if (!strcmp(perimeter->answers[i], "p1"))
  557. choice->perim[1] = 1;
  558. else if (!strcmp(perimeter->answers[i], "p2"))
  559. choice->perim[2] = 1;
  560. else if (!strcmp(perimeter->answers[i], "p3"))
  561. choice->perim[3] = 1;
  562. else if (!strcmp(perimeter->answers[i], "p4"))
  563. choice->perim[4] = 1;
  564. else if (!strcmp(perimeter->answers[i], "p5"))
  565. choice->perim[5] = 1;
  566. else if (!strcmp(perimeter->answers[i], "p6"))
  567. choice->perim[6] = 1;
  568. }
  569. }
  570. if (choice->wrum == 'm' && count > 25) {
  571. fprintf(stderr, "\n");
  572. fprintf(stderr,
  573. " ****************************************************\n");
  574. fprintf(stderr,
  575. " You can only choose up to 25 simultaneous measures \n");
  576. fprintf(stderr,
  577. " when using sam=m. Please redo your request. \n");
  578. fprintf(stderr,
  579. " ****************************************************\n");
  580. exit(EXIT_FAILURE);
  581. }
  582. if (!att->answer && !size->answer && !shape->answer && !shape_m->answer
  583. && !boundary->answer && !perimeter->answer && !core->answer) {
  584. fprintf(stderr, "\n");
  585. fprintf(stderr,
  586. " **************************************************\n");
  587. fprintf(stderr,
  588. " You did not select any measures to be calculated \n");
  589. fprintf(stderr,
  590. " **************************************************\n");
  591. exit(EXIT_FAILURE);
  592. }
  593. return;
  594. }