Skip to content
Permalink
Browse files

Merge pull request #4157 from rldhont/server-wcs-configparser

[Server] Remove QgsWCSProjectParser
  • Loading branch information
rldhont committed Feb 28, 2017
2 parents 79580be + 98d323e commit ac6cf198982e17b628ee40de42658aecaa4f865f
@@ -32,7 +32,6 @@ class QgsConfigCache: QObject
~QgsConfigCache();

QgsServerProjectParser* serverConfiguration( const QString& filePath );
QgsWCSProjectParser* wcsConfiguration( const QString& filePath, const QgsAccessControl* accessControl );
QgsWfsProjectParser* wfsConfiguration( const QString& filePath, const QgsAccessControl* accessControl );
QgsWmsConfigParser* wmsConfiguration( const QString& filePath, const QgsAccessControl* accessControl, const QMap<QString, QString>& parameterMap = QMap< QString, QString >() );

@@ -26,6 +26,79 @@
*/
namespace QgsServerProjectUtils
{

/** Returns if owsService capabilities are enabled.
* @param project the QGIS project
* @return if owsService capabilities are enabled.
*/
bool owsServiceCapabilities( const QgsProject& project );

/** Returns the owsService title defined in project.
* @param project the QGIS project
* @return the owsService title if defined in project.
*/
QString owsServiceTitle( const QgsProject& project );

/** Returns the owsService abstract defined in project.
* @param project the QGIS project
* @return the owsService abstract if defined in project.
*/
QString owsServiceAbstract( const QgsProject& project );

/** Returns the owsService keywords defined in project.
* @param project the QGIS project
* @return the owsService keywords if defined in project.
*/
QStringList owsServiceKeywords( const QgsProject& project );

/** Returns the owsService online resource defined in project.
* @param project the QGIS project
* @return the owsService online resource if defined in project.
*/
QString owsServiceOnlineResource( const QgsProject& project );

/** Returns the owsService contact organization defined in project.
* @param project the QGIS project
* @return the owsService contact organization if defined in project.
*/
QString owsServiceContactOrganization( const QgsProject& project );

/** Returns the owsService contact position defined in project.
* @param project the QGIS project
* @return the owsService contact position if defined in project.
*/
QString owsServiceContactPosition( const QgsProject& project );

/** Returns the owsService contact person defined in project.
* @param project the QGIS project
* @return the owsService contact person if defined in project.
*/
QString owsServiceContactPerson( const QgsProject& project );

/** Returns the owsService contact mail defined in project.
* @param project the QGIS project
* @return the owsService contact mail if defined in project.
*/
QString owsServiceContactMail( const QgsProject& project );

/** Returns the owsService contact phone defined in project.
* @param project the QGIS project
* @return the owsService contact phone if defined in project.
*/
QString owsServiceContactPhone( const QgsProject& project );

/** Returns the owsService fees defined in project.
* @param project the QGIS project
* @return the owsService fees if defined in project.
*/
QString owsServiceFees( const QgsProject& project );

/** Returns the owsService access constraints defined in project.
* @param project the QGIS project
* @return the owsService access constraints if defined in project.
*/
QString owsServiceAccessConstraints( const QgsProject& project );

/** Returns the maximum width for WMS images defined in a QGIS project.
* @param project the QGIS project
* @return width if defined in project, -1 otherwise.
@@ -38,7 +111,7 @@ namespace QgsServerProjectUtils
*/
int wmsMaxHeight( const QgsProject& project );

/** Returns the WMS service url defined in a QGIS project.
/** Returns the WMS ervice url defined in a QGIS project.
* @param project the QGIS project
* @return url if defined in project, an empty string otherwise.
*/
@@ -55,4 +128,10 @@ namespace QgsServerProjectUtils
* @return url if defined in project, an empty string otherwise.
*/
QString wcsServiceUrl( const QgsProject& project );

/** Returns the Layer ids list defined in a QGIS project as published in WCS.
* @param project the QGIS project
* @return the Layer ids list.
*/
QStringList wcsLayers( const QgsProject& project );
};

This file was deleted.

This file was deleted.

@@ -1,5 +1,5 @@
/***************************************************************************
qgswcsprojectparser.sip
qgswmsprojectparser.sip
------------------------
begin : May 2, 2015
copyright : (C) 2015 by Alessandro Pasotti
@@ -21,7 +21,6 @@
%Include qgscapabilitiescache.sip
%Include qgsrequesthandler.sip
%Include qgsserverprojectparser.sip
%Include qgswcsprojectparser.sip
%Include qgswmsconfigparser.sip
%Include qgswmsprojectparser.sip
%Include qgswfsprojectparser.sip
@@ -566,7 +566,7 @@ QString QgsRasterLayer::providerType() const
/**
* @return the horizontal units per pixel as reported in the GDAL geotramsform[1]
*/
double QgsRasterLayer::rasterUnitsPerPixelX()
double QgsRasterLayer::rasterUnitsPerPixelX() const
{
// We return one raster pixel per map unit pixel
// One raster pixel can have several raster units...
@@ -581,7 +581,7 @@ double QgsRasterLayer::rasterUnitsPerPixelX()
return 1;
}

