Skip to content
Permalink
Browse files

Merge pull request #2977 from rouault/wfs

First part of QEP 35: WFS provider enhancements
  • Loading branch information
jef-n committed Apr 7, 2016
2 parents 5895780 + 9040ec1 commit 19b91032bd2bec826d7978f8a571c7b40dd9498b
Showing with 7,439 additions and 2,163 deletions.
  1. +1 −0 ci/travis/linux/qt5/blacklist.txt
  2. +5 −0 python/core/qgsdataprovider.sip
  3. +5 −0 src/core/qgsdataprovider.h
  4. +4 −0 src/core/qgsfeatureiterator.cpp
  5. +38 −2 src/core/qgsfeatureiterator.h
  6. +469 −203 src/core/qgsgml.cpp
  7. +188 −79 src/core/qgsgml.h
  8. +238 −88 src/core/qgsogcutils.cpp
  9. +110 −8 src/core/qgsogcutils.h
  10. +1 −1 src/core/qgsowsconnection.h
  11. +84 −8 src/core/qgsvectorlayer.cpp
  12. +17 −9 src/core/qgsvectorlayer.h
  13. +7 −2 src/core/qgsvectorlayerfeatureiterator.cpp
  14. +4 −0 src/core/qgsvectorlayerfeatureiterator.h
  15. +24 −3 src/core/qgsvectorlayerrenderer.cpp
  16. +15 −0 src/core/qgsvectorlayerrenderer.h
  17. +76 −10 src/gui/qgsnewhttpconnection.cpp
  18. +12 −1 src/providers/spatialite/qgsspatialiteconnection.h
  19. +5 −3 src/providers/spatialite/qgsspatialiteconnpool.h
  20. +19 −1 src/providers/spatialite/qgsspatialiteprovider.cpp
  21. +2 −0 src/providers/spatialite/qgsspatialiteprovider.h
  22. +16 −0 src/providers/wfs/CMakeLists.txt
  23. +290 −201 src/providers/wfs/qgswfscapabilities.cpp
  24. +30 −48 src/providers/wfs/qgswfscapabilities.h
  25. +62 −0 src/providers/wfs/qgswfsconnection.cpp
  26. +38 −0 src/providers/wfs/qgswfsconnection.h
  27. +45 −0 src/providers/wfs/qgswfsconstants.cpp
  28. +57 −0 src/providers/wfs/qgswfsconstants.h
  29. +19 −25 src/providers/wfs/qgswfsdataitems.cpp
  30. +173 −0 src/providers/wfs/qgswfsdatasourceuri.cpp
  31. +127 −0 src/providers/wfs/qgswfsdatasourceuri.h
  32. +37 −0 src/providers/wfs/qgswfsdescribefeaturetype.cpp
  33. +34 −0 src/providers/wfs/qgswfsdescribefeaturetype.h
  34. +787 −65 src/providers/wfs/qgswfsfeatureiterator.cpp
  35. +177 −19 src/providers/wfs/qgswfsfeatureiterator.h
  36. +264 −1,120 src/providers/wfs/qgswfsprovider.cpp
  37. +57 −155 src/providers/wfs/qgswfsprovider.h
  38. +300 −0 src/providers/wfs/qgswfsrequest.cpp
  39. +110 −0 src/providers/wfs/qgswfsrequest.h
  40. +931 −0 src/providers/wfs/qgswfsshareddata.cpp
  41. +216 −0 src/providers/wfs/qgswfsshareddata.h
  42. +54 −87 src/providers/wfs/qgswfssourceselect.cpp
  43. +1 −1 src/providers/wfs/qgswfssourceselect.h
  44. +41 −0 src/providers/wfs/qgswfstransactionrequest.cpp
  45. +34 −0 src/providers/wfs/qgswfstransactionrequest.h
  46. +292 −0 src/providers/wfs/qgswfsutils.cpp
  47. +71 −0 src/providers/wfs/qgswfsutils.h
  48. +38 −10 src/ui/qgsnewhttpconnectionbase.ui
  49. +1 −1 src/ui/qgswfssourceselectbase.ui
  50. +1 −0 tests/src/core/CMakeLists.txt
  51. +842 −0 tests/src/core/testqgsgml.cpp
  52. +141 −13 tests/src/core/testqgsogcutils.cpp
  53. +1 −0 tests/src/python/CMakeLists.txt
  54. +828 −0 tests/src/python/test_provider_wfs.py
