MCPcopy Index your code
hub / github.com/MapServer/MapServer / msGetProjectionString

Function msGetProjectionString

mapproject.c:1124–1168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1122/************************************************************************/
1123
1124char *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() */

Callers 6

msWMSLoadGetMapParamsFunction · 0.85
msTileSetProjectionsFunction · 0.85
checkProjectionMethod · 0.85
mapObj_getProjectionFunction · 0.85
layerObj_getProjectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected