Skip to content

Commit 83e6213

Browse files
github-actions[bot]nyalldawson
authored andcommittedMay 27, 2020
[Server, WCS] Fix several non compliance errors in CoverageDescription output
1 parent 646f76f commit 83e6213

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed
 

‎src/server/services/wcs/qgswcsutils.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,29 @@ namespace QgsWcs
150150
QDomElement xAxisElem = doc.createElement( QStringLiteral( "gml:axisName" ) );
151151
QDomText xAxisText = doc.createTextNode( QStringLiteral( "x" ) );
152152
xAxisElem.appendChild( xAxisText );
153-
spatialDomainElem.appendChild( xAxisElem );
153+
rectGridElem.appendChild( xAxisElem );
154154

155155
QDomElement yAxisElem = doc.createElement( QStringLiteral( "gml:axisName" ) );
156156
QDomText yAxisText = doc.createTextNode( QStringLiteral( "y" ) );
157157
yAxisElem.appendChild( yAxisText );
158-
spatialDomainElem.appendChild( yAxisElem );
158+
rectGridElem.appendChild( yAxisElem );
159159

160160
QDomElement originElem = doc.createElement( QStringLiteral( "gml:origin" ) );
161161
QDomElement originPosElem = doc.createElement( QStringLiteral( "gml:pos" ) );
162+
originElem.appendChild( originPosElem );
162163
QDomText originPosText = doc.createTextNode( qgsDoubleToString( QgsServerProjectUtils::floorWithPrecision( layerBBox.xMinimum(), precision ), precision ) + " " + qgsDoubleToString( QgsServerProjectUtils::floorWithPrecision( layerBBox.yMinimum(), precision ), precision ) );
163164
originPosElem.appendChild( originPosText );
164-
spatialDomainElem.appendChild( originElem );
165+
rectGridElem.appendChild( originElem );
165166

166167
QDomElement xOffsetElem = doc.createElement( QStringLiteral( "gml:offsetVector" ) );
167168
QDomText xOffsetText = doc.createTextNode( QString::number( layer->rasterUnitsPerPixelX() ) + " 0" );
168169
xOffsetElem.appendChild( xOffsetText );
169-
spatialDomainElem.appendChild( xOffsetElem );
170+
rectGridElem.appendChild( xOffsetElem );
170171

171172
QDomElement yOffsetElem = doc.createElement( QStringLiteral( "gml:offsetVector" ) );
172173
QDomText yOffsetText = doc.createTextNode( "0 " + QString::number( layer->rasterUnitsPerPixelY() ) );
173174
yOffsetElem.appendChild( yOffsetText );
174-
spatialDomainElem.appendChild( yOffsetElem );
175+
rectGridElem.appendChild( yOffsetElem );
175176

176177
//GML property containing one RangeSet GML object.
177178
QDomElement rangeSetElem = doc.createElement( QStringLiteral( "rangeSet" ) );
@@ -192,6 +193,11 @@ namespace QgsWcs
192193
rsNameElem.appendChild( rsNameText );
193194
RangeSetElem.appendChild( rsNameElem );
194195

196+
QDomElement rsLabelElem = doc.createElement( QStringLiteral( "label" ) );
197+
QDomText rsLabelText = doc.createTextNode( QStringLiteral( "Bands" ) );
198+
rsLabelElem.appendChild( rsLabelText );
199+
RangeSetElem.appendChild( rsLabelElem );
200+
195201
QDomElement axisDescElem = doc.createElement( QStringLiteral( "axisDescription" ) );
196202
RangeSetElem.appendChild( axisDescElem );
197203

@@ -203,10 +209,15 @@ namespace QgsWcs
203209
adNameElem.appendChild( adNameText );
204210
AxisDescElem.appendChild( adNameElem );
205211

212+
QDomElement adLabelElem = doc.createElement( QStringLiteral( "label" ) );
213+
QDomText adLablelText = doc.createTextNode( QStringLiteral( "bands" ) );
214+
adLabelElem.appendChild( adLablelText );
215+
AxisDescElem.appendChild( adLabelElem );
216+
206217
QDomElement adValuesElem = doc.createElement( QStringLiteral( "values" ) );
207218
for ( int idx = 0; idx < layer->bandCount(); ++idx )
208219
{
209-
QDomElement adValueElem = doc.createElement( QStringLiteral( "value" ) );
220+
QDomElement adValueElem = doc.createElement( QStringLiteral( "singleValue" ) );
210221
QDomText adValueText = doc.createTextNode( QString::number( idx + 1 ) );
211222
adValueElem.appendChild( adValueText );
212223
adValuesElem.appendChild( adValueElem );

‎tests/testdata/qgis_server/wcs_describecoverage.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,26 @@ Content-Type: text/xml; charset=utf-8
2222
<gml:high>3600 3600</gml:high>
2323
</gml:GridEnvelope>
2424
</gml:limits>
25+
<gml:axisName>x</gml:axisName>
26+
<gml:axisName>y</gml:axisName>
27+
<gml:origin>
28+
<gml:pos>-30 29.999999</gml:pos>
29+
</gml:origin>
30+
<gml:offsetVector>0.00833333 0</gml:offsetVector>
31+
<gml:offsetVector>0 0.00833333</gml:offsetVector>
2532
</gml:RectifiedGrid>
26-
<gml:axisName>x</gml:axisName>
27-
<gml:axisName>y</gml:axisName>
28-
<gml:origin/>
29-
<gml:offsetVector>0.00833333 0</gml:offsetVector>
30-
<gml:offsetVector>0 0.00833333</gml:offsetVector>
3133
</spatialDomain>
3234
</domainSet>
3335
<rangeSet>
3436
<RangeSet>
3537
<name>Bands</name>
38+
<label>Bands</label>
3639
<axisDescription>
3740
<AxisDescription>
3841
<name>bands</name>
42+
<label>bands</label>
3943
<values>
40-
<value>1</value>
44+
<singleValue>1</singleValue>
4145
</values>
4246
</AxisDescription>
4347
</axisDescription>

0 commit comments

Comments
 (0)
Please sign in to comment.