@@ -67,6 +67,7 @@ PyQgsVectorFileWriter
PyQgsVectorLayer
PyQgsVirtualLayerDefinition
PyQgsVirtualLayerProvider
PyQgsWFSProvider
PyQgsZonalStatistics
qgis_alignrastertest
qgis_composereffectstest
@@ -218,6 +218,11 @@ class QgsDataProvider : QObject
*/
virtual QgsError error() const;

/** Invalidate connections corresponding to specified name
* @note added in QGIS 2.16
*/
virtual void invalidateConnections( const QString& connection );

signals:

/**
@@ -306,6 +306,11 @@ class CORE_EXPORT QgsDataProvider : public QObject
*/
virtual QgsError error() const { return mError; }

/** Invalidate connections corresponding to specified name
* @note added in QGIS 2.16
*/
virtual void invalidateConnections( const QString& connection ) { Q_UNUSED( connection ); }

signals:

/**
@@ -224,6 +224,10 @@ bool QgsAbstractFeatureIterator::prepareOrderBy( const QList<QgsFeatureRequest::
return false;
}

void QgsAbstractFeatureIterator::setInterruptionChecker( QgsInterruptionChecker* )
{
}

///////

QgsFeatureIterator& QgsFeatureIterator::operator=( const QgsFeatureIterator & other )
@@ -21,6 +21,19 @@

class QgsAbstractGeometrySimplifier;

/** \ingroup core
* Interface that can be optionaly attached to an iterator so its
* nextFeature() implementaton can check if it must stop as soon as possible.
* @note Added in QGIS 2.16
* @note not available in Python bindings
*/
class CORE_EXPORT QgsInterruptionChecker
{
public:
//! return true if the iterator must stop as soon as possible
virtual bool mustStop() const = 0;
};

/** \ingroup core
* Internal feature iterator to be implemented within data providers
*/
@@ -41,6 +54,16 @@ class CORE_EXPORT QgsAbstractFeatureIterator
//! end of iterating: free the resources / lock
virtual bool close() = 0;

/** Attach an object that can be queried regularly by the iterator to check
* if it must stopped. This is mostly useful for iterators where a single
* nextFeature()/fetchFeature() iteration might be very long. A typical use case is the
* WFS provider. When nextFeature()/fetchFeature() is reasonably fast, it is not necessary
* to implement this method. The default implementation does nothing.
* @note added in QGIS 2.16
* @note not available in Python bindings
*/
virtual void setInterruptionChecker( QgsInterruptionChecker* interruptionChecker );

protected:
/**
* If you write a feature iterator for your provider, this is the method you
@@ -168,8 +191,6 @@ class QgsAbstractFeatureIteratorFromSource : public QgsAbstractFeatureIterator
bool mOwnSource;
};



/**
* \ingroup core
* Wrapper for iterator of features from vector data provider or vector layer
@@ -195,6 +216,15 @@ class CORE_EXPORT QgsFeatureIterator
//! find out whether the iterator is still valid or closed already
bool isClosed() const;

/** Attach an object that can be queried regularly by the iterator to check
* if it must stopped. This is mostly useful for iterators where a single
* nextFeature()/fetchFeature() iteration might be very long. A typical use case is the
* WFS provider.
* @note added in QGIS 2.16
* @note not available in Python bindings
*/
void setInterruptionChecker( QgsInterruptionChecker* interruptionChecker );

friend bool operator== ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 );
friend bool operator!= ( const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2 );

@@ -265,4 +295,10 @@ inline bool operator!= ( const QgsFeatureIterator &fi1, const QgsFeatureIterator
return !( fi1 == fi2 );
}

inline void QgsFeatureIterator::setInterruptionChecker( QgsInterruptionChecker* interruptionChecker )
{
if ( mIter )
mIter->setInterruptionChecker( interruptionChecker );
}

#endif // QGSFEATUREITERATOR_H

0 comments on commit 19b9103

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