proj2.c 923 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include <grass/gis.h>
  2. #include <grass/glocale.h>
  3. int G__projection_units(int n)
  4. {
  5. switch (n) {
  6. case PROJECTION_XY:
  7. return 0;
  8. case PROJECTION_UTM:
  9. return METERS;
  10. case PROJECTION_SP:
  11. return FEET;
  12. case PROJECTION_LL:
  13. return DEGREES;
  14. default:
  15. return -1;
  16. }
  17. }
  18. char *G__unit_name(int unit, int plural)
  19. {
  20. switch (unit) {
  21. case 0:
  22. return plural ? "units" : "unit";
  23. case METERS:
  24. return plural ? "meters" : "meter";
  25. case FEET:
  26. return plural ? "feet" : "foot";
  27. case DEGREES:
  28. return plural ? "degrees" : "degree";
  29. default:
  30. return NULL;
  31. }
  32. }
  33. char *G__projection_name(int n)
  34. {
  35. switch (n) {
  36. case PROJECTION_XY:
  37. return "x,y";
  38. case PROJECTION_UTM:
  39. return "UTM";
  40. case PROJECTION_SP:
  41. return "State Plane";
  42. case PROJECTION_LL:
  43. return _("Latitude-Longitude");
  44. case PROJECTION_OTHER:
  45. return _("Other Projection");
  46. default:
  47. return NULL;
  48. }
  49. }