Skip to content

Commit 91cebc4

Browse files
DelazJnyalldawson
authored andcommitted
[Processing][needs-docs] Improve some vector overlay algorithms description
* Some algorithms used almost the same label for the second layer and the output one (eg, "difference layer" vs "difference"), making hard to understand the description, in English and once translated. Overlay label is now used to name the second layer, matching the parameter identifier * Add more details to description and try to harmonize as far as possible (more convenient for readers and translators) * The union algorithm behavior changed deeply but its description got no updates
1 parent e0fa9eb commit 91cebc4

5 files changed

+31
-15
lines changed

src/analysis/processing/qgsalgorithmclip.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,19 @@ QString QgsClipAlgorithm::groupId() const
4949
void QgsClipAlgorithm::initAlgorithm( const QVariantMap & )
5050
{
5151
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
52-
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Clip layer" ), QList< int >() << QgsProcessing::TypeVectorPolygon ) );
52+
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ), QList< int >() << QgsProcessing::TypeVectorPolygon ) );
5353

5454
addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Clipped" ) ) );
5555
}
5656

5757
QString QgsClipAlgorithm::shortHelpString() const
5858
{
59-
return QObject::tr( "This algorithm clips a vector layer using the polygons of an additional polygons layer. Only the parts of the features "
60-
"in the input layer that falls within the polygons of the clipping layer will be added to the resulting layer.\n\n"
61-
"The attributes of the features are not modified, although properties such as area or length of the features will "
62-
"be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to "
63-
"be manually updated." );
59+
return QObject::tr( "This algorithm clips a vector layer using the features of an additional polygon layer. Only the parts of the features "
60+
"in the Input layer that fall within the polygons of the Overlay layer will be added to the resulting layer." )
61+
+ QStringLiteral( "\n\n" )
62+
+ QObject::tr( "The attributes of the features are not modified, although properties such as area or length of the features will "
63+
"be modified by the clipping operation. If such properties are stored as attributes, those attributes will have to "
64+
"be manually updated." );
6465
}
6566

6667
QgsClipAlgorithm *QgsClipAlgorithm::createInstance() const

src/analysis/processing/qgsalgorithmdifference.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ QString QgsDifferenceAlgorithm::groupId() const
4242

4343
QString QgsDifferenceAlgorithm::shortHelpString() const
4444
{
45-
return QObject::tr( "This algorithm extracts features from the Input layer that fall outside, or partially overlap, features in the Difference layer. Input layer features that partially overlap the difference layer feature(s) are split along the boundary of the difference layer feature(s) and only the portions outside the difference layer features are retained." )
45+
return QObject::tr( "This algorithm extracts features from the Input layer that fall outside, or partially overlap, features in the Overlay layer. "
46+
"Input layer features that partially overlap feature(s) in the Overlay layer are split along those features' boundary "
47+
"and only the portions outside the Overlay layer features are retained." )
4648
+ QStringLiteral( "\n\n" )
47-
+ QObject::tr( "Attributes are not modified." );
49+
+ QObject::tr( "Attributes are not modified, although properties such as area or length of the features will "
50+
"be modified by the difference operation. If such properties are stored as attributes, those attributes will have to "
51+
"be manually updated." );
4852
}
4953

5054
QgsProcessingAlgorithm *QgsDifferenceAlgorithm::createInstance() const
@@ -55,7 +59,7 @@ QgsProcessingAlgorithm *QgsDifferenceAlgorithm::createInstance() const
5559
void QgsDifferenceAlgorithm::initAlgorithm( const QVariantMap & )
5660
{
5761
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
58-
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Difference layer" ) ) );
62+
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ) ) );
5963
addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Difference" ) ) );
6064
}
6165

src/analysis/processing/qgsalgorithmintersection.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ QString QgsIntersectionAlgorithm::groupId() const
4444

