Skip to content

Commit

Permalink
Merge pull request qgis#55847 from rouault/wfs_complex_content
Browse files Browse the repository at this point in the history
[WFS provider] Handle documents with Complex Feature schemas (using OGR GMLAS driver), and JSON'ify content of complex properties
  • Loading branch information
rouault committed Feb 20, 2024
2 parents 086d5cf + f017314 commit ca336f7
Show file tree
Hide file tree
Showing 44 changed files with 2,435 additions and 142 deletions.
1 change: 1 addition & 0 deletions python/PyQt6/core/auto_generated/qgsgml.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@




class QgsGml : QObject
{
%Docstring(signature="appended")
Expand Down
4 changes: 3 additions & 1 deletion python/PyQt6/core/auto_generated/qgsogcutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ Creates an ElseFilter from ``doc``
bool honourAxisOrientation,
bool invertAxisOrientation,
QString *errorMessage = 0,
bool requiresFilterElement = false );
bool requiresFilterElement = false,
const QMap<QString, QString> &fieldNameToXPathMap = QMap<QString, QString>(),
const QMap<QString, QString> &namespacePrefixToUriMap = QMap<QString, QString>() );
%Docstring
Creates an OGC expression XML element from the ``exp`` expression.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Returns the current connection url.
WFS_VERSION_API_FEATURES_1_0,
};


virtual bool validate();
%Docstring
Returns ``True`` if dialog settings are valid, or ``False`` if current
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsgml.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@




class QgsGml : QObject
{
%Docstring(signature="appended")
Expand Down
4 changes: 3 additions & 1 deletion python/core/auto_generated/qgsogcutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ Creates an ElseFilter from ``doc``
bool honourAxisOrientation,
bool invertAxisOrientation,
QString *errorMessage = 0,
bool requiresFilterElement = false );
bool requiresFilterElement = false,
const QMap<QString, QString> &fieldNameToXPathMap = QMap<QString, QString>(),
const QMap<QString, QString> &namespacePrefixToUriMap = QMap<QString, QString>() );
%Docstring
Creates an OGC expression XML element from the ``exp`` expression.

Expand Down
1 change: 1 addition & 0 deletions python/gui/auto_generated/qgsnewhttpconnection.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Returns the current connection url.
WFS_VERSION_API_FEATURES_1_0,
};


virtual bool validate();
%Docstring
Returns ``True`` if dialog settings are valid, or ``False`` if current
Expand Down
14 changes: 14 additions & 0 deletions src/app/options/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,20 @@ void QgsOptions::browseCacheDirectory()
void QgsOptions::clearCache()
{
QgsNetworkAccessManager::instance()->cache()->clear();

// Clear WFS XSD cache used by OGR GMLAS driver
QString cacheDirectory = mSettings->value( QStringLiteral( "cache/directory" ) ).toString();
if ( cacheDirectory.isEmpty() )
cacheDirectory = QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
if ( !cacheDirectory.endsWith( QDir::separator() ) )
{
cacheDirectory.push_back( QDir::separator() );
}
// Must be kept in sync with QgsWFSProvider::readAttributesFromSchemaWithGMLAS()
cacheDirectory += QLatin1String( "gmlas_xsd_cache" );
QDir dir( cacheDirectory );
dir.removeRecursively();

QMessageBox::information( this, tr( "Clear Cache" ), tr( "Content cache has been cleared." ) );
}

Expand Down
7 changes: 7 additions & 0 deletions src/core/qgscplhttpfetchoverrider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ CPLHTTPResult *QgsCPLHTTPFetchOverrider::callback( const char *pszURL,
}
}

if ( pThis->mFeedback && pThis->mFeedback->isCanceled() )
{
psResult->nStatus = 1;
psResult->pszErrBuf = CPLStrdup( "download interrupted by user" );
return psResult;
}

QgsBlockingNetworkRequest blockingRequest;
blockingRequest.setAuthCfg( pThis->mAuthCfg );

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscplhttpfetchoverrider.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class QgsFeedback;
* \note not available in Python bindings
* \since QGIS 3.18
*/
class QgsCPLHTTPFetchOverrider
class CORE_EXPORT QgsCPLHTTPFetchOverrider
{
public:
//! Installs the redirection for the current thread
Expand Down
Loading

0 comments on commit ca336f7

Please sign in to comment.