Skip to content

Commit a40f0bc

Browse files
committedNov 29, 2018
[processing] Use MultiPolygon as output wkb type for multi ring buffer (constant)
1 parent 49489db commit a40f0bc

File tree

4 files changed

+30
-29
lines changed

4 files changed

+30
-29
lines changed
 

‎python/plugins/processing/tests/testdata/expected/multiring_buffer.gml

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

‎python/plugins/processing/tests/testdata/expected/multiring_buffer.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<xs:complexContent>
1616
<xs:extension base="gml:AbstractFeatureType">
1717
<xs:sequence>
18-
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
18+
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
1919
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
2020
<xs:simpleType>
2121
<xs:restriction base="xs:integer">

‎src/analysis/processing/qgsalgorithmmultiringconstantbuffer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ QgsFeatureList QgsMultiRingConstantBufferAlgorithm::processFeature( const QgsFea
138138
QgsFeature out;
139139
currentDistance = i * distance;
140140
outputGeometry = feature.geometry().buffer( currentDistance, 40 );
141+
outputGeometry.convertToMultiType();
141142
if ( outputGeometry.isNull() )
142143
{
143144
feedback->reportError( QObject::tr( "Error calculating buffer for feature %1" ).arg( feature.id() ) );

‎src/analysis/processing/qgsalgorithmmultiringconstantbuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class QgsMultiRingConstantBufferAlgorithm : public QgsProcessingFeatureBasedAlgo
5050
QgsFields outputFields( const QgsFields &inputFields ) const override;
5151
QgsProcessing::SourceType outputLayerType() const override { return QgsProcessing::TypeVectorPolygon; }
5252
QgsProcessingFeatureSource::Flag sourceFlags() const override;
53-
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override { Q_UNUSED( inputWkbType ); return QgsWkbTypes::Polygon; }
53+
QgsWkbTypes::Type outputWkbType( QgsWkbTypes::Type inputWkbType ) const override { Q_UNUSED( inputWkbType ); return QgsWkbTypes::MultiPolygon; }
5454
bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
5555
QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
5656

0 commit comments

Comments
 (0)
Please sign in to comment.