4545
QString QgsIntersectionAlgorithm::shortHelpString() const
4646
{
47-
return QObject::tr( "This algorithm extracts the overlapping portions of features in the Input and Overlay layers. Features in the Overlay layer are assigned the attributes of the overlapping features from both the Input and Overlay layers." );
47+
return QObject::tr( "This algorithm extracts the overlapping portions of features in the Input and Overlay layers. "
48+
"Features in the output Intersection layer are assigned the attributes of the overlapping features "
49+
"from both the Input and Overlay layers." );
4850
}
4951

5052
QgsProcessingAlgorithm *QgsIntersectionAlgorithm::createInstance() const
@@ -55,7 +57,7 @@ QgsProcessingAlgorithm *QgsIntersectionAlgorithm::createInstance() const
5557
void QgsIntersectionAlgorithm::initAlgorithm( const QVariantMap & )
5658
{
5759
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
58-
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Intersection layer" ) ) );
60+
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ) ) );
5961

6062
addParameter( new QgsProcessingParameterField(
6163
QStringLiteral( "INPUT_FIELDS" ),

src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ QString QgsSymmetricalDifferenceAlgorithm::groupId() const
4141

4242
QString QgsSymmetricalDifferenceAlgorithm::shortHelpString() const
4343
{
44-
return QObject::tr( "This algorithm creates a layer containing features from both the Input and Difference layers but with the overlapping areas between the two layers removed. The attribute table of the Symmetrical Difference layer contains attributes from both the Input and Difference layers." );
44+
return QObject::tr( "This algorithm extracts the portions of features from both the Input and Overlay layers that do not overlap. "
45+
"Overlapping areas between the two layers are removed. The attribute table of the Symmetrical Difference layer "
46+
"contains original attributes from both the Input and Difference layers." );
4547
}
4648

4749
QgsProcessingAlgorithm *QgsSymmetricalDifferenceAlgorithm::createInstance() const
@@ -52,7 +54,7 @@ QgsProcessingAlgorithm *QgsSymmetricalDifferenceAlgorithm::createInstance() cons
5254
void QgsSymmetricalDifferenceAlgorithm::initAlgorithm( const QVariantMap & )
5355
{
5456
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
55-
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Difference layer" ) ) );
57+
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ) ) );
5658
addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Symmetrical difference" ) ) );
5759
}
5860

src/analysis/processing/qgsalgorithmunion.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ QString QgsUnionAlgorithm::groupId() const
4242

4343
QString QgsUnionAlgorithm::shortHelpString() const
4444
{
45-
return QObject::tr( "This algorithm creates a layer containing all the features from both input layers. In the case of polygon layers, separate features are created for overlapping and non-overlapping features. The attribute table of the union layer contains attribute values from the respective input layer for non-overlapping features, and attribute values from both input layers for overlapping features." );
45+
return QObject::tr( "This algorithm checks overlaps between features within the Input layer and creates separate features for overlapping "
46+
"and non-overlapping parts. The area of overlap will create as many identical overlapping features as there are "
47+
"features that participate in that overlap." )
48+
+ QStringLiteral( "\n\n" )
49+
+ QObject::tr( "An Overlay layer can also be used, in which case features from each layer are split at their overlap with features from "
50+
"the other one, creating a layer containing all the portions from both Input and Overlay layers. "
51+
"The attribute table of the Union layer is filled with attribute values from the respective original layer "
52+
"for non-overlapping features, and attribute values from both layers for overlapping features." );
4653
}
4754

4855
QgsProcessingAlgorithm *QgsUnionAlgorithm::createInstance() const
@@ -53,7 +60,7 @@ QgsProcessingAlgorithm *QgsUnionAlgorithm::createInstance() const
5360
void QgsUnionAlgorithm::initAlgorithm( const QVariantMap & )
5461
{
5562
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
56-
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Union layer" ), QList< int >(), QVariant(), true ) );
63+
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "OVERLAY" ), QObject::tr( "Overlay layer" ), QList< int >(), QVariant(), true ) );
5764

5865
addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Union" ) ) );
5966
}

0 commit comments

Comments
 (0)