GRASS Programmer's Manual
6.4.2(2012)
|
00001 #include <grass/gis.h> 00002 #include <grass/glocale.h> 00003 00004 int G__projection_units(int n) 00005 { 00006 switch (n) { 00007 case PROJECTION_XY: 00008 return 0; 00009 case PROJECTION_UTM: 00010 return METERS; 00011 case PROJECTION_SP: 00012 return FEET; 00013 case PROJECTION_LL: 00014 return DEGREES; 00015 default: 00016 return -1; 00017 } 00018 } 00019 00020 char *G__unit_name(int unit, int plural) 00021 { 00022 switch (unit) { 00023 case 0: 00024 return plural ? "units" : "unit"; 00025 case METERS: 00026 return plural ? "meters" : "meter"; 00027 case FEET: 00028 return plural ? "feet" : "foot"; 00029 case DEGREES: 00030 return plural ? "degrees" : "degree"; 00031 default: 00032 return NULL; 00033 } 00034 } 00035 00036 char *G__projection_name(int n) 00037 { 00038 switch (n) { 00039 case PROJECTION_XY: 00040 return "x,y"; 00041 case PROJECTION_UTM: 00042 return "UTM"; 00043 case PROJECTION_SP: 00044 return "State Plane"; 00045 case PROJECTION_LL: 00046 return _("Latitude-Longitude"); 00047 case PROJECTION_OTHER: 00048 return _("Other Projection"); 00049 default: 00050 return NULL; 00051 } 00052 }