52 | | For example, by calling {{{SetImageFormat("image/png; PhotometricInterpretation=PaletteColor")}}}, WMS Provider will return raster stream in palette model. And by calling {{{SetImageFormat("image/png; PhotometricInterpretation=RGB")}}}, the raster stream will be returned in RGB model. |
53 | | |
54 | | In this way, WMS Provider could fully make use of the server capability to support different bit-depth. These additional parameters will go into the configuration file like: |
55 | | {{{ |
56 | | <RasterDefinition name="Image"> |
57 | | <Format>image/png;PhotometricInterpretation=PaletteColor</Format> |
| 52 | For example, by calling |
| 53 | |
| 54 | {{{ |
| 55 | SetImageFormat("image/png; PhotometricInterpretation=PaletteColor") |
| 56 | }}} |
| 57 | |
| 58 | The WMS Provider will return raster stream in palette model. And by calling |
| 59 | |
| 60 | {{{ |
| 61 | SetImageFormat("image/png; PhotometricInterpretation=RGB") |
| 62 | }}} |
| 63 | |
| 64 | the raster stream will be returned in RGB model. |
| 65 | |
| 66 | In this way, WMS Provider could fully make use of the server capability to support different bit-depth. These additional parameters will go into the configuration file in a NEW WMS configuration element <!FormatType>: |
| 67 | |
| 68 | {{{ |
| 69 | <RasterDefinition name="Image"> |
| 70 | <FormatType>image/png;PhotometricInterpretation=PaletteColor</FormatType> |
134 | | == Implications == |
135 | | |
136 | | • The change is backwards compatible with existing config files. Existing config files will be readable by the updated WMS provider. |
137 | | |
138 | | • The change is not forwards compatible. New config files created by the updated provider are not readable by earlier versions of the WMS provider. |
139 | | |
140 | | This is a problem because earlier versions of the WMS override API will do a strict check on parsing <Image> ... </Image> in the configuration file. It could only recognize "png", "jpg", "Gif", or "tif", as they are hard-coded in the code: |
141 | | {{{ |
142 | | static FdoString* g_WmsImageFormatPng = L"PNG"; |
143 | | static FdoString* g_WmsImageFormatTif = L"TIF"; |
144 | | static FdoString* g_WmsImageFormatJpg = L"JPG"; |
145 | | static FdoString* g_WmsImageFormatGif = L"GIF"; |
146 | | }}} |
| 148 | In order to make the proposed change both backwards and forwards compatible. Configuration files created by the 3.3.0 version of the WMS Provider will continue to write the value of the <Format> element as was previously done in FDO 3.2.2. This would allow continued compatibility with applications written for 3.2.2. At the same time the FDO 3.3 WMS provider configuration file would be modified to contain a new <!FormatType> element that would only be evaluated by the 3.3 version of the WMS provider and subsequent releases. FDO 3.3 would look for <!FormatType> first and if not found evaluate <Format>. FDO 3.2.2 would continue to evaluate <Format> and ignore <!FormatType>. There would some duplication of information, but applications written on both versions of the WMS Provider should continue to work as designed. The <Format> would be deemed deprecated and removed once forward compatibility support is no longer required. |
| 149 | |
| 150 | The resulting 3.3 WMS configuration xml document would take the form of... |
| 151 | |
| 152 | {{{ |
| 153 | <RasterDefinition name="Image"> |
| 154 | <Format>PNG</Format> // Deprecated element. This one is consistent with FDO 3.2.2 |
| 155 | <FormatType>image/png;PhotometricInterpretation=PaletteColor</FormatType> |
| 156 | ... |
| 157 | </RasterDefinition> |
| 158 | }}} |
| 159 | |
| 160 | |
| 161 | '''For the 3.2.2 FDO WMS configuration API'''.... |
| 162 | |
| 163 | Calls to |
| 164 | |
| 165 | {{{ |
| 166 | void FdoWmsOvRasterDefinition::SetFormatType(FdoWmsOvFormatType value); |
| 167 | }}} |
| 168 | |
| 169 | would continue to result in the generation of XML content that contained only the FORMAT element as follows |
| 170 | |
| 171 | {{{ |
| 172 | <RasterDefinition name="Image"> |
| 173 | <Format>PNG</Format> |
| 174 | ... |
| 175 | </RasterDefinition> |
| 176 | }}} |
| 177 | |
| 178 | |
| 179 | Calls to |
| 180 | |
| 181 | {{{ |
| 182 | FdoWmsOvFormatType FdoWmsOvRasterDefinition::GetFormatType(void) const; |
| 183 | }}} |
| 184 | |
| 185 | would continue to result in the return of the expected !FdoWmsOvFormatType enumeration type |
| 186 | |
| 187 | |
| 188 | '''For the 3.3 FDO WMS configuration API'''.... |
| 189 | |
| 190 | Calls to |
| 191 | |
| 192 | {{{ |
| 193 | void SetImageFormat(FdoString* value); |
| 194 | }}} |
| 195 | |
| 196 | would result in the generation of XML content that contained both <Format> and <!FormatType> |
| 197 | |
| 198 | {{{ |
| 199 | <RasterDefinition name="Image"> |
| 200 | <Format>PNG</Format> |
| 201 | <FormatType>image/png;PhotometricInterpretation=PaletteColor</Format> |
| 202 | ... |
| 203 | </RasterDefinition> |
| 204 | }}} |
| 205 | |
| 206 | where the content of <!FormatType> is the content passed through the call to !SetImageFormat() and the content of <Format> is interpreted and set form the allowed values of <!FormatType>, with a default value of PNG being used no valid interpretation can be made. |
| 207 | |
| 208 | Calls to |
| 209 | |
| 210 | {{{ |
| 211 | FdoString* GetImageFormat(void) const; |
| 212 | }}} |
| 213 | |
| 214 | would result in the return of the expected string set through the call to !SetImageFormat() and/or the value contained in the <!FormatType> element. The content in <Format> would not be returned or evaluated. |