Skip to content

Commit

Permalink
[Server][WFS] Update DescribeFeatureType 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Oct 12, 2017
1 parent c8a4407 commit d7a48c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/server/services/wfs/qgswfsdescribefeaturetype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qgswfsutils.h"
#include "qgsserverprojectutils.h"
#include "qgswfsdescribefeaturetype.h"
#include "qgswfsparameters.h"

#include "qgsproject.h"
#include "qgsexception.h"
Expand Down Expand Up @@ -53,6 +54,13 @@ namespace QgsWfs
QDomDocument doc;

QgsServerRequest::Parameters parameters = request.parameters();
QgsWfsParameters wfsParameters( parameters );
QgsWfsParameters::Format oFormat = wfsParameters.outputFormat();

// test oFormat
if ( oFormat == QgsWfsParameters::Format::NONE )
throw QgsBadRequestException( QStringLiteral( "Invalid WFS Parameter" ),
"OUTPUTFORMAT " + wfsParameters.outputFormatAsString() + "is not supported" );

QgsAccessControl *accessControl = serverIface->accessControls();

Expand All @@ -71,7 +79,10 @@ namespace QgsWfs
//xsd:import
QDomElement importElement = doc.createElement( QStringLiteral( "import" )/*xsd:import*/ );
importElement.setAttribute( QStringLiteral( "namespace" ), GML_NAMESPACE );
importElement.setAttribute( QStringLiteral( "schemaLocation" ), QStringLiteral( "http://schemas.opengis.net/gml/2.1.2/feature.xsd" ) );
if ( oFormat == QgsWfsParameters::Format::GML2 )
importElement.setAttribute( QStringLiteral( "schemaLocation" ), QStringLiteral( "http://schemas.opengis.net/gml/2.1.2/feature.xsd" ) );
else if ( oFormat == QgsWfsParameters::Format::GML3 )
importElement.setAttribute( QStringLiteral( "schemaLocation" ), QStringLiteral( "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" ) );
schemaElement.appendChild( importElement );

QStringList typeNameList;
Expand Down

0 comments on commit d7a48c6

Please sign in to comment.