Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 ac6cf19
Show file tree
Hide file tree
Showing 28 changed files with 933 additions and 739 deletions.
1 change: 0 additions & 1 deletion python/server/qgsconfigcache.sip
Expand Up @@ -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 >() );

Expand Down
81 changes: 80 additions & 1 deletion python/server/qgsserverprojectutils.sip
Expand Up @@ -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.
Expand All @@ -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.
*/
Expand All @@ -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 );
};
68 changes: 0 additions & 68 deletions python/server/qgswcserver.sip

This file was deleted.

39 changes: 0 additions & 39 deletions python/server/qgswcsprojectparser.sip

This file was deleted.

2 changes: 1 addition & 1 deletion python/server/qgswmsprojectparser.sip
@@ -1,5 +1,5 @@
/***************************************************************************
qgswcsprojectparser.sip
qgswmsprojectparser.sip
------------------------
begin : May 2, 2015
copyright : (C) 2015 by Alessandro Pasotti
Expand Down
1 change: 0 additions & 1 deletion python/server/server.sip
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -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...
Expand All @@ -581,7 +581,7 @@ double QgsRasterLayer::rasterUnitsPerPixelX()
return 1;
}

double QgsRasterLayer::rasterUnitsPerPixelY()
double QgsRasterLayer::rasterUnitsPerPixelY() const
{
if ( mDataProvider->capabilities() & QgsRasterDataProvider::Size && mDataProvider->xSize() > 0 )
{
Expand Down
7 changes: 4 additions & 3 deletions src/core/raster/qgsrasterlayer.h
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/server/CMakeLists.txt
Expand Up @@ -34,7 +34,6 @@ SET(qgis_mapserv_SRCS
qgsremotedatasourcebuilder.cpp
qgssentdatasourcebuilder.cpp
qgsserverlogger.cpp
qgswcsprojectparser.cpp
qgswfsprojectparser.cpp
qgswmsconfigparser.cpp
qgswmsprojectparser.cpp
Expand Down
28 changes: 0 additions & 28 deletions src/server/qgsconfigcache.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down
6 changes: 0 additions & 6 deletions src/server/qgsconfigcache.h
Expand Up @@ -28,7 +28,6 @@
#include "qgis_server.h"
#include "qgswmsconfigparser.h"
#include "qgswfsprojectparser.h"
#include "qgswcsprojectparser.h"

class QgsServerProjectParser;
class QgsAccessControl;
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ac6cf19

Please sign in to comment.