Skip to content
Permalink
Browse files

[Server, WCS] Fix several non compliance errors in CoverageDescriptio…

…n output
  • Loading branch information
github-actions authored and nyalldawson committed May 27, 2020
1 parent 646f76f commit 83e62136a6b28b6c240bdda37e12e7eb5decb27b
Showing with 27 additions and 12 deletions.
  1. +17 −6 src/server/services/wcs/qgswcsutils.cpp
  2. +10 −6 tests/testdata/qgis_server/wcs_describecoverage.txt
@@ -150,28 +150,29 @@ namespace QgsWcs
QDomElement xAxisElem = doc.createElement( QStringLiteral( "gml:axisName" ) );
QDomText xAxisText = doc.createTextNode( QStringLiteral( "x" ) );
xAxisElem.appendChild( xAxisText );
spatialDomainElem.appendChild( xAxisElem );
rectGridElem.appendChild( xAxisElem );

QDomElement yAxisElem = doc.createElement( QStringLiteral( "gml:axisName" ) );
QDomText yAxisText = doc.createTextNode( QStringLiteral( "y" ) );
yAxisElem.appendChild( yAxisText );
spatialDomainElem.appendChild( yAxisElem );
rectGridElem.appendChild( yAxisElem );

QDomElement originElem = doc.createElement( QStringLiteral( "gml:origin" ) );
QDomElement originPosElem = doc.createElement( QStringLiteral( "gml:pos" ) );
originElem.appendChild( originPosElem );
QDomText originPosText = doc.createTextNode( qgsDoubleToString( QgsServerProjectUtils::floorWithPrecision( layerBBox.xMinimum(), precision ), precision ) + " " + qgsDoubleToString( QgsServerProjectUtils::floorWithPrecision( layerBBox.yMinimum(), precision ), precision ) );
originPosElem.appendChild( originPosText );
spatialDomainElem.appendChild( originElem );
rectGridElem.appendChild( originElem );

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

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

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

QDomElement rsLabelElem = doc.createElement( QStringLiteral( "label" ) );
QDomText rsLabelText = doc.createTextNode( QStringLiteral( "Bands" ) );
rsLabelElem.appendChild( rsLabelText );
RangeSetElem.appendChild( rsLabelElem );

QDomElement axisDescElem = doc.createElement( QStringLiteral( "axisDescription" ) );
RangeSetElem.appendChild( axisDescElem );

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

QDomElement adLabelElem = doc.createElement( QStringLiteral( "label" ) );
QDomText adLablelText = doc.createTextNode( QStringLiteral( "bands" ) );
adLabelElem.appendChild( adLablelText );
AxisDescElem.appendChild( adLabelElem );

QDomElement adValuesElem = doc.createElement( QStringLiteral( "values" ) );
for ( int idx = 0; idx < layer->bandCount(); ++idx )
{
QDomElement adValueElem = doc.createElement( QStringLiteral( "value" ) );
QDomElement adValueElem = doc.createElement( QStringLiteral( "singleValue" ) );
QDomText adValueText = doc.createTextNode( QString::number( idx + 1 ) );
adValueElem.appendChild( adValueText );
adValuesElem.appendChild( adValueElem );
@@ -22,22 +22,26 @@ Content-Type: text/xml; charset=utf-8
<gml:high>3600 3600</gml:high>
</gml:GridEnvelope>
</gml:limits>
<gml:axisName>x</gml:axisName>
<gml:axisName>y</gml:axisName>
<gml:origin>
<gml:pos>-30 29.999999</gml:pos>
</gml:origin>
<gml:offsetVector>0.00833333 0</gml:offsetVector>
<gml:offsetVector>0 0.00833333</gml:offsetVector>
</gml:RectifiedGrid>
<gml:axisName>x</gml:axisName>
<gml:axisName>y</gml:axisName>
<gml:origin/>
<gml:offsetVector>0.00833333 0</gml:offsetVector>
<gml:offsetVector>0 0.00833333</gml:offsetVector>
</spatialDomain>
</domainSet>
<rangeSet>
<RangeSet>
<name>Bands</name>
<label>Bands</label>
<axisDescription>
<AxisDescription>
<name>bands</name>
<label>bands</label>
<values>
<value>1</value>
<singleValue>1</singleValue>
</values>
</AxisDescription>
</axisDescription>

0 comments on commit 83e6213

Please sign in to comment.
You can’t perform that action at this time.