mirror of
https://github.com/qgis/QGIS.git
synced 2025-07-03 00:03:10 -04:00
Compare commits
2 Commits
15adad4d88
...
5f2679c7d0
Author | SHA1 | Date | |
---|---|---|---|
|
5f2679c7d0 | ||
|
a933ae8152 |
@ -572,8 +572,21 @@ void QgsBackgroundCachedFeatureIterator::featureReceivedSynchronous( const QVect
|
||||
mWriterStream.reset( new QDataStream( &mWriterByteArray, QIODevice::WriteOnly ) );
|
||||
}
|
||||
const auto constList = list;
|
||||
const Qgis::WkbType expectedType { mShared->mWKBType };
|
||||
bool errorRaised = false;
|
||||
for ( const QgsFeatureUniqueIdPair &pair : constList )
|
||||
{
|
||||
if ( !errorRaised && expectedType != pair.first.geometry().wkbType() )
|
||||
{
|
||||
if ( QgsWkbTypes::hasZ( pair.first.geometry().wkbType() ) && !QgsWkbTypes::hasZ( expectedType ) )
|
||||
{
|
||||
mShared->pushError( QStringLiteral( "Received feature geometry has Z values but the layer type (%1) does not. Please check the WFS connection setting 'Force initial GetFeature'." ).arg( QgsWkbTypes::displayString( expectedType ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
mShared->pushError( QStringLiteral( "Received feature with geometry type %1, expected %2" ).arg( QgsWkbTypes::displayString( pair.first.geometry().wkbType() ), QgsWkbTypes::displayString( expectedType ) ) );
|
||||
}
|
||||
}
|
||||
*mWriterStream << pair.first;
|
||||
}
|
||||
if ( !mWriterFile && mWriterByteArray.size() > mWriteTransferThreshold )
|
||||
|
@ -188,6 +188,9 @@ class QgsBackgroundCachedSharedData
|
||||
//! Called when an error must be raised to the provider
|
||||
virtual void pushError( const QString &errorMsg ) const = 0;
|
||||
|
||||
//! Geometry type of the features in this layer (used by WFS only)
|
||||
Qgis::WkbType mWKBType = Qgis::WkbType::Unknown;
|
||||
|
||||
protected:
|
||||
//////////// Input members. Implementations should define them to meaningful values
|
||||
|
||||
|
@ -245,7 +245,7 @@ QList<QgsProviderSublayerDetails> QgsWfsProviderMetadata::querySublayers( const
|
||||
details.setWkbType( provider.wkbType() );
|
||||
res << details;
|
||||
|
||||
// Always issue a GetFeature because the guessed type can't be trusted,
|
||||
// If set: always issue a GetFeature because the guessed type can't be trusted,
|
||||
// for example when dealing with Z geometries identified as 2D.
|
||||
const bool forceInitialGetFeature = dsUri.hasParam( QgsWFSConstants::URI_PARAM_FORCE_INITIAL_GET_FEATURE )
|
||||
&& dsUri.param( QgsWFSConstants::URI_PARAM_FORCE_INITIAL_GET_FEATURE ).toUpper() == QStringLiteral( "TRUE" );
|
||||
|
@ -141,9 +141,6 @@ class QgsWFSSharedData : public QObject, public QgsBackgroundCachedSharedData
|
||||
*/
|
||||
bool mServerPrefersCoordinatesForTransactions_1_1 = false;
|
||||
|
||||
//! Geometry type of the features in this layer
|
||||
Qgis::WkbType mWKBType = Qgis::WkbType::Unknown;
|
||||
|
||||
//! Geometry type filter to ensure geometries returned by the layer are of type mWKBType.
|
||||
QString mWFSGeometryTypeFilter;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user