| 1122 | /************************************************************************/ |
| 1123 | |
| 1124 | char *msGetProjectionString(projectionObj *proj) |
| 1125 | { |
| 1126 | char *pszProjString = NULL; |
| 1127 | int i = 0, nLen = 0; |
| 1128 | |
| 1129 | if (proj) |
| 1130 | { |
| 1131 | /* -------------------------------------------------------------------- */ |
| 1132 | /* Alloc buffer large enough to hold the whole projection defn */ |
| 1133 | /* -------------------------------------------------------------------- */ |
| 1134 | for (i=0; i<proj->numargs; i++) |
| 1135 | { |
| 1136 | if (proj->args[i]) |
| 1137 | nLen += (strlen(proj->args[i]) + 2); |
| 1138 | } |
| 1139 | |
| 1140 | pszProjString = (char*)malloc(sizeof(char) * nLen+1); |
| 1141 | pszProjString[0] = '\0'; |
| 1142 | |
| 1143 | /* -------------------------------------------------------------------- */ |
| 1144 | /* Plug each arg into the string with a '+' prefix */ |
| 1145 | /* -------------------------------------------------------------------- */ |
| 1146 | for (i=0; i<proj->numargs; i++) |
| 1147 | { |
| 1148 | if (!proj->args[i] || strlen(proj->args[i]) == 0) |
| 1149 | continue; |
| 1150 | if (pszProjString[0] == '\0') |
| 1151 | { |
| 1152 | /* no space at beginning of line */ |
| 1153 | if (proj->args[i][0] != '+') |
| 1154 | strcat(pszProjString, "+"); |
| 1155 | } |
| 1156 | else |
| 1157 | { |
| 1158 | if (proj->args[i][0] != '+') |
| 1159 | strcat(pszProjString, " +"); |
| 1160 | else |
| 1161 | strcat(pszProjString, " "); |
| 1162 | } |
| 1163 | strcat(pszProjString, proj->args[i]); |
| 1164 | } |
| 1165 | } |
| 1166 | |
| 1167 | return pszProjString; |
| 1168 | } |
| 1169 | |
| 1170 | /************************************************************************/ |
| 1171 | /* msAxisNormalizePoints() */ |
no outgoing calls
no test coverage detected