mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
Processing: Add Check Geometry algorithm and test: Self intersection
This commit is contained in:
parent
de98779ebb
commit
13b5b37c27
@ -69,6 +69,7 @@ set(QGIS_ANALYSIS_SRCS
|
|||||||
processing/qgsalgorithmfixgeometrymissingvertex.cpp
|
processing/qgsalgorithmfixgeometrymissingvertex.cpp
|
||||||
processing/qgsalgorithmcheckgeometryarea.cpp
|
processing/qgsalgorithmcheckgeometryarea.cpp
|
||||||
processing/qgsalgorithmfixgeometryarea.cpp
|
processing/qgsalgorithmfixgeometryarea.cpp
|
||||||
|
processing/qgsalgorithmcheckgeometryselfintersection.cpp
|
||||||
processing/qgsalgorithmclip.cpp
|
processing/qgsalgorithmclip.cpp
|
||||||
processing/qgsalgorithmconcavehull.cpp
|
processing/qgsalgorithmconcavehull.cpp
|
||||||
processing/qgsalgorithmconditionalbranch.cpp
|
processing/qgsalgorithmconditionalbranch.cpp
|
||||||
|
|||||||
@ -0,0 +1,237 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qgsalgorithmcheckgeometryselfintersection.cpp
|
||||||
|
---------------------
|
||||||
|
begin : April 2025
|
||||||
|
copyright : (C) 2025 by Jacky Volpes
|
||||||
|
email : jacky dot volpes at oslandia dot com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "qgsalgorithmcheckgeometryselfintersection.h"
|
||||||
|
#include "qgsgeometrycheckcontext.h"
|
||||||
|
#include "qgsgeometrycheckerror.h"
|
||||||
|
#include "qgsgeometryselfintersectioncheck.h"
|
||||||
|
#include "qgspoint.h"
|
||||||
|
#include "qgsvectorlayer.h"
|
||||||
|
#include "qgsvectordataproviderfeaturepool.h"
|
||||||
|
|
||||||
|
///@cond PRIVATE
|
||||||
|
|
||||||
|
QString QgsGeometryCheckSelfIntersectionAlgorithm::name() const
|
||||||
|
{
|
||||||
|
return QStringLiteral( "checkgeometryselfintersection" );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QgsGeometryCheckSelfIntersectionAlgorithm::displayName() const
|
||||||
|
{
|
||||||
|
return QObject::tr( "Check Geometry (Self intersection)" );
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QgsGeometryCheckSelfIntersectionAlgorithm::tags() const
|
||||||
|
{
|
||||||
|
return QObject::tr( "check,geometry,intersection" ).split( ',' );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QgsGeometryCheckSelfIntersectionAlgorithm::group() const
|
||||||
|
{
|
||||||
|
return QObject::tr( "Check geometry" );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QgsGeometryCheckSelfIntersectionAlgorithm::groupId() const
|
||||||
|
{
|
||||||
|
return QStringLiteral( "checkgeometry" );
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QgsGeometryCheckSelfIntersectionAlgorithm::shortHelpString() const
|
||||||
|
{
|
||||||
|
return QObject::tr( "This algorithm checks self-intersecting geometries.\n"
|
||||||
|
"Self-intersecting geometries are errors." );
|
||||||
|
}
|
||||||
|
|
||||||
|
Qgis::ProcessingAlgorithmFlags QgsGeometryCheckSelfIntersectionAlgorithm::flags() const
|
||||||
|
{
|
||||||
|
return QgsProcessingAlgorithm::flags() | Qgis::ProcessingAlgorithmFlag::NoThreading;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsGeometryCheckSelfIntersectionAlgorithm *QgsGeometryCheckSelfIntersectionAlgorithm::createInstance() const
|
||||||
|
{
|
||||||
|
return new QgsGeometryCheckSelfIntersectionAlgorithm();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QgsGeometryCheckSelfIntersectionAlgorithm::initAlgorithm( const QVariantMap &configuration )
|
||||||
|
{
|
||||||
|
Q_UNUSED( configuration )
|
||||||
|
|
||||||
|
addParameter( new QgsProcessingParameterFeatureSource(
|
||||||
|
QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ),
|
||||||
|
QList<int>()
|
||||||
|
<< static_cast<int>( Qgis::ProcessingSourceType::VectorPolygon )
|
||||||
|
<< static_cast<int>( Qgis::ProcessingSourceType::VectorLine )
|
||||||
|
) );
|
||||||
|
addParameter( new QgsProcessingParameterField(
|
||||||
|
QStringLiteral( "UNIQUE_ID" ), QObject::tr( "Unique feature identifier" ), QString(), QStringLiteral( "INPUT" )
|
||||||
|
) );
|
||||||
|
addParameter( new QgsProcessingParameterFeatureSink(
|
||||||
|
QStringLiteral( "ERRORS" ), QObject::tr( "Errors layer" ), Qgis::ProcessingSourceType::VectorPoint
|
||||||
|
) );
|
||||||
|
addParameter( new QgsProcessingParameterFeatureSink(
|
||||||
|
QStringLiteral( "OUTPUT" ), QObject::tr( "Output layer" ), Qgis::ProcessingSourceType::VectorAnyGeometry
|
||||||
|
) );
|
||||||
|
|
||||||
|
std::unique_ptr<QgsProcessingParameterNumber> tolerance = std::make_unique<QgsProcessingParameterNumber>(
|
||||||
|
QStringLiteral( "TOLERANCE" ), QObject::tr( "Tolerance" ), Qgis::ProcessingNumberParameterType::Integer, 8, false, 1, 13
|
||||||
|
);
|
||||||
|
tolerance->setFlags( tolerance->flags() | Qgis::ProcessingParameterFlag::Advanced );
|
||||||
|
addParameter( tolerance.release() );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QgsGeometryCheckSelfIntersectionAlgorithm::prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback * )
|
||||||
|
{
|
||||||
|
mTolerance = parameterAsInt( parameters, QStringLiteral( "TOLERANCE" ), context );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsFields QgsGeometryCheckSelfIntersectionAlgorithm::outputFields()
|
||||||
|
{
|
||||||
|
QgsFields fields;
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_layerid" ), QMetaType::QString ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_layername" ), QMetaType::QString ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_partidx" ), QMetaType::Int ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_ringidx" ), QMetaType::Int ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_vertidx" ), QMetaType::Int ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_errorx" ), QMetaType::Double ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_errory" ), QMetaType::Double ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_error" ), QMetaType::QString ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_segment_1" ), QMetaType::Int ) );
|
||||||
|
fields.append( QgsField( QStringLiteral( "gc_segment_2" ), QMetaType::Int ) );
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVariantMap QgsGeometryCheckSelfIntersectionAlgorithm::processAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
|
||||||
|
{
|
||||||
|
QString dest_output;
|
||||||
|
QString dest_errors;
|
||||||
|
const std::unique_ptr<QgsProcessingFeatureSource> input( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
|
||||||
|
if ( !input )
|
||||||
|
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );
|
||||||
|
|
||||||
|
const QString uniqueIdFieldName( parameterAsString( parameters, QStringLiteral( "UNIQUE_ID" ), context ) );
|
||||||
|
const int uniqueIdFieldIdx = input->fields().indexFromName( uniqueIdFieldName );
|
||||||
|
if ( uniqueIdFieldIdx == -1 )
|
||||||
|
throw QgsProcessingException( QObject::tr( "Missing field %1 in input layer" ).arg( uniqueIdFieldName ) );
|
||||||
|
|
||||||
|
const QgsField uniqueIdField = input->fields().at( uniqueIdFieldIdx );
|
||||||
|
|
||||||
|
QgsFields fields = outputFields();
|
||||||
|
fields.append( uniqueIdField );
|
||||||
|
|
||||||
|
const std::unique_ptr<QgsFeatureSink> sink_output( parameterAsSink(
|
||||||
|
parameters, QStringLiteral( "OUTPUT" ), context, dest_output, fields, input->wkbType(), input->sourceCrs()
|
||||||
|
) );
|
||||||
|
if ( !sink_output )
|
||||||
|
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) );
|
||||||
|
|
||||||
|
const std::unique_ptr<QgsFeatureSink> sink_errors( parameterAsSink(
|
||||||
|
parameters, QStringLiteral( "ERRORS" ), context, dest_errors, fields, Qgis::WkbType::Point, input->sourceCrs()
|
||||||
|
) );
|
||||||
|
if ( !sink_errors )
|
||||||
|
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "ERRORS" ) ) );
|
||||||
|
|
||||||
|
QgsProcessingMultiStepFeedback multiStepFeedback( 3, feedback );
|
||||||
|
|
||||||
|
const QgsProject *project = QgsProject::instance();
|
||||||
|
|
||||||
|
QgsGeometryCheckContext checkContext = QgsGeometryCheckContext( mTolerance, input->sourceCrs(), project->transformContext(), project );
|
||||||
|
|
||||||
|
// Test detection
|
||||||
|
QList<QgsGeometryCheckError *> checkErrors;
|
||||||
|
QStringList messages;
|
||||||
|
|
||||||
|
const QgsGeometrySelfIntersectionCheck check( &checkContext, QVariantMap() );
|
||||||
|
|
||||||
|
multiStepFeedback.setCurrentStep( 1 );
|
||||||
|
feedback->setProgressText( QObject::tr( "Preparing features…" ) );
|
||||||
|
QMap<QString, QgsFeaturePool *> featurePools;
|
||||||
|
|
||||||
|
std::unique_ptr<QgsVectorLayer> inputLayer( input->materialize( QgsFeatureRequest() ) );
|
||||||
|
QgsVectorDataProviderFeaturePool featurePool = QgsVectorDataProviderFeaturePool( inputLayer.get() );
|
||||||
|
featurePools.insert( inputLayer->id(), &featurePool );
|
||||||
|
|
||||||
|
multiStepFeedback.setCurrentStep( 2 );
|
||||||
|
feedback->setProgressText( QObject::tr( "Collecting errors…" ) );
|
||||||
|
check.collectErrors( featurePools, checkErrors, messages, feedback );
|
||||||
|
|
||||||
|
multiStepFeedback.setCurrentStep( 3 );
|
||||||
|
feedback->setProgressText( QObject::tr( "Exporting errors…" ) );
|
||||||
|
const double step { checkErrors.size() > 0 ? 100.0 / checkErrors.size() : 1 };
|
||||||
|
long i = 0;
|
||||||
|
feedback->setProgress( 0.0 );
|
||||||
|
|
||||||
|
for ( QgsGeometryCheckError *error : checkErrors )
|
||||||
|
{
|
||||||
|
const QgsGeometryCheckErrorSingle *singleError = dynamic_cast<const QgsGeometryCheckErrorSingle *>( error );
|
||||||
|
if ( !singleError )
|
||||||
|
break;
|
||||||
|
|
||||||
|
const QgsGeometrySelfIntersectionCheckError *selfIntersectionError = dynamic_cast<const QgsGeometrySelfIntersectionCheckError *>( singleError->singleError() );
|
||||||
|
if ( !selfIntersectionError )
|
||||||
|
break;
|
||||||
|
|
||||||
|
const QgsGeometryUtils::SelfIntersection &intersection = selfIntersectionError->intersection();
|
||||||
|
|
||||||
|
if ( feedback->isCanceled() )
|
||||||
|
break;
|
||||||
|
|
||||||
|
QgsFeature f;
|
||||||
|
QgsAttributes attrs = f.attributes();
|
||||||
|
|
||||||
|
attrs << error->layerId()
|
||||||
|
<< inputLayer->name()
|
||||||
|
<< error->vidx().part
|
||||||
|
<< error->vidx().ring
|
||||||
|
<< error->vidx().vertex
|
||||||
|
<< error->location().x()
|
||||||
|
<< error->location().y()
|
||||||
|
<< error->value().toString()
|
||||||
|
<< intersection.segment1
|
||||||
|
<< intersection.segment2
|
||||||
|
<< inputLayer->getFeature( error->featureId() ).attribute( uniqueIdField.name() );
|
||||||
|
f.setAttributes( attrs );
|
||||||
|
|
||||||
|
f.setGeometry( error->geometry() );
|
||||||
|
if ( !sink_output->addFeature( f, QgsFeatureSink::FastInsert ) )
|
||||||
|
throw QgsProcessingException( writeFeatureError( sink_output.get(), parameters, QStringLiteral( "OUTPUT" ) ) );
|
||||||
|
|
||||||
|
f.setGeometry( QgsGeometry::fromPoint( QgsPoint( error->location().x(), error->location().y() ) ) );
|
||||||
|
if ( !sink_errors->addFeature( f, QgsFeatureSink::FastInsert ) )
|
||||||
|
throw QgsProcessingException( writeFeatureError( sink_errors.get(), parameters, QStringLiteral( "ERRORS" ) ) );
|
||||||
|
|
||||||
|
i++;
|
||||||
|
feedback->setProgress( 100.0 * step * static_cast<double>( i ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Place the point layer above the other layer
|
||||||
|
if ( context.willLoadLayerOnCompletion( dest_output ) && context.willLoadLayerOnCompletion( dest_errors ) )
|
||||||
|
{
|
||||||
|
context.layerToLoadOnCompletionDetails( dest_errors ).layerSortKey = 0;
|
||||||
|
context.layerToLoadOnCompletionDetails( dest_output ).layerSortKey = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap outputs;
|
||||||
|
outputs.insert( QStringLiteral( "OUTPUT" ), dest_output );
|
||||||
|
outputs.insert( QStringLiteral( "ERRORS" ), dest_errors );
|
||||||
|
|
||||||
|
return outputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
///@endcond
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qgsalgorithmcheckgeometryselfintersection.h
|
||||||
|
---------------------
|
||||||
|
begin : April 2025
|
||||||
|
copyright : (C) 2025 by Jacky Volpes
|
||||||
|
email : jacky dot volpes at oslandia dot com
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QGSALGORITHMCHECKGEOMETRYSELFINTERSECTION_H
|
||||||
|
#define QGSALGORITHMCHECKGEOMETRYSELFINTERSECTION_H
|
||||||
|
|
||||||
|
#define SIP_NO_FILE
|
||||||
|
|
||||||
|
#include "qgis_sip.h"
|
||||||
|
#include "qgsprocessingalgorithm.h"
|
||||||
|
|
||||||
|
///@cond PRIVATE
|
||||||
|
|
||||||
|
class QgsGeometryCheckSelfIntersectionAlgorithm : public QgsProcessingAlgorithm
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QgsGeometryCheckSelfIntersectionAlgorithm() = default;
|
||||||
|
void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
|
||||||
|
QString name() const override;
|
||||||
|
QString displayName() const override;
|
||||||
|
QStringList tags() const override;
|
||||||
|
QString group() const override;
|
||||||
|
QString groupId() const override;
|
||||||
|
QString shortHelpString() const override;
|
||||||
|
Qgis::ProcessingAlgorithmFlags flags() const override;
|
||||||
|
QgsGeometryCheckSelfIntersectionAlgorithm *createInstance() const override SIP_FACTORY;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||||
|
QVariantMap processAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static QgsFields outputFields();
|
||||||
|
int mTolerance { 8 };
|
||||||
|
};
|
||||||
|
|
||||||
|
///@endcond PRIVATE
|
||||||
|
|
||||||
|
#endif // QGSALGORITHMCHECKGEOMETRYSELFINTERSECTION_H
|
||||||
@ -50,6 +50,7 @@
|
|||||||
#include "qgsalgorithmfixgeometrymissingvertex.h"
|
#include "qgsalgorithmfixgeometrymissingvertex.h"
|
||||||
#include "qgsalgorithmcheckgeometryhole.h"
|
#include "qgsalgorithmcheckgeometryhole.h"
|
||||||
#include "qgsalgorithmcheckgeometrymissingvertex.h"
|
#include "qgsalgorithmcheckgeometrymissingvertex.h"
|
||||||
|
#include "qgsalgorithmcheckgeometryselfintersection.h"
|
||||||
#include "qgsalgorithmclip.h"
|
#include "qgsalgorithmclip.h"
|
||||||
#include "qgsalgorithmconcavehull.h"
|
#include "qgsalgorithmconcavehull.h"
|
||||||
#include "qgsalgorithmconditionalbranch.h"
|
#include "qgsalgorithmconditionalbranch.h"
|
||||||
@ -338,6 +339,7 @@ void QgsNativeAlgorithms::loadAlgorithms()
|
|||||||
addAlgorithm( new QgsGeometryCheckAreaAlgorithm() );
|
addAlgorithm( new QgsGeometryCheckAreaAlgorithm() );
|
||||||
addAlgorithm( new QgsGeometryCheckHoleAlgorithm() );
|
addAlgorithm( new QgsGeometryCheckHoleAlgorithm() );
|
||||||
addAlgorithm( new QgsGeometryCheckMissingVertexAlgorithm() );
|
addAlgorithm( new QgsGeometryCheckMissingVertexAlgorithm() );
|
||||||
|
addAlgorithm( new QgsGeometryCheckSelfIntersectionAlgorithm() );
|
||||||
addAlgorithm( new QgsClipAlgorithm() );
|
addAlgorithm( new QgsClipAlgorithm() );
|
||||||
addAlgorithm( new QgsCollectAlgorithm() );
|
addAlgorithm( new QgsCollectAlgorithm() );
|
||||||
addAlgorithm( new QgsCombineStylesAlgorithm() );
|
addAlgorithm( new QgsCombineStylesAlgorithm() );
|
||||||
|
|||||||
@ -37,6 +37,9 @@ class TestQgsProcessingCheckGeometry : public QgsTest
|
|||||||
void angleAlg_data();
|
void angleAlg_data();
|
||||||
void angleAlg();
|
void angleAlg();
|
||||||
|
|
||||||
|
void selfIntersectionAlg_data();
|
||||||
|
void selfIntersectionAlg();
|
||||||
|
|
||||||
void areaAlg();
|
void areaAlg();
|
||||||
void holeAlg();
|
void holeAlg();
|
||||||
void missingVertexAlg();
|
void missingVertexAlg();
|
||||||
@ -219,5 +222,44 @@ void TestQgsProcessingCheckGeometry::missingVertexAlg()
|
|||||||
QCOMPARE( errorsLayer->featureCount(), 5 );
|
QCOMPARE( errorsLayer->featureCount(), 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestQgsProcessingCheckGeometry::selfIntersectionAlg_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QgsVectorLayer *>( "layerToTest" );
|
||||||
|
QTest::addColumn<int>( "expectedErrorCount" );
|
||||||
|
QTest::newRow( "Line layer" ) << mLineLayer << 3;
|
||||||
|
QTest::newRow( "Polygon layer" ) << mPolygonLayer << 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestQgsProcessingCheckGeometry::selfIntersectionAlg()
|
||||||
|
{
|
||||||
|
QFETCH( QgsVectorLayer *, layerToTest );
|
||||||
|
QFETCH( int, expectedErrorCount );
|
||||||
|
std::unique_ptr< QgsProcessingAlgorithm > alg(
|
||||||
|
QgsApplication::processingRegistry()->createAlgorithmById( QStringLiteral( "native:checkgeometryselfintersection" ) )
|
||||||
|
);
|
||||||
|
QVERIFY( alg != nullptr );
|
||||||
|
|
||||||
|
QVariantMap parameters;
|
||||||
|
parameters.insert( QStringLiteral( "INPUT" ), QVariant::fromValue( layerToTest ) );
|
||||||
|
parameters.insert( QStringLiteral( "UNIQUE_ID" ), "id" );
|
||||||
|
parameters.insert( QStringLiteral( "OUTPUT" ), QgsProcessing::TEMPORARY_OUTPUT );
|
||||||
|
parameters.insert( QStringLiteral( "ERRORS" ), QgsProcessing::TEMPORARY_OUTPUT );
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
QgsProcessingFeedback feedback;
|
||||||
|
std::unique_ptr< QgsProcessingContext > context = std::make_unique< QgsProcessingContext >();
|
||||||
|
|
||||||
|
QVariantMap results;
|
||||||
|
results = alg->run( parameters, *context, &feedback, &ok );
|
||||||
|
QVERIFY( ok );
|
||||||
|
|
||||||
|
std::unique_ptr<QgsVectorLayer> outputLayer( qobject_cast< QgsVectorLayer * >( context->getMapLayer( results.value( QStringLiteral( "OUTPUT" ) ).toString() ) ) );
|
||||||
|
std::unique_ptr<QgsVectorLayer> errorsLayer( qobject_cast< QgsVectorLayer * >( context->getMapLayer( results.value( QStringLiteral( "ERRORS" ) ).toString() ) ) );
|
||||||
|
QVERIFY( outputLayer->isValid() );
|
||||||
|
QVERIFY( errorsLayer->isValid() );
|
||||||
|
QCOMPARE( outputLayer->featureCount(), expectedErrorCount );
|
||||||
|
QCOMPARE( errorsLayer->featureCount(), expectedErrorCount );
|
||||||
|
}
|
||||||
|
|
||||||
QGSTEST_MAIN( TestQgsProcessingCheckGeometry )
|
QGSTEST_MAIN( TestQgsProcessingCheckGeometry )
|
||||||
#include "testqgsprocessingcheckgeometry.moc"
|
#include "testqgsprocessingcheckgeometry.moc"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user