Skip to content

Commit

Permalink
Add GetContext request to QGIS WMS Server
Browse files Browse the repository at this point in the history
This non standard request retruns the QGIS project as an OWSContext
document version 0.3.1.
This request gives more interoperability to QGIS Server that can be
directly used in client supporting OWSContext as config file.
This function has been funded by Ifremer.
  • Loading branch information
rldhont committed May 31, 2013
1 parent ce92549 commit 48b39b6
Show file tree
Hide file tree
Showing 7 changed files with 455 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/mapserver/qgis_map_serv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,22 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.compare( "GetContext", Qt::CaseInsensitive ) == 0 )
{
try
{
QDomDocument doc = theServer->getContext();
theRequestHandler->sendGetStyleResponse( doc );
}
catch ( QgsMapServiceException& ex )
{
theRequestHandler->sendServiceException( ex );
}

delete theRequestHandler;
delete theServer;
continue;
}
else if ( request.compare( "GetStyles", Qt::CaseInsensitive ) == 0 || request.compare( "GetStyle", Qt::CaseInsensitive ) == 0 ) // GetStyle for compatibility with earlier QGIS versions
{
try
Expand Down
2 changes: 2 additions & 0 deletions src/mapserver/qgsconfigparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class QgsConfigParser

virtual void featureTypeList( QDomElement& parentElement, QDomDocument& doc ) const = 0;

virtual void owsGeneralAndResourceList( QDomElement& parentElement, QDomDocument& doc, const QString& strHref ) const = 0;

virtual void describeFeatureType( const QString& aTypeName, QDomElement& parentElement, QDomDocument& doc ) const = 0;
/**Returns one or possibly several maplayers for a given type name. If no layers/style are found, an empty list is returned*/
virtual QList<QgsMapLayer*> mapLayerFromTypeName( const QString& tName, bool useCache = true ) const = 0;
Expand Down
Loading

0 comments on commit 48b39b6

Please sign in to comment.