double QgsRasterLayer::rasterUnitsPerPixelY()
double QgsRasterLayer::rasterUnitsPerPixelY() const
{
if ( mDataProvider->capabilities() & QgsRasterDataProvider::Size && mDataProvider->xSize() > 0 )
{
@@ -282,9 +282,10 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
//! \brief [ data provider interface ] Which provider is being used for this Raster Layer?
QString providerType() const;

//! \brief Returns the number of raster units per each raster pixel. In a world file, this is normally the first row (without the sign)
double rasterUnitsPerPixelX();
double rasterUnitsPerPixelY();
//! \brief Returns the number of raster units per each raster pixel in X axis. In a world file, this is normally the first row (without the sign)
double rasterUnitsPerPixelX() const;
//! \brief Returns the number of raster units per each raster pixel in Y axis. In a world file, this is normally the first row (without the sign)
double rasterUnitsPerPixelY() const;

/** \brief Set contrast enhancement algorithm
* @param algorithm Contrast enhancement algorithm
@@ -34,7 +34,6 @@ SET(qgis_mapserv_SRCS
qgsremotedatasourcebuilder.cpp
qgssentdatasourcebuilder.cpp
qgsserverlogger.cpp
qgswcsprojectparser.cpp
qgswfsprojectparser.cpp
qgswmsconfigparser.cpp
qgswmsprojectparser.cpp
@@ -18,7 +18,6 @@
#include "qgsconfigcache.h"
#include "qgsmessagelog.h"
#include "qgsmslayercache.h"
#include "qgswcsprojectparser.h"
#include "qgswfsprojectparser.h"
#include "qgswmsprojectparser.h"
#include "qgssldconfigparser.h"
@@ -77,32 +76,6 @@ QgsServerProjectParser* QgsConfigCache::serverConfiguration( const QString& file
return new QgsServerProjectParser( doc, filePath );
}

QgsWCSProjectParser *QgsConfigCache::wcsConfiguration(
const QString& filePath
, const QgsAccessControl* accessControl
)
{
QgsWCSProjectParser *p = mWCSConfigCache.object( filePath );
if ( !p )
{
QDomDocument* doc = xmlDocument( filePath );
if ( !doc )
{
return nullptr;
}
p = new QgsWCSProjectParser(
filePath
, accessControl
);
mWCSConfigCache.insert( filePath, p );
p = mWCSConfigCache.object( filePath );
Q_ASSERT( p );
}

QgsMSLayerCache::instance()->setProjectMaxLayers( p->wcsLayers().size() );
return p;
}

QgsWfsProjectParser *QgsConfigCache::wfsConfiguration(
const QString& filePath
, const QgsAccessControl* accessControl
@@ -210,7 +183,6 @@ void QgsConfigCache::removeChangedEntry( const QString& path )
{
mWMSConfigCache.remove( path );
mWFSConfigCache.remove( path );
mWCSConfigCache.remove( path );

//xml document must be removed last, as other config cache destructors may require it
mXmlDocumentCache.remove( path );
@@ -28,7 +28,6 @@
#include "qgis_server.h"
#include "qgswmsconfigparser.h"
#include "qgswfsprojectparser.h"
#include "qgswcsprojectparser.h"

class QgsServerProjectParser;
class QgsAccessControl;
@@ -42,10 +41,6 @@ class SERVER_EXPORT QgsConfigCache : public QObject
static QgsConfigCache* instance();

QgsServerProjectParser* serverConfiguration( const QString& filePath );
QgsWCSProjectParser* wcsConfiguration(
const QString& filePath
, const QgsAccessControl* accessControl
);
QgsWfsProjectParser* wfsConfiguration(
const QString& filePath
, const QgsAccessControl* accessControl
@@ -70,7 +65,6 @@ class SERVER_EXPORT QgsConfigCache : public QObject
QCache<QString, QDomDocument> mXmlDocumentCache;
QCache<QString, QgsWmsConfigParser> mWMSConfigCache;
QCache<QString, QgsWfsProjectParser> mWFSConfigCache;
QCache<QString, QgsWCSProjectParser> mWCSConfigCache;

private slots:
//! Removes changed entry from this cache

0 comments on commit ac6cf19

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