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

Function msWCSGetFormatsList11

mapwcs11.c:114–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112/************************************************************************/
113
114static char *msWCSGetFormatsList11( mapObj *map, layerObj *layer )
115
116{
117 char *format_list = msStrdup("");
118 char **tokens = NULL, **formats = NULL;
119 int i, numtokens = 0, numformats;
120 const char *value;
121
122 msApplyDefaultOutputFormats(map);
123
124/* -------------------------------------------------------------------- */
125/* Parse from layer metadata. */
126/* -------------------------------------------------------------------- */
127 if( layer != NULL
128 && (value = msOWSGetEncodeMetadata( &(layer->metadata),"CO","formats",
129 "GTiff" )) != NULL ) {
130 tokens = msStringSplit(value, ' ', &numtokens);
131 }
132
133/* -------------------------------------------------------------------- */
134/* Or generate from all configured raster output formats that */
135/* look plausible. */
136/* -------------------------------------------------------------------- */
137 else
138 {
139 tokens = (char **) calloc(map->numoutputformats,sizeof(char*));
140 for( i = 0; i < map->numoutputformats; i++ )
141 {
142 switch( map->outputformatlist[i]->renderer )
143 {
144 /* seeminly normal raster format */
145 case MS_RENDER_WITH_GD:
146 case MS_RENDER_WITH_AGG:
147 case MS_RENDER_WITH_RAWDATA:
148 tokens[numtokens++] = msStrdup(map->outputformatlist[i]->name);
149 break;
150
151 /* rest of formats aren't really WCS compatible */
152 default:
153 break;
154
155 }
156 }
157 }
158
159/* -------------------------------------------------------------------- */
160/* Convert outputFormatObj names into mime types and remove */
161/* duplicates. */
162/* -------------------------------------------------------------------- */
163 numformats = 0;
164 formats = (char **) calloc(sizeof(char*),numtokens);
165
166 for( i = 0; i < numtokens; i++ )
167 {
168 int format_i, j;
169 const char *mimetype;
170
171 for( format_i = 0; format_i < map->numoutputformats; format_i++ )

Calls 8

msStrdupFunction · 0.85
msOWSGetEncodeMetadataFunction · 0.85
msStringSplitFunction · 0.85
strcasecmpFunction · 0.85
msDebugFunction · 0.85
msFreeCharArrayFunction · 0.85
msStringConcatenateFunction · 0.85

Tested by

no test coverage detected