From b0cac0bd04454c5cd262a9d727b1de020ba444b2 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Aug 2017 17:12:53 +1000 Subject: [PATCH 1/5] Remove debugging code --- python/plugins/processing/gui/wrappers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/plugins/processing/gui/wrappers.py b/python/plugins/processing/gui/wrappers.py index 7635ecc300d..f6434d43f35 100644 --- a/python/plugins/processing/gui/wrappers.py +++ b/python/plugins/processing/gui/wrappers.py @@ -1357,7 +1357,6 @@ class WidgetWrapperFactory: @staticmethod def create_wrapper_from_class(param, dialog, row=0, col=0): - print("PARAM", param, param.name(), param.type()) wrapper = None if param.type() == 'boolean': wrapper = BooleanWidgetWrapper From 952b4942568d996d38c2ace015134c9cd52f1884 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Aug 2017 17:23:23 +1000 Subject: [PATCH 2/5] Show Python identifier for processing parameters in tooltip over widgets Hopefully helps Python processing users match the parameters in the gui to the parameter names to use when calling via API (Blender style!) --- python/plugins/processing/gui/ParametersPanel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/plugins/processing/gui/ParametersPanel.py b/python/plugins/processing/gui/ParametersPanel.py index 3eb8fcf9e35..b79f4fa929b 100644 --- a/python/plugins/processing/gui/ParametersPanel.py +++ b/python/plugins/processing/gui/ParametersPanel.py @@ -83,6 +83,10 @@ class ParametersPanel(BASE, WIDGET): for wrapper in list(self.wrappers.values()): wrapper.refresh() + def formatParameterTooltip(self, parameter): + return '

{}

{}

'.format(parameter.description(), + self.tr('Python identifier: ‘{}’').format('{}'.format(parameter.name()))) + def initWidgets(self): # If there are advanced parameters — show corresponding groupbox for param in self.alg.parameterDefinitions(): @@ -127,7 +131,7 @@ class ParametersPanel(BASE, WIDGET): widget = QWidget() widget.setLayout(layout) - widget.setToolTip(param.description()) + widget.setToolTip(self.formatParameterTooltip(param)) if type(widget) is QCheckBox: # checkbox widget - so description is embedded in widget rather than a separate @@ -164,6 +168,8 @@ class ParametersPanel(BASE, WIDGET): check.setChecked(True) self.layoutMain.insertWidget(self.layoutMain.count() - 1, check) self.checkBoxes[output.name()] = check + + widget.setToolTip(self.formatParameterTooltip(param)) self.outputWidgets[output.name()] = widget for wrapper in list(self.wrappers.values()): From 7cebe7a34358bdef27183deb54ba42e21e57275c Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Aug 2017 17:45:33 +1000 Subject: [PATCH 3/5] Fix some grammar --- python/core/symbology/qgssinglesymbolrenderer.sip | 2 +- python/plugins/processing/core/parameters.py | 2 +- src/core/symbology/qgssinglesymbolrenderer.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/core/symbology/qgssinglesymbolrenderer.sip b/python/core/symbology/qgssinglesymbolrenderer.sip index 940cc057eb0..622bfbb576d 100644 --- a/python/core/symbology/qgssinglesymbolrenderer.sip +++ b/python/core/symbology/qgssinglesymbolrenderer.sip @@ -63,7 +63,7 @@ create renderer from XML element void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings /Transfer/ ); %Docstring Configures appearance of legend when renderer is configured to use data-defined size for marker symbols. - This allow to configure for which values (symbol sizes) should be shown in the legend, whether to display + This allows configuring which values (symbol sizes) should be shown in the legend, whether to display different symbol sizes collapsed in one legend node or separated across multiple legend nodes etc. When renderer does not use data-defined size or does not use marker symbols, these settings will be ignored. diff --git a/python/plugins/processing/core/parameters.py b/python/plugins/processing/core/parameters.py index f6a2751f6b7..0321276bb2f 100644 --- a/python/plugins/processing/core/parameters.py +++ b/python/plugins/processing/core/parameters.py @@ -190,7 +190,7 @@ class ParameterMultipleInput(Parameter): return True if _minNumInputs < 1 and not self.flags() & QgsProcessingParameterDefinition.FlagOptional: - # don't allow to set negative or null number of inputs if parameter isn't optional + # don't allow setting negative or null number of inputs if parameter isn't optional return False self.minNumInputs = int(_minNumInputs) diff --git a/src/core/symbology/qgssinglesymbolrenderer.h b/src/core/symbology/qgssinglesymbolrenderer.h index f0ace755cc3..891a2da60bc 100644 --- a/src/core/symbology/qgssinglesymbolrenderer.h +++ b/src/core/symbology/qgssinglesymbolrenderer.h @@ -66,7 +66,7 @@ class CORE_EXPORT QgsSingleSymbolRenderer : public QgsFeatureRenderer /** * Configures appearance of legend when renderer is configured to use data-defined size for marker symbols. - * This allow to configure for which values (symbol sizes) should be shown in the legend, whether to display + * This allows configuring which values (symbol sizes) should be shown in the legend, whether to display * different symbol sizes collapsed in one legend node or separated across multiple legend nodes etc. * * When renderer does not use data-defined size or does not use marker symbols, these settings will be ignored. From 75a372c5e92f813bf54f42a11402f0ef001e6ff1 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Aug 2017 17:48:29 +1000 Subject: [PATCH 4/5] Spell check seting->setting --- scripts/spell_check/spelling.dat | 1 + src/plugins/grass/qgsgrassnewmapset.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/spell_check/spelling.dat b/scripts/spell_check/spelling.dat index d37ee5049e5..59e1b4afe33 100644 --- a/scripts/spell_check/spelling.dat +++ b/scripts/spell_check/spelling.dat @@ -6246,6 +6246,7 @@ sertificates:certificates serveral:several sesssion:session sesssions:sessions +seting:setting:* setted:set settelement:settlement settlment:settlement diff --git a/src/plugins/grass/qgsgrassnewmapset.h b/src/plugins/grass/qgsgrassnewmapset.h index 79010d80ca3..98d8e4d3c6e 100644 --- a/src/plugins/grass/qgsgrassnewmapset.h +++ b/src/plugins/grass/qgsgrassnewmapset.h @@ -213,7 +213,7 @@ class QgsGrassNewMapset : public QWizard, private Ui::QgsGrassNewMapsetBase //! Was the region page modified by user bool mRegionModified; - //! Check region seting + //! Check region setting void checkRegion(); //! Region map From 4ab4a1fcad75a87d2e5cb26f943f7e97edc38c7d Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 7 Aug 2017 18:08:57 +1000 Subject: [PATCH 5/5] Spell check 'mitre' -> 'miter' (i.e. use en-us variation) --- python/core/geometry/qgsgeometry.sip | 14 +++---- python/core/geometry/qgsgeometryengine.sip | 4 +- python/plugins/processing/algs/help/qgis.yaml | 12 +++--- python/plugins/processing/algs/qgis/Buffer.py | 6 +-- .../algs/qgis/FixedDistanceBuffer.py | 10 ++--- .../processing/algs/qgis/OffsetLine.py | 10 ++--- .../processing/algs/qgis/SingleSidedBuffer.py | 10 ++--- .../algs/qgis/VariableDistanceBuffer.py | 10 ++--- ...polys_mitre.gfs => buffer_polys_miter.gfs} | 4 +- ...polys_mitre.gml => buffer_polys_miter.gml} | 24 ++++++------ ...offset_mitre.gfs => line_offset_miter.gfs} | 4 +- ...offset_mitre.gml => line_offset_miter.gml} | 28 +++++++------- ...gfs => single_sided_buffer_line_miter.gfs} | 4 +- ...gml => single_sided_buffer_line_miter.gml} | 28 +++++++------- .../tests/testdata/qgis_algorithm_tests.yaml | 38 +++++++++---------- resources/function_help/json/offset_curve | 4 +- .../function_help/json/single_sided_buffer | 4 +- scripts/spell_check/.agignore | 1 + scripts/spell_check/spelling.dat | 1 + src/analysis/vector/qgsgeometryanalyzer.cpp | 2 +- src/app/qgsmaptooloffsetcurve.cpp | 4 +- src/app/qgsoptions.cpp | 2 +- src/core/dxf/qgsdxfexport.cpp | 8 ++-- src/core/expression/qgsexpressionfunction.cpp | 12 +++--- src/core/geometry/qgsgeometry.cpp | 16 ++++---- src/core/geometry/qgsgeometry.h | 14 +++---- src/core/geometry/qgsgeometryengine.h | 4 +- src/core/geometry/qgsgeos.cpp | 12 +++--- src/core/geometry/qgsgeos.h | 10 ++--- src/core/processing/qgsnativealgorithms.cpp | 8 ++-- src/core/symbology/qgssymbollayerutils.cpp | 12 +++--- .../checks/qgsgeometrygapcheck.cpp | 2 +- tests/code_layout/acceptable_missing_doc.py | 2 +- tests/src/core/testqgsexpression.cpp | 4 +- tests/src/python/test_qgsgeometry.py | 2 +- 35 files changed, 166 insertions(+), 164 deletions(-) rename python/plugins/processing/tests/testdata/expected/{buffer_polys_mitre.gfs => buffer_polys_miter.gfs} (90%) rename python/plugins/processing/tests/testdata/expected/{buffer_polys_mitre.gml => buffer_polys_miter.gml} (86%) rename python/plugins/processing/tests/testdata/expected/{line_offset_mitre.gfs => line_offset_miter.gfs} (82%) rename python/plugins/processing/tests/testdata/expected/{line_offset_mitre.gml => line_offset_miter.gml} (79%) rename python/plugins/processing/tests/testdata/expected/{single_sided_buffer_line_mitre.gfs => single_sided_buffer_line_miter.gfs} (78%) rename python/plugins/processing/tests/testdata/expected/{single_sided_buffer_line_mitre.gml => single_sided_buffer_line_miter.gml} (78%) diff --git a/python/core/geometry/qgsgeometry.sip b/python/core/geometry/qgsgeometry.sip index 510674c5e48..68259d3ef48 100644 --- a/python/core/geometry/qgsgeometry.sip +++ b/python/core/geometry/qgsgeometry.sip @@ -618,7 +618,7 @@ Test for containment of a point (uses GEOS) enum JoinStyle { JoinStyleRound, - JoinStyleMitre, + JoinStyleMiter, JoinStyleBevel, }; @@ -629,32 +629,32 @@ of segments used to approximate curves * :rtype: QgsGeometry %End - QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit ) const; + QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit ) const; %Docstring Returns a buffer region around the geometry, with additional style options. \param distance buffer distance \param segments for round joins, number of segments to approximate quarter-circle \param endCapStyle end cap style \param joinStyle join style for corners in geometry - \param mitreLimit limit on the mitre ratio used for very sharp corners (JoinStyleMitre only) + \param miterLimit limit on the miter ratio used for very sharp corners (JoinStyleMiter only) .. versionadded:: 2.4 :rtype: QgsGeometry %End - QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double mitreLimit ) const; + QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double miterLimit ) const; %Docstring Returns an offset line at a given distance and side from an input line. \param distance buffer distance \param segments for round joins, number of segments to approximate quarter-circle \param joinStyle join style for corners in geometry - \param mitreLimit limit on the mitre ratio used for very sharp corners (JoinStyleMitre only) + \param miterLimit limit on the miter ratio used for very sharp corners (JoinStyleMiter only) .. versionadded:: 2.4 :rtype: QgsGeometry %End QgsGeometry singleSidedBuffer( double distance, int segments, BufferSide side, JoinStyle joinStyle = JoinStyleRound, - double mitreLimit = 2.0 ) const; + double miterLimit = 2.0 ) const; %Docstring Returns a single sided buffer for a (multi)line geometry. The buffer is only applied to one side of the line. @@ -662,7 +662,7 @@ of segments used to approximate curves * \param segments for round joins, number of segments to approximate quarter-circle \param side side of geometry to buffer \param joinStyle join style for corners - \param mitreLimit limit on the mitre ratio used for very sharp corners + \param miterLimit limit on the miter ratio used for very sharp corners :return: buffered geometry, or an empty geometry if buffer could not be calculated .. versionadded:: 3.0 diff --git a/python/core/geometry/qgsgeometryengine.sip b/python/core/geometry/qgsgeometryengine.sip index ef1770facd2..28a38187f9d 100644 --- a/python/core/geometry/qgsgeometryengine.sip +++ b/python/core/geometry/qgsgeometryengine.sip @@ -50,7 +50,7 @@ class QgsGeometryEngine %Docstring :rtype: QgsAbstractGeometry %End - virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg = 0 ) const = 0 /Factory/; + virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring :rtype: QgsAbstractGeometry %End @@ -170,7 +170,7 @@ class QgsGeometryEngine :rtype: int %End - virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg = 0 ) const = 0 /Factory/; + virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg = 0 ) const = 0 /Factory/; %Docstring :rtype: QgsAbstractGeometry %End diff --git a/python/plugins/processing/algs/help/qgis.yaml b/python/plugins/processing/algs/help/qgis.yaml index 420b4fdfc54..bfb66ac657b 100755 --- a/python/plugins/processing/algs/help/qgis.yaml +++ b/python/plugins/processing/algs/help/qgis.yaml @@ -218,9 +218,9 @@ qgis:fixeddistancebuffer: > The end cap style parameter controls how line endings are handled in the buffer. - The join style parameter specifies whether round, mitre or beveled joins should be used when offsetting corners in a line. + The join style parameter specifies whether round, miter or beveled joins should be used when offsetting corners in a line. - The mitre limit parameter is only applicable for mitre join styles, and controls the maximum distance from the offset curve to use when creating a mitred join. + The miter limit parameter is only applicable for miter join styles, and controls the maximum distance from the offset curve to use when creating a mitered join. qgis:fixgeometries: > This algorithm attempts to create a valid representation of a given invalid geometry without losing any of the input vertices. Already-valid geometries are returned without further intervention. Always outputs multi-geometry layer. @@ -334,9 +334,9 @@ qgis:offsetline: > The segments parameter controls the number of line segments to use to approximate a quarter circle when creating rounded offsets. - The join style parameter specifies whether round, mitre or beveled joins should be used when offsetting corners in a line. + The join style parameter specifies whether round, miter or beveled joins should be used when offsetting corners in a line. - The mitre limit parameter is only applicable for mitre join styles, and controls the maximum distance from the offset curve to use when creating a mitred join. + The miter limit parameter is only applicable for miter join styles, and controls the maximum distance from the offset curve to use when creating a mitered join. qgis:orientedminimumboundingbox: > This algorithm takes a vector layer and generate a new one with the minimum rectangle that covers all the input features. @@ -537,9 +537,9 @@ qgis:singlesidedbuffer: > The segments parameter controls the number of line segments to use to approximate a quarter circle when creating rounded buffers. - The join style parameter specifies whether round, mitre or beveled joins should be used when buffering corners in a line. + The join style parameter specifies whether round, miter or beveled joins should be used when buffering corners in a line. - The mitre limit parameter is only applicable for mitre join styles, and controls the maximum distance from the buffer to use when creating a mitred join. + The miter limit parameter is only applicable for miter join styles, and controls the maximum distance from the buffer to use when creating a mitered join. qgis:smoothgeometry: > This algorithm smooths the geometries in a line or polygon layer. It creates a new layer with the same features as the ones in the input layer, but with geometries containing a higher number of vertices and corners in the geometries smoothed out. diff --git a/python/plugins/processing/algs/qgis/Buffer.py b/python/plugins/processing/algs/qgis/Buffer.py index 0bbc9401b1d..5975874c70a 100644 --- a/python/plugins/processing/algs/qgis/Buffer.py +++ b/python/plugins/processing/algs/qgis/Buffer.py @@ -32,7 +32,7 @@ from qgis.core import (QgsFeature, def buffering(feedback, context, sink, distance, field, useField, source, dissolve, segments, endCapStyle=1, - joinStyle=1, mitreLimit=2): + joinStyle=1, miterLimit=2): if useField: field = source.fields().lookupField(field) @@ -62,7 +62,7 @@ def buffering(feedback, context, sink, distance, field, useField, source, dissol inGeom = inFeat.geometry() - buffered_geometries.append(inGeom.buffer(float(value), segments, endCapStyle, joinStyle, mitreLimit)) + buffered_geometries.append(inGeom.buffer(float(value), segments, endCapStyle, joinStyle, miterLimit)) current += 1 feedback.setProgress(int(current * total)) @@ -86,7 +86,7 @@ def buffering(feedback, context, sink, distance, field, useField, source, dissol value = distance inGeom = inFeat.geometry() outFeat = QgsFeature() - outGeom = inGeom.buffer(float(value), segments, endCapStyle, joinStyle, mitreLimit) + outGeom = inGeom.buffer(float(value), segments, endCapStyle, joinStyle, miterLimit) outFeat.setGeometry(outGeom) outFeat.setAttributes(attrs) sink.addFeature(outFeat, QgsFeatureSink.FastInsert) diff --git a/python/plugins/processing/algs/qgis/FixedDistanceBuffer.py b/python/plugins/processing/algs/qgis/FixedDistanceBuffer.py index ad066b43cf4..fb8c82bf9e3 100644 --- a/python/plugins/processing/algs/qgis/FixedDistanceBuffer.py +++ b/python/plugins/processing/algs/qgis/FixedDistanceBuffer.py @@ -54,7 +54,7 @@ class FixedDistanceBuffer(QgisAlgorithm): DISSOLVE = 'DISSOLVE' END_CAP_STYLE = 'END_CAP_STYLE' JOIN_STYLE = 'JOIN_STYLE' - MITRE_LIMIT = 'MITRE_LIMIT' + MITER_LIMIT = 'MITER_LIMIT' def icon(self): return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'buffer.png')) @@ -83,14 +83,14 @@ class FixedDistanceBuffer(QgisAlgorithm): self.tr('End cap style'), options=self.end_cap_styles, defaultValue=0)) self.join_styles = [self.tr('Round'), - 'Mitre', + 'Miter', 'Bevel'] self.addParameter(QgsProcessingParameterEnum( self.JOIN_STYLE, self.tr('Join style'), options=self.join_styles, defaultValue=0)) - self.addParameter(QgsProcessingParameterNumber(self.MITRE_LIMIT, - self.tr('Mitre limit'), minValue=0, defaultValue=2)) + self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT, + self.tr('Miter limit'), minValue=0, defaultValue=2)) self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Buffer'), QgsProcessing.TypeVectorPolygon)) @@ -108,7 +108,7 @@ class FixedDistanceBuffer(QgisAlgorithm): segments = self.parameterAsInt(parameters, self.SEGMENTS, context) end_cap_style = self.parameterAsEnum(parameters, self.END_CAP_STYLE, context) + 1 join_style = self.parameterAsEnum(parameters, self.JOIN_STYLE, context) + 1 - miter_limit = self.parameterAsDouble(parameters, self.MITRE_LIMIT, context) + miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context) (sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context, source.fields(), QgsWkbTypes.Polygon, source.sourceCrs()) diff --git a/python/plugins/processing/algs/qgis/OffsetLine.py b/python/plugins/processing/algs/qgis/OffsetLine.py index 66c2c7f4c77..acdba6ce119 100644 --- a/python/plugins/processing/algs/qgis/OffsetLine.py +++ b/python/plugins/processing/algs/qgis/OffsetLine.py @@ -45,7 +45,7 @@ class OffsetLine(QgisFeatureBasedAlgorithm): DISTANCE = 'DISTANCE' SEGMENTS = 'SEGMENTS' JOIN_STYLE = 'JOIN_STYLE' - MITRE_LIMIT = 'MITRE_LIMIT' + MITER_LIMIT = 'MITER_LIMIT' def group(self): return self.tr('Vector geometry tools') @@ -68,14 +68,14 @@ class OffsetLine(QgisFeatureBasedAlgorithm): type=QgsProcessingParameterNumber.Integer, minValue=1, defaultValue=8)) self.join_styles = [self.tr('Round'), - 'Mitre', + 'Miter', 'Bevel'] self.addParameter(QgsProcessingParameterEnum( self.JOIN_STYLE, self.tr('Join style'), options=self.join_styles)) - self.addParameter(QgsProcessingParameterNumber(self.MITRE_LIMIT, - self.tr('Mitre limit'), type=QgsProcessingParameterNumber.Double, + self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT, + self.tr('Miter limit'), type=QgsProcessingParameterNumber.Double, minValue=1, defaultValue=2)) def name(self): @@ -94,7 +94,7 @@ class OffsetLine(QgisFeatureBasedAlgorithm): self.distance = self.parameterAsDouble(parameters, self.DISTANCE, context) self.segments = self.parameterAsInt(parameters, self.SEGMENTS, context) self.join_style = self.parameterAsEnum(parameters, self.JOIN_STYLE, context) + 1 - self.miter_limit = self.parameterAsDouble(parameters, self.MITRE_LIMIT, context) + self.miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context) return True def processFeature(self, feature, feedback): diff --git a/python/plugins/processing/algs/qgis/SingleSidedBuffer.py b/python/plugins/processing/algs/qgis/SingleSidedBuffer.py index ab55fdec8fc..929392fcff9 100644 --- a/python/plugins/processing/algs/qgis/SingleSidedBuffer.py +++ b/python/plugins/processing/algs/qgis/SingleSidedBuffer.py @@ -40,7 +40,7 @@ class SingleSidedBuffer(QgisFeatureBasedAlgorithm): SIDE = 'SIDE' SEGMENTS = 'SEGMENTS' JOIN_STYLE = 'JOIN_STYLE' - MITRE_LIMIT = 'MITRE_LIMIT' + MITER_LIMIT = 'MITER_LIMIT' def group(self): return self.tr('Vector geometry tools') @@ -55,7 +55,7 @@ class SingleSidedBuffer(QgisFeatureBasedAlgorithm): self.sides = [self.tr('Left'), 'Right'] self.join_styles = [self.tr('Round'), - 'Mitre', + 'Miter', 'Bevel'] def initParameters(self, config=None): @@ -74,8 +74,8 @@ class SingleSidedBuffer(QgisFeatureBasedAlgorithm): self.JOIN_STYLE, self.tr('Join style'), options=self.join_styles)) - self.addParameter(QgsProcessingParameterNumber(self.MITRE_LIMIT, - self.tr('Mitre limit'), minValue=1, defaultValue=2)) + self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT, + self.tr('Miter limit'), minValue=1, defaultValue=2)) def name(self): return 'singlesidedbuffer' @@ -100,7 +100,7 @@ class SingleSidedBuffer(QgisFeatureBasedAlgorithm): self.side = QgsGeometry.SideLeft else: self.side = QgsGeometry.SideRight - self.miter_limit = self.parameterAsDouble(parameters, self.MITRE_LIMIT, context) + self.miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context) return True def processFeature(self, feature, feedback): diff --git a/python/plugins/processing/algs/qgis/VariableDistanceBuffer.py b/python/plugins/processing/algs/qgis/VariableDistanceBuffer.py index 3c0750cc049..3b757c644db 100644 --- a/python/plugins/processing/algs/qgis/VariableDistanceBuffer.py +++ b/python/plugins/processing/algs/qgis/VariableDistanceBuffer.py @@ -53,7 +53,7 @@ class VariableDistanceBuffer(QgisAlgorithm): DISSOLVE = 'DISSOLVE' END_CAP_STYLE = 'END_CAP_STYLE' JOIN_STYLE = 'JOIN_STYLE' - MITRE_LIMIT = 'MITRE_LIMIT' + MITER_LIMIT = 'MITER_LIMIT' def icon(self): return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'buffer.png')) @@ -83,14 +83,14 @@ class VariableDistanceBuffer(QgisAlgorithm): self.tr('End cap style'), options=self.end_cap_styles, defaultValue=0)) self.join_styles = [self.tr('Round'), - 'Mitre', + 'Miter', 'Bevel'] self.addParameter(QgsProcessingParameterEnum( self.JOIN_STYLE, self.tr('Join style'), options=self.join_styles, defaultValue=0)) - self.addParameter(QgsProcessingParameterNumber(self.MITRE_LIMIT, - self.tr('Mitre limit'), minValue=0, defaultValue=2)) + self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT, + self.tr('Miter limit'), minValue=0, defaultValue=2)) self.addParameter( QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Buffer'), QgsProcessing.TypeVectorPolygon)) @@ -108,7 +108,7 @@ class VariableDistanceBuffer(QgisAlgorithm): segments = self.parameterAsInt(parameters, self.SEGMENTS, context) end_cap_style = self.parameterAsEnum(parameters, self.END_CAP_STYLE, context) + 1 join_style = self.parameterAsEnum(parameters, self.JOIN_STYLE, context) + 1 - miter_limit = self.parameterAsDouble(parameters, self.MITRE_LIMIT, context) + miter_limit = self.parameterAsDouble(parameters, self.MITER_LIMIT, context) field = self.parameterAsString(parameters, self.FIELD, context) diff --git a/python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gfs b/python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gfs similarity index 90% rename from python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gfs rename to python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gfs index 4ccafc46123..3fb99319271 100644 --- a/python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gfs +++ b/python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gfs @@ -1,7 +1,7 @@ - buffer_polys_mitre - buffer_polys_mitre + buffer_polys_miter + buffer_polys_miter 3 EPSG:4326 diff --git a/python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gml b/python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gml similarity index 86% rename from python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gml rename to python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gml index 3ee645c190c..aef8d852e7a 100644 --- a/python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gml +++ b/python/plugins/processing/tests/testdata/expected/buffer_polys_miter.gml @@ -12,47 +12,47 @@ - + -2,-2 -2,4 4,4 4,1 3,1 3,-2 -2,-2 aaaaa 33 44.123456 - + - + 5.0,6.414213562373096 7.93754927857421,3.451405886594554 7.757968851470933,3.017860383945075 2.242031148529061,3.017860383945087 2.062450721425788,3.451405886594566 5.0,6.414213562373096 Aaaaa -33 0 - + - + 1,4 1,7 4,7 4,4 1,4 bbaaa 0.123 - + - + 5,2 11,2 11,-4 5,-4 5,2 ASDF 0 - + - + 120 -100291.43213 - + - + 3.162277660168381,3.0 7.0,1.720759220056127 7.0,-4.618033988749896 1.0,-1.618033988749894 1,3 3.162277660168381,3.0 elim 2 3.33 - + diff --git a/python/plugins/processing/tests/testdata/expected/line_offset_mitre.gfs b/python/plugins/processing/tests/testdata/expected/line_offset_miter.gfs similarity index 82% rename from python/plugins/processing/tests/testdata/expected/line_offset_mitre.gfs rename to python/plugins/processing/tests/testdata/expected/line_offset_miter.gfs index 41db8897273..7836dcb9d7b 100644 --- a/python/plugins/processing/tests/testdata/expected/line_offset_mitre.gfs +++ b/python/plugins/processing/tests/testdata/expected/line_offset_miter.gfs @@ -1,7 +1,7 @@ - line_offset_mitre - line_offset_mitre + line_offset_miter + line_offset_miter 2 EPSG:4326 diff --git a/python/plugins/processing/tests/testdata/expected/line_offset_mitre.gml b/python/plugins/processing/tests/testdata/expected/line_offset_miter.gml similarity index 79% rename from python/plugins/processing/tests/testdata/expected/line_offset_mitre.gml rename to python/plugins/processing/tests/testdata/expected/line_offset_miter.gml index ba366ba84f5..43b2ef271f1 100644 --- a/python/plugins/processing/tests/testdata/expected/line_offset_mitre.gml +++ b/python/plugins/processing/tests/testdata/expected/line_offset_miter.gml @@ -12,37 +12,37 @@ - + 6,3 8,3 8.0,3.414213562373094 10.292893218813452,5.707106781186548 - + - + -1,0 1,0 - + - + 1,0 1,3 2,3 - + - + 3,2 5,2 - + - + 7,-2 10,-2 - + - + 5.292893218813452,-2.292893218813453 9.292893218813452,1.707106781186547 - + - - + + diff --git a/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gfs b/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gfs similarity index 78% rename from python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gfs rename to python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gfs index a54045e71b1..bd6834a784c 100644 --- a/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gfs +++ b/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gfs @@ -1,7 +1,7 @@ - single_sided_buffer_line_mitre - single_sided_buffer_line_mitre + single_sided_buffer_line_miter + single_sided_buffer_line_miter 3 EPSG:4326 diff --git a/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gml b/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gml similarity index 78% rename from python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gml rename to python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gml index 17462a4f976..43d87603a2a 100644 --- a/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_mitre.gml +++ b/python/plugins/processing/tests/testdata/expected/single_sided_buffer_line_miter.gml @@ -12,37 +12,37 @@ - + 6,2 9,2 9,3 11,5 11.707106781186548,4.292893218813452 10.0,2.585786437626905 10,1 6,1 6,2 - + - + -1,-1 1,-1 1,-2 -1,-2 -1,-1 - + - + 2,0 2,2 3,2 3,3 4,3 4,1 3,1 3,0 2,0 - + - + 3,1 5,1 5,0 3,0 3,1 - + - + 7,-3 10,-3 10,-4 7,-4 7,-3 - + - + 6,-3 10,1 10.707106781186548,0.292893218813453 6.707106781186548,-3.707106781186547 6,-3 - + - - + + diff --git a/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml index 79378a18d39..7c3d63cd6c0 100644 --- a/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml +++ b/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml @@ -645,7 +645,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 results: OUTPUT: @@ -663,7 +663,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 results: OUTPUT: @@ -674,18 +674,18 @@ tests: precision: 7 - algorithm: qgis:offsetline - name: Offset line mitre + name: Offset line miter params: DISTANCE: 1.0 INPUT: name: lines.gml type: vector JOIN_STYLE: '1' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 4 results: OUTPUT: - name: expected/line_offset_mitre.gml + name: expected/line_offset_miter.gml type: vector compare: geometry: @@ -699,7 +699,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '2' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 results: OUTPUT: @@ -717,7 +717,7 @@ tests: name: multilines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 results: OUTPUT: @@ -737,7 +737,7 @@ tests: name: polys.gml type: vector JOIN_STYLE: '2' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 5 results: OUTPUT: @@ -745,7 +745,7 @@ tests: type: vector - algorithm: qgis:fixeddistancebuffer - name: Buffer polygons using mitre + name: Buffer polygons using miter params: DISSOLVE: false DISTANCE: 1.0 @@ -754,11 +754,11 @@ tests: name: polys.gml type: vector JOIN_STYLE: '1' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 5 results: OUTPUT: - name: expected/buffer_polys_mitre.gml + name: expected/buffer_polys_miter.gml type: vector - algorithm: qgis:fixeddistancebuffer @@ -771,7 +771,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 5 results: OUTPUT: @@ -791,7 +791,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 5 results: OUTPUT: @@ -811,7 +811,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 5 results: OUTPUT: @@ -926,7 +926,7 @@ tests: name: lines.gml type: vector JOIN_STYLE: '0' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 SIDE: '0' results: @@ -938,19 +938,19 @@ tests: precision: 7 - algorithm: qgis:singlesidedbuffer - name: Single sided buffer lines (Right, mitre) + name: Single sided buffer lines (Right, miter) params: DISTANCE: 1.0 INPUT: name: lines.gml type: vector JOIN_STYLE: '1' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 SIDE: '1' results: OUTPUT: - name: expected/single_sided_buffer_line_mitre.gml + name: expected/single_sided_buffer_line_miter.gml type: vector compare: geometry: @@ -964,7 +964,7 @@ tests: name: multilines.gml type: vector JOIN_STYLE: '2' - MITRE_LIMIT: 2 + MITER_LIMIT: 2 SEGMENTS: 8 SIDE: '0' results: diff --git a/resources/function_help/json/offset_curve b/resources/function_help/json/offset_curve index b94ef6fa218..03f08a159de 100644 --- a/resources/function_help/json/offset_curve +++ b/resources/function_help/json/offset_curve @@ -5,8 +5,8 @@ "arguments": [ {"arg":"geometry","description":"a (multi)linestring geometry"}, {"arg":"distance","description":"offset distance. Positive values will be buffered to the left of lines, negative values to the right"}, {"arg":"segments","optional":true,"default":"8","description":"number of segments to use to represent a quarter circle when a round join style is used. A larger number results in a smoother line with more nodes."}, - {"arg":"join","optional":true,"default":"1","description":"join style for corners, where 1 = round, 2 = mitre and 3 = bevel"}, - {"arg":"mitre_limit","optional":true,"default":"2.0","description":"limit on the mitre ratio used for very sharp corners (when using mitre joins only)"}], + {"arg":"join","optional":true,"default":"1","description":"join style for corners, where 1 = round, 2 = miter and 3 = bevel"}, + {"arg":"miter_limit","optional":true,"default":"2.0","description":"limit on the miter ratio used for very sharp corners (when using miter joins only)"}], "examples": [ { "expression":"offset_curve($geometry, 10.5)", "returns":"line offset to the left by 10.5 units"}, { "expression":"offset_curve($geometry, -10.5)", "returns":"line offset to the right by 10.5 units"}, { "expression":"offset_curve($geometry, 10.5, segments=16, join=1)", "returns":"line offset to the left by 10.5 units, using more segments to result in a smoother curve"}, diff --git a/resources/function_help/json/single_sided_buffer b/resources/function_help/json/single_sided_buffer index 5eb9ff83412..ae25c7629d4 100644 --- a/resources/function_help/json/single_sided_buffer +++ b/resources/function_help/json/single_sided_buffer @@ -5,8 +5,8 @@ "arguments": [ {"arg":"geometry","description":"a (multi)linestring geometry"}, {"arg":"distance","description":"buffer distance. Positive values will be buffered to the left of lines, negative values to the right"}, {"arg":"segments","optional":true,"default":"8","description":"number of segments to use to represent a quarter circle when a round join style is used. A larger number results in a smoother buffer with more nodes."}, - {"arg":"join","optional":true,"default":"1","description":"join style for corners, where 1 = round, 2 = mitre and 3 = bevel"}, - {"arg":"mitre_limit","optional":true,"default":"2.0","description":"limit on the mitre ratio used for very sharp corners (when using mitre joins only)"}], + {"arg":"join","optional":true,"default":"1","description":"join style for corners, where 1 = round, 2 = miter and 3 = bevel"}, + {"arg":"miter_limit","optional":true,"default":"2.0","description":"limit on the miter ratio used for very sharp corners (when using miter joins only)"}], "examples": [ { "expression":"single_sided_buffer($geometry, 10.5)", "returns":"line buffered to the left by 10.5 units"}, { "expression":"single_sided_buffer($geometry, -10.5)", "returns":"line buffered to the right by 10.5 units"}, { "expression":"single_sided_buffer($geometry, 10.5, segments=16, join=1)", "returns":"line buffered to the left by 10.5 units, using more segments to result in a smoother buffer"}, diff --git a/scripts/spell_check/.agignore b/scripts/spell_check/.agignore index 27e5ca1ccd9..7f98cc47cd0 100644 --- a/scripts/spell_check/.agignore +++ b/scripts/spell_check/.agignore @@ -22,6 +22,7 @@ src/plugins/grass/qtermwidget/ *.*.sortinc *.*.png *.*.prepare +*.sld .agignore diff --git a/scripts/spell_check/spelling.dat b/scripts/spell_check/spelling.dat index 59e1b4afe33..446a841618f 100644 --- a/scripts/spell_check/spelling.dat +++ b/scripts/spell_check/spelling.dat @@ -4451,6 +4451,7 @@ missonary:missionary misterious:mysterious mistery:mystery misteryous:mysterious +mitre:miter:* mkae:make mkaes:makes mkaing:making diff --git a/src/analysis/vector/qgsgeometryanalyzer.cpp b/src/analysis/vector/qgsgeometryanalyzer.cpp index 7093f463949..ddfcb087ef9 100644 --- a/src/analysis/vector/qgsgeometryanalyzer.cpp +++ b/src/analysis/vector/qgsgeometryanalyzer.cpp @@ -1064,7 +1064,7 @@ QgsGeometry QgsGeometryAnalyzer::createOffsetGeometry( const QgsGeometry &geom, if ( geom.type() == QgsWkbTypes::LineGeometry ) { GEOSGeometry *inputGeomItGeos = inputGeomIt->exportToGeos(); - GEOSGeometry *offsetGeom = GEOSOffsetCurve_r( geosctxt, inputGeomItGeos, -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*mitreLimit*/ ); + GEOSGeometry *offsetGeom = GEOSOffsetCurve_r( geosctxt, inputGeomItGeos, -offset, 8 /*quadSegments*/, 0 /*joinStyle*/, 5.0 /*miterLimit*/ ); GEOSGeom_destroy_r( geosctxt, inputGeomItGeos ); if ( !offsetGeom || !GEOSisValid_r( geosctxt, offsetGeom ) ) { diff --git a/src/app/qgsmaptooloffsetcurve.cpp b/src/app/qgsmaptooloffsetcurve.cpp index 7b66e557338..e8a0f071f73 100644 --- a/src/app/qgsmaptooloffsetcurve.cpp +++ b/src/app/qgsmaptooloffsetcurve.cpp @@ -376,9 +376,9 @@ void QgsMapToolOffsetCurve::setOffsetForRubberBand( double offset ) QgsSettings s; int joinStyle = s.value( QStringLiteral( "/qgis/digitizing/offset_join_style" ), 0 ).toInt(); int quadSegments = s.value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt(); - double mitreLimit = s.value( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), 5.0 ).toDouble(); + double miterLimit = s.value( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), 5.0 ).toDouble(); - GEOSGeometry *offsetGeom = GEOSOffsetCurve_r( QgsGeometry::getGEOSHandler(), geosGeom, offset, quadSegments, joinStyle, mitreLimit ); + GEOSGeometry *offsetGeom = GEOSOffsetCurve_r( QgsGeometry::getGEOSHandler(), geosGeom, offset, quadSegments, joinStyle, miterLimit ); GEOSGeom_destroy_r( QgsGeometry::getGEOSHandler(), geosGeom ); if ( !offsetGeom ) { diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index 8030ec1d7a2..89a7b20af63 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -930,7 +930,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QListsetCurrentIndex( mSnappingMainDialogComboBox->findData( mSettings->value( QStringLiteral( "/qgis/mainSnappingWidgetMode" ), "dialog" ).toString() ) ); mOffsetJoinStyleComboBox->addItem( tr( "Round" ), 0 ); - mOffsetJoinStyleComboBox->addItem( tr( "Mitre" ), 1 ); + mOffsetJoinStyleComboBox->addItem( tr( "Miter" ), 1 ); mOffsetJoinStyleComboBox->addItem( tr( "Bevel" ), 2 ); mOffsetJoinStyleComboBox->setCurrentIndex( mSettings->value( QStringLiteral( "/qgis/digitizing/offset_join_style" ), 0 ).toInt() ); mOffsetQuadSegSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt() ); diff --git a/src/core/dxf/qgsdxfexport.cpp b/src/core/dxf/qgsdxfexport.cpp index c97100a78b4..45b1d34926f 100644 --- a/src/core/dxf/qgsdxfexport.cpp +++ b/src/core/dxf/qgsdxfexport.cpp @@ -3760,7 +3760,7 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT QgsGeos geos( tempGeom ); if ( tempGeom != geom.get() ) delete tempGeom; - tempGeom = geos.offsetCurve( offset, 0, GEOSBUF_JOIN_MITRE, 2.0 ); + tempGeom = geos.offsetCurve( offset, 0, GEOSBUF_JOIN_MITRE, 2.0 ); //#spellok //#spellok if ( !tempGeom ) tempGeom = geom.get(); } @@ -3781,7 +3781,7 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT QgsGeos geos( tempGeom ); if ( tempGeom != geom.get() ) delete tempGeom; - tempGeom = geos.offsetCurve( offset, 0, GEOSBUF_JOIN_MITRE, 2.0 ); + tempGeom = geos.offsetCurve( offset, 0, GEOSBUF_JOIN_MITRE, 2.0 ); //#spellok //#spellok if ( !tempGeom ) tempGeom = geom.get(); } @@ -3807,7 +3807,7 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT QgsGeos geos( tempGeom ); if ( tempGeom != geom.get() ) delete tempGeom; - tempGeom = geos.buffer( offset, 0, GEOSBUF_CAP_FLAT, GEOSBUF_JOIN_MITRE, 2.0 ); + tempGeom = geos.buffer( offset, 0, GEOSBUF_CAP_FLAT, GEOSBUF_JOIN_MITRE, 2.0 ); //#spellok //#spellok if ( !tempGeom ) tempGeom = geom.get(); } @@ -3828,7 +3828,7 @@ void QgsDxfExport::addFeature( QgsSymbolRenderContext &ctx, const QgsCoordinateT QgsGeos geos( tempGeom ); if ( tempGeom != geom.get() ) delete tempGeom; - tempGeom = geos.buffer( offset, 0, GEOSBUF_CAP_FLAT, GEOSBUF_JOIN_MITRE, 2.0 ); + tempGeom = geos.buffer( offset, 0, GEOSBUF_CAP_FLAT, GEOSBUF_JOIN_MITRE, 2.0 ); //#spellok //#spellok if ( !tempGeom ) tempGeom = geom.get(); } diff --git a/src/core/expression/qgsexpressionfunction.cpp b/src/core/expression/qgsexpressionfunction.cpp index 5907f40286b..5693e8f4ed8 100644 --- a/src/core/expression/qgsexpressionfunction.cpp +++ b/src/core/expression/qgsexpressionfunction.cpp @@ -2452,9 +2452,9 @@ static QVariant fcnOffsetCurve( const QVariantList &values, const QgsExpressionC QgsGeometry::JoinStyle join = static_cast< QgsGeometry::JoinStyle >( QgsExpressionUtils::getIntValue( values.at( 3 ), parent ) ); if ( join < QgsGeometry::JoinStyleRound || join > QgsGeometry::JoinStyleBevel ) return QVariant(); - double mitreLimit = QgsExpressionUtils::getDoubleValue( values.at( 3 ), parent ); + double miterLimit = QgsExpressionUtils::getDoubleValue( values.at( 3 ), parent ); - QgsGeometry geom = fGeom.offsetCurve( dist, segments, join, mitreLimit ); + QgsGeometry geom = fGeom.offsetCurve( dist, segments, join, miterLimit ); QVariant result = !geom.isNull() ? QVariant::fromValue( geom ) : QVariant(); return result; } @@ -2467,9 +2467,9 @@ static QVariant fcnSingleSidedBuffer( const QVariantList &values, const QgsExpre QgsGeometry::JoinStyle join = static_cast< QgsGeometry::JoinStyle >( QgsExpressionUtils::getIntValue( values.at( 3 ), parent ) ); if ( join < QgsGeometry::JoinStyleRound || join > QgsGeometry::JoinStyleBevel ) return QVariant(); - double mitreLimit = QgsExpressionUtils::getDoubleValue( values.at( 3 ), parent ); + double miterLimit = QgsExpressionUtils::getDoubleValue( values.at( 3 ), parent ); - QgsGeometry geom = fGeom.singleSidedBuffer( dist, segments, QgsGeometry::SideLeft, join, mitreLimit ); + QgsGeometry geom = fGeom.singleSidedBuffer( dist, segments, QgsGeometry::SideLeft, join, miterLimit ); QVariant result = !geom.isNull() ? QVariant::fromValue( geom ) : QVariant(); return result; } @@ -4068,13 +4068,13 @@ const QList &QgsExpression::Functions() << QgsExpressionFunction::Parameter( QStringLiteral( "distance" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "segments" ), true, 8.0 ) << QgsExpressionFunction::Parameter( QStringLiteral( "join" ), true, QgsGeometry::JoinStyleRound ) - << QgsExpressionFunction::Parameter( QStringLiteral( "mitre_limit" ), true, 2.0 ), + << QgsExpressionFunction::Parameter( QStringLiteral( "miter_limit" ), true, 2.0 ), fcnOffsetCurve, QStringLiteral( "GeometryGroup" ) ) << new QgsStaticExpressionFunction( QStringLiteral( "single_sided_buffer" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "distance" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "segments" ), true, 8.0 ) << QgsExpressionFunction::Parameter( QStringLiteral( "join" ), true, QgsGeometry::JoinStyleRound ) - << QgsExpressionFunction::Parameter( QStringLiteral( "mitre_limit" ), true, 2.0 ), + << QgsExpressionFunction::Parameter( QStringLiteral( "miter_limit" ), true, 2.0 ), fcnSingleSidedBuffer, QStringLiteral( "GeometryGroup" ) ) << new QgsStaticExpressionFunction( QStringLiteral( "extend" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "start_distance" ) ) diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index 97db917f50f..8762f4af184 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -1413,7 +1413,7 @@ QgsGeometry QgsGeometry::buffer( double distance, int segments ) const return QgsGeometry( geom ); } -QgsGeometry QgsGeometry::buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit ) const +QgsGeometry QgsGeometry::buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit ) const { if ( !d->geometry ) { @@ -1421,7 +1421,7 @@ QgsGeometry QgsGeometry::buffer( double distance, int segments, EndCapStyle endC } QgsGeos g( d->geometry ); - QgsAbstractGeometry *geom = g.buffer( distance, segments, endCapStyle, joinStyle, mitreLimit ); + QgsAbstractGeometry *geom = g.buffer( distance, segments, endCapStyle, joinStyle, miterLimit ); if ( !geom ) { return QgsGeometry(); @@ -1429,7 +1429,7 @@ QgsGeometry QgsGeometry::buffer( double distance, int segments, EndCapStyle endC return QgsGeometry( geom ); } -QgsGeometry QgsGeometry::offsetCurve( double distance, int segments, JoinStyle joinStyle, double mitreLimit ) const +QgsGeometry QgsGeometry::offsetCurve( double distance, int segments, JoinStyle joinStyle, double miterLimit ) const { if ( !d->geometry || type() != QgsWkbTypes::LineGeometry ) { @@ -1442,7 +1442,7 @@ QgsGeometry QgsGeometry::offsetCurve( double distance, int segments, JoinStyle j QList results; Q_FOREACH ( const QgsGeometry &part, parts ) { - QgsGeometry result = part.offsetCurve( distance, segments, joinStyle, mitreLimit ); + QgsGeometry result = part.offsetCurve( distance, segments, joinStyle, miterLimit ); if ( result ) results << result; } @@ -1459,7 +1459,7 @@ QgsGeometry QgsGeometry::offsetCurve( double distance, int segments, JoinStyle j else { QgsGeos geos( d->geometry ); - QgsAbstractGeometry *offsetGeom = geos.offsetCurve( distance, segments, joinStyle, mitreLimit ); + QgsAbstractGeometry *offsetGeom = geos.offsetCurve( distance, segments, joinStyle, miterLimit ); if ( !offsetGeom ) { return QgsGeometry(); @@ -1468,7 +1468,7 @@ QgsGeometry QgsGeometry::offsetCurve( double distance, int segments, JoinStyle j } } -QgsGeometry QgsGeometry::singleSidedBuffer( double distance, int segments, BufferSide side, JoinStyle joinStyle, double mitreLimit ) const +QgsGeometry QgsGeometry::singleSidedBuffer( double distance, int segments, BufferSide side, JoinStyle joinStyle, double miterLimit ) const { if ( !d->geometry || type() != QgsWkbTypes::LineGeometry ) { @@ -1481,7 +1481,7 @@ QgsGeometry QgsGeometry::singleSidedBuffer( double distance, int segments, Buffe QList results; Q_FOREACH ( const QgsGeometry &part, parts ) { - QgsGeometry result = part.singleSidedBuffer( distance, segments, side, joinStyle, mitreLimit ); + QgsGeometry result = part.singleSidedBuffer( distance, segments, side, joinStyle, miterLimit ); if ( result ) results << result; } @@ -1499,7 +1499,7 @@ QgsGeometry QgsGeometry::singleSidedBuffer( double distance, int segments, Buffe { QgsGeos geos( d->geometry ); QgsAbstractGeometry *bufferGeom = geos.singleSidedBuffer( distance, segments, side, - joinStyle, mitreLimit ); + joinStyle, miterLimit ); if ( !bufferGeom ) { return QgsGeometry(); diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index be10a210fd6..099744699d4 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -589,7 +589,7 @@ class CORE_EXPORT QgsGeometry enum JoinStyle { JoinStyleRound = 1, //!< Use rounded joins - JoinStyleMitre, //!< Use mitred joins + JoinStyleMiter, //!< Use mitered joins JoinStyleBevel, //!< Use beveled joins }; @@ -602,19 +602,19 @@ class CORE_EXPORT QgsGeometry * \param segments for round joins, number of segments to approximate quarter-circle * \param endCapStyle end cap style * \param joinStyle join style for corners in geometry - * \param mitreLimit limit on the mitre ratio used for very sharp corners (JoinStyleMitre only) + * \param miterLimit limit on the miter ratio used for very sharp corners (JoinStyleMiter only) * \since QGIS 2.4 */ - QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit ) const; + QgsGeometry buffer( double distance, int segments, EndCapStyle endCapStyle, JoinStyle joinStyle, double miterLimit ) const; /** Returns an offset line at a given distance and side from an input line. * \param distance buffer distance * \param segments for round joins, number of segments to approximate quarter-circle * \param joinStyle join style for corners in geometry - * \param mitreLimit limit on the mitre ratio used for very sharp corners (JoinStyleMitre only) + * \param miterLimit limit on the miter ratio used for very sharp corners (JoinStyleMiter only) * \since QGIS 2.4 */ - QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double mitreLimit ) const; + QgsGeometry offsetCurve( double distance, int segments, JoinStyle joinStyle, double miterLimit ) const; /** * Returns a single sided buffer for a (multi)line geometry. The buffer is only @@ -623,14 +623,14 @@ class CORE_EXPORT QgsGeometry * \param segments for round joins, number of segments to approximate quarter-circle * \param side side of geometry to buffer * \param joinStyle join style for corners - * \param mitreLimit limit on the mitre ratio used for very sharp corners + * \param miterLimit limit on the miter ratio used for very sharp corners * \returns buffered geometry, or an empty geometry if buffer could not be * calculated * \since QGIS 3.0 */ QgsGeometry singleSidedBuffer( double distance, int segments, BufferSide side, JoinStyle joinStyle = JoinStyleRound, - double mitreLimit = 2.0 ) const; + double miterLimit = 2.0 ) const; /** * Extends a (multi)line geometry by extrapolating out the start or end of the line diff --git a/src/core/geometry/qgsgeometryengine.h b/src/core/geometry/qgsgeometryengine.h index f88948b0780..cbe320495af 100644 --- a/src/core/geometry/qgsgeometryengine.h +++ b/src/core/geometry/qgsgeometryengine.h @@ -42,7 +42,7 @@ class CORE_EXPORT QgsGeometryEngine virtual QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry * > &, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *symDifference( const QgsAbstractGeometry &geom, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *buffer( double distance, int segments, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; - virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + virtual QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *simplify( double tolerance, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *interpolate( double distance, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; virtual QgsAbstractGeometry *envelope( QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; @@ -101,7 +101,7 @@ class CORE_EXPORT QgsGeometryEngine return 2; } - virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; + virtual QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const = 0 SIP_FACTORY; protected: const QgsAbstractGeometry *mGeometry = nullptr; diff --git a/src/core/geometry/qgsgeos.cpp b/src/core/geometry/qgsgeos.cpp index 5945d7eaaab..adb66d0a4c0 100644 --- a/src/core/geometry/qgsgeos.cpp +++ b/src/core/geometry/qgsgeos.cpp @@ -1452,7 +1452,7 @@ QgsAbstractGeometry *QgsGeos::buffer( double distance, int segments, QString *er return fromGeos( geos.get() ); } -QgsAbstractGeometry *QgsGeos::buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg ) const +QgsAbstractGeometry *QgsGeos::buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg ) const { if ( !mGeos ) { @@ -1462,7 +1462,7 @@ QgsAbstractGeometry *QgsGeos::buffer( double distance, int segments, int endCapS GEOSGeomScopedPtr geos; try { - geos.reset( GEOSBufferWithStyle_r( geosinit.ctxt, mGeos, distance, segments, endCapStyle, joinStyle, mitreLimit ) ); + geos.reset( GEOSBufferWithStyle_r( geosinit.ctxt, mGeos, distance, segments, endCapStyle, joinStyle, miterLimit ) ); } CATCH_GEOS_WITH_ERRMSG( nullptr ); return fromGeos( geos.get() ); @@ -1851,7 +1851,7 @@ GEOSGeometry *QgsGeos::createGeosPolygon( const QgsAbstractGeometry *poly, doubl return geosPolygon; } -QgsAbstractGeometry *QgsGeos::offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg ) const +QgsAbstractGeometry *QgsGeos::offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg ) const { if ( !mGeos ) return nullptr; @@ -1859,7 +1859,7 @@ QgsAbstractGeometry *QgsGeos::offsetCurve( double distance, int segments, int jo GEOSGeometry *offset = nullptr; try { - offset = GEOSOffsetCurve_r( geosinit.ctxt, mGeos, distance, segments, joinStyle, mitreLimit ); + offset = GEOSOffsetCurve_r( geosinit.ctxt, mGeos, distance, segments, joinStyle, miterLimit ); } CATCH_GEOS_WITH_ERRMSG( nullptr ) QgsAbstractGeometry *offsetGeom = fromGeos( offset ); @@ -1867,7 +1867,7 @@ QgsAbstractGeometry *QgsGeos::offsetCurve( double distance, int segments, int jo return offsetGeom; } -QgsAbstractGeometry *QgsGeos::singleSidedBuffer( double distance, int segments, int side, int joinStyle, double mitreLimit, QString *errorMsg ) const +QgsAbstractGeometry *QgsGeos::singleSidedBuffer( double distance, int segments, int side, int joinStyle, double miterLimit, QString *errorMsg ) const { if ( !mGeos ) { @@ -1881,7 +1881,7 @@ QgsAbstractGeometry *QgsGeos::singleSidedBuffer( double distance, int segments, GEOSBufferParams_setSingleSided_r( geosinit.ctxt, bp, 1 ); GEOSBufferParams_setQuadrantSegments_r( geosinit.ctxt, bp, segments ); GEOSBufferParams_setJoinStyle_r( geosinit.ctxt, bp, joinStyle ); - GEOSBufferParams_setMitreLimit_r( geosinit.ctxt, bp, mitreLimit ); + GEOSBufferParams_setMitreLimit_r( geosinit.ctxt, bp, miterLimit ); //#spellok if ( side == 1 ) { diff --git a/src/core/geometry/qgsgeos.h b/src/core/geometry/qgsgeos.h index 4862235f603..c471acb0a56 100644 --- a/src/core/geometry/qgsgeos.h +++ b/src/core/geometry/qgsgeos.h @@ -75,7 +75,7 @@ class CORE_EXPORT QgsGeos: public QgsGeometryEngine QgsAbstractGeometry *combine( const QList< QgsAbstractGeometry *> &, QString *errorMsg = nullptr ) const override; QgsAbstractGeometry *symDifference( const QgsAbstractGeometry &geom, QString *errorMsg = nullptr ) const override; QgsAbstractGeometry *buffer( double distance, int segments, QString *errorMsg = nullptr ) const override; - QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg = nullptr ) const override; + QgsAbstractGeometry *buffer( double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const override; QgsAbstractGeometry *simplify( double tolerance, QString *errorMsg = nullptr ) const override; QgsAbstractGeometry *interpolate( double distance, QString *errorMsg = nullptr ) const override; QgsAbstractGeometry *envelope( QString *errorMsg = nullptr ) const override; @@ -112,7 +112,7 @@ class CORE_EXPORT QgsGeos: public QgsGeometryEngine QgsPointSequence &topologyTestPoints, QString *errorMsg = nullptr ) const override; - QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg = nullptr ) const override; + QgsAbstractGeometry *offsetCurve( double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const override; /** * Returns a single sided buffer for a geometry. The buffer is only @@ -120,15 +120,15 @@ class CORE_EXPORT QgsGeos: public QgsGeometryEngine * \param distance buffer distance * \param segments for round joins, number of segments to approximate quarter-circle * \param side side of geometry to buffer (0 = left, 1 = right) - * \param joinStyle join style for corners ( Round (1) / Mitre (2) / Bevel (3) ) - * \param mitreLimit limit on the mitre ratio used for very sharp corners + * \param joinStyle join style for corners ( Round (1) / Miter (2) / Bevel (3) ) + * \param miterLimit limit on the miter ratio used for very sharp corners * \param errorMsg error messages emitted, if any * \returns buffered geometry, or an nullptr if buffer could not be * calculated * \since QGIS 3.0 */ QgsAbstractGeometry *singleSidedBuffer( double distance, int segments, int side, - int joinStyle, double mitreLimit, + int joinStyle, double miterLimit, QString *errorMsg = nullptr ) const; diff --git a/src/core/processing/qgsnativealgorithms.cpp b/src/core/processing/qgsnativealgorithms.cpp index e2ea81fab03..dc9757d1d1e 100644 --- a/src/core/processing/qgsnativealgorithms.cpp +++ b/src/core/processing/qgsnativealgorithms.cpp @@ -112,7 +112,7 @@ void QgsBufferAlgorithm::initAlgorithm( const QVariantMap & ) addParameter( new QgsProcessingParameterEnum( QStringLiteral( "END_CAP_STYLE" ), QObject::tr( "End cap style" ), QStringList() << QObject::tr( "Round" ) << QObject::tr( "Flat" ) << QObject::tr( "Square" ), false ) ); addParameter( new QgsProcessingParameterEnum( QStringLiteral( "JOIN_STYLE" ), QObject::tr( "Join style" ), QStringList() << QObject::tr( "Round" ) << QObject::tr( "Miter" ) << QObject::tr( "Bevel" ), false ) ); - addParameter( new QgsProcessingParameterNumber( QStringLiteral( "MITRE_LIMIT" ), QObject::tr( "Miter limit" ), QgsProcessingParameterNumber::Double, 2, false, 1 ) ); + addParameter( new QgsProcessingParameterNumber( QStringLiteral( "MITER_LIMIT" ), QObject::tr( "Miter limit" ), QgsProcessingParameterNumber::Double, 2, false, 1 ) ); addParameter( new QgsProcessingParameterBoolean( QStringLiteral( "DISSOLVE" ), QObject::tr( "Dissolve result" ), false ) ); addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Buffered" ), QgsProcessing::TypeVectorPolygon ) ); @@ -123,8 +123,8 @@ QString QgsBufferAlgorithm::shortHelpString() const return QObject::tr( "This algorithm computes a buffer area for all the features in an input layer, using a fixed or dynamic distance.\n\n" "The segments parameter controls the number of line segments to use to approximate a quarter circle when creating rounded offsets.\n\n" "The end cap style parameter controls how line endings are handled in the buffer.\n\n" - "The join style parameter specifies whether round, mitre or beveled joins should be used when offsetting corners in a line.\n\n" - "The mitre limit parameter is only applicable for mitre join styles, and controls the maximum distance from the offset curve to use when creating a mitred join." ); + "The join style parameter specifies whether round, miter or beveled joins should be used when offsetting corners in a line.\n\n" + "The miter limit parameter is only applicable for miter join styles, and controls the maximum distance from the offset curve to use when creating a mitered join." ); } QgsBufferAlgorithm *QgsBufferAlgorithm::createInstance() const @@ -148,7 +148,7 @@ QVariantMap QgsBufferAlgorithm::processAlgorithm( const QVariantMap ¶meters, int segments = parameterAsInt( parameters, QStringLiteral( "SEGMENTS" ), context ); QgsGeometry::EndCapStyle endCapStyle = static_cast< QgsGeometry::EndCapStyle >( 1 + parameterAsInt( parameters, QStringLiteral( "END_CAP_STYLE" ), context ) ); QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle>( 1 + parameterAsInt( parameters, QStringLiteral( "JOIN_STYLE" ), context ) ); - double miterLimit = parameterAsDouble( parameters, QStringLiteral( "MITRE_LIMIT" ), context ); + double miterLimit = parameterAsDouble( parameters, QStringLiteral( "MITER_LIMIT" ), context ); double bufferDistance = parameterAsDouble( parameters, QStringLiteral( "DISTANCE" ), context ); bool dynamicBuffer = QgsProcessingParameters::isDynamic( parameters, QStringLiteral( "DISTANCE" ) ); const QgsProcessingParameterDefinition *distanceParamDef = parameterDefinition( QStringLiteral( "DISTANCE" ) ); diff --git a/src/core/symbology/qgssymbollayerutils.cpp b/src/core/symbology/qgssymbollayerutils.cpp index 7f3e62ceff9..9c0bfe4fec6 100644 --- a/src/core/symbology/qgssymbollayerutils.cpp +++ b/src/core/symbology/qgssymbollayerutils.cpp @@ -198,7 +198,7 @@ QString QgsSymbolLayerUtils::encodeSldLineJoinStyle( Qt::PenJoinStyle style ) case Qt::BevelJoin: return QStringLiteral( "bevel" ); case Qt::MiterJoin: - return QStringLiteral( "mitre" ); + return QStringLiteral( "mitre" ); //#spellok case Qt::RoundJoin: return QStringLiteral( "round" ); default: @@ -209,7 +209,7 @@ QString QgsSymbolLayerUtils::encodeSldLineJoinStyle( Qt::PenJoinStyle style ) Qt::PenJoinStyle QgsSymbolLayerUtils::decodeSldLineJoinStyle( const QString &str ) { if ( str == QLatin1String( "bevel" ) ) return Qt::BevelJoin; - if ( str == QLatin1String( "mitre" ) ) return Qt::MiterJoin; + if ( str == QLatin1String( "mitre" ) ) return Qt::MiterJoin; //#spellok if ( str == QLatin1String( "round" ) ) return Qt::RoundJoin; return Qt::BevelJoin; } @@ -764,14 +764,14 @@ QList offsetLine( QPolygonF polyline, double dist, QgsWkbTypes::Geome QgsGeometry tempGeometry = geometryType == QgsWkbTypes::PolygonGeometry ? QgsGeometry::fromPolygon( QgsPolygon() << tempPolyline ) : QgsGeometry::fromPolyline( tempPolyline ); if ( !tempGeometry.isNull() ) { - int quadSegments = 0; // we want mitre joins, not round joins - double mitreLimit = 2.0; // the default value in GEOS (5.0) allows for fairly sharp endings + int quadSegments = 0; // we want miter joins, not round joins + double miterLimit = 2.0; // the default value in GEOS (5.0) allows for fairly sharp endings QgsGeometry offsetGeom; if ( geometryType == QgsWkbTypes::PolygonGeometry ) offsetGeom = tempGeometry.buffer( -dist, quadSegments, QgsGeometry::CapFlat, - QgsGeometry::JoinStyleMitre, mitreLimit ); + QgsGeometry::JoinStyleMiter, miterLimit ); else - offsetGeom = tempGeometry.offsetCurve( dist, quadSegments, QgsGeometry::JoinStyleMitre, mitreLimit ); + offsetGeom = tempGeometry.offsetCurve( dist, quadSegments, QgsGeometry::JoinStyleMiter, miterLimit ); if ( !offsetGeom.isNull() ) { diff --git a/src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp b/src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp index 316e9cb03ca..579b623e550 100644 --- a/src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp +++ b/src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp @@ -67,7 +67,7 @@ void QgsGeometryGapCheck::collectErrors( QList &errors, // Buffer envelope geomEngine = QgsGeometryCheckerUtils::createGeomEngine( envelope, QgsGeometryCheckPrecision::tolerance() ); - QgsAbstractGeometry *bufEnvelope = geomEngine->buffer( 2, 0, GEOSBUF_CAP_SQUARE, GEOSBUF_JOIN_MITRE, 4. ); + QgsAbstractGeometry *bufEnvelope = geomEngine->buffer( 2, 0, GEOSBUF_CAP_SQUARE, GEOSBUF_JOIN_MITRE, 4. ); //#spellok //#spellok delete geomEngine; delete envelope; envelope = bufEnvelope; diff --git a/tests/code_layout/acceptable_missing_doc.py b/tests/code_layout/acceptable_missing_doc.py index b53c740e796..58addb984df 100644 --- a/tests/code_layout/acceptable_missing_doc.py +++ b/tests/code_layout/acceptable_missing_doc.py @@ -436,7 +436,7 @@ ACCEPTABLE_MISSING_DOCS = { "QgsExpression::NodeList": ["dump() const ", "count()", "list()"], "QgsComposerAttributeTableV2": ["QgsComposerAttributeTableV2(QgsComposition *composition, bool createUndoCommands)"], "QgsMapLayerLegend": ["QgsMapLayerLegend(QObject *parent=0)"], - "QgsGeometryEngine": ["buffer(double distance, int segments, QString *errorMsg=nullptr) const =0", "contains(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "prepareGeometry()=0", "length(QString *errorMsg=nullptr) const =0", "splitGeometry(const QgsLineString &splitLine, QList< QgsAbstractGeometry * > &newGeometries, bool topological, QgsPointSequence &topologyTestPoints, QString *errorMsg=nullptr) const ", "within(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "geometryChanged()=0", "overlaps(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "interpolate(double distance, QString *errorMsg=nullptr) const =0", "intersection(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "centroid(QgsPoint &pt, QString *errorMsg=nullptr) const =0", "simplify(double tolerance, QString *errorMsg=nullptr) const =0", "QgsGeometryEngine(const QgsAbstractGeometry *geometry)", "isValid(QString *errorMsg=nullptr) const =0", "area(QString *errorMsg=nullptr) const =0", "combine(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "combine(const QList< QgsAbstractGeometry * > &, QString *errorMsg=nullptr) const =0", "isEmpty(QString *errorMsg) const =0", "envelope(QString *errorMsg=nullptr) const =0", "touches(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "distance(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "disjoint(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "convexHull(QString *errorMsg=nullptr) const =0", "offsetCurve(double distance, int segments, int joinStyle, double mitreLimit, QString *errorMsg=nullptr) const =0", "buffer(double distance, int segments, int endCapStyle, int joinStyle, double mitreLimit, QString *errorMsg=nullptr) const =0", "pointOnSurface(QgsPoint &pt, QString *errorMsg=nullptr) const =0", "intersects(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "difference(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "symDifference(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "isEqual(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "crosses(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0"], + "QgsGeometryEngine": ["buffer(double distance, int segments, QString *errorMsg=nullptr) const =0", "contains(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "prepareGeometry()=0", "length(QString *errorMsg=nullptr) const =0", "splitGeometry(const QgsLineString &splitLine, QList< QgsAbstractGeometry * > &newGeometries, bool topological, QgsPointSequence &topologyTestPoints, QString *errorMsg=nullptr) const ", "within(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "geometryChanged()=0", "overlaps(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "interpolate(double distance, QString *errorMsg=nullptr) const =0", "intersection(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "centroid(QgsPoint &pt, QString *errorMsg=nullptr) const =0", "simplify(double tolerance, QString *errorMsg=nullptr) const =0", "QgsGeometryEngine(const QgsAbstractGeometry *geometry)", "isValid(QString *errorMsg=nullptr) const =0", "area(QString *errorMsg=nullptr) const =0", "combine(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "combine(const QList< QgsAbstractGeometry * > &, QString *errorMsg=nullptr) const =0", "isEmpty(QString *errorMsg) const =0", "envelope(QString *errorMsg=nullptr) const =0", "touches(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "distance(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "disjoint(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "convexHull(QString *errorMsg=nullptr) const =0", "offsetCurve(double distance, int segments, int joinStyle, double miterLimit, QString *errorMsg=nullptr) const =0", "buffer(double distance, int segments, int endCapStyle, int joinStyle, double miterLimit, QString *errorMsg=nullptr) const =0", "pointOnSurface(QgsPoint &pt, QString *errorMsg=nullptr) const =0", "intersects(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "difference(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "symDifference(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "isEqual(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0", "crosses(const QgsAbstractGeometry &geom, QString *errorMsg=nullptr) const =0"], "QgsMapToolAdvancedDigitizing": ["cadDockWidget() const "], "QgsCptCityBrowserModel": ["findItem(QgsCptCityDataItem *item, QgsCptCityDataItem *parent=nullptr) const ", "QgsCptCityBrowserModel(QObject *parent=nullptr, QgsCptCityArchive *archive=QgsCptCityArchive::defaultArchive(), ViewType Type=Authors)", "endInsertItems()", "reload()", "beginInsertItems(QgsCptCityDataItem *parent, int first, int last)", "addRootItems()", "connectItem(QgsCptCityDataItem *item)", "refresh(const QString &path)", "beginRemoveItems(QgsCptCityDataItem *parent, int first, int last)", "endRemoveItems()", "refresh(const QModelIndex &index=QModelIndex())", "ViewType", "removeRootItems()"], "QgsComposerPicture": ["QgsComposerPicture(QgsComposition *composition)"], diff --git a/tests/src/core/testqgsexpression.cpp b/tests/src/core/testqgsexpression.cpp index a3f3d3cfc57..206ca37e8c4 100644 --- a/tests/src/core/testqgsexpression.cpp +++ b/tests/src/core/testqgsexpression.cpp @@ -705,13 +705,13 @@ class TestQgsExpression: public QObject QTest::newRow( "offset_curve null" ) << "offset_curve(NULL, 5)" << false << QVariant(); QTest::newRow( "offset_curve point" ) << "offset_curve(geom_from_wkt('POINT(1 2)'),5)" << false << QVariant(); QTest::newRow( "offset_curve line" ) << "geom_to_wkt(offset_curve(geom_from_wkt('LineString(0 0, 10 0)'),1,segments:=4))" << false << QVariant( "LineString (0 1, 10 1)" ); - QTest::newRow( "offset_curve line mitre" ) << "geom_to_wkt(offset_curve(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=-1,join:=2,mitre_limit:=1))" << false << QVariant( "LineString (10 -1, 0 -1)" ); + QTest::newRow( "offset_curve line miter" ) << "geom_to_wkt(offset_curve(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=-1,join:=2,miter_limit:=1))" << false << QVariant( "LineString (10 -1, 0 -1)" ); QTest::newRow( "offset_curve line bevel" ) << "geom_to_wkt(offset_curve(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),distance:=1,join:=3))" << false << QVariant( "LineString (0 1, 9 1, 9 10)" ); QTest::newRow( "single_sided_buffer not geom" ) << "single_sided_buffer('g', 5)" << true << QVariant(); QTest::newRow( "single_sided_buffer null" ) << "single_sided_buffer(NULL, 5)" << false << QVariant(); QTest::newRow( "single_sided_buffer point" ) << "single_sided_buffer(geom_from_wkt('POINT(1 2)'),5)" << false << QVariant(); QTest::newRow( "single_sided_buffer line" ) << "geom_to_wkt(single_sided_buffer(geom_from_wkt('LineString(0 0, 10 0)'),1,segments:=4))" << false << QVariant( "Polygon ((10 0, 0 0, 0 1, 10 1, 10 0))" ); - QTest::newRow( "single_sided_buffer line mitre" ) << "geom_to_wkt(single_sided_buffer(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=-1,join:=2,mitre_limit:=1))" << false << QVariant( "Polygon ((0 0, 10 0, 10 -1, 0 -1, 0 0))" ); + QTest::newRow( "single_sided_buffer line miter" ) << "geom_to_wkt(single_sided_buffer(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=-1,join:=2,miter_limit:=1))" << false << QVariant( "Polygon ((0 0, 10 0, 10 -1, 0 -1, 0 0))" ); QTest::newRow( "single_sided_buffer line bevel" ) << "geom_to_wkt(single_sided_buffer(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),distance:=1,join:=3))" << false << QVariant( "Polygon ((10 10, 10 0, 0 0, 0 1, 9 1, 9 10, 10 10))" ); QTest::newRow( "extend not geom" ) << "extend('g', 1, 2)" << true << QVariant(); QTest::newRow( "extend null" ) << "extend(NULL, 1, 2)" << false << QVariant(); diff --git a/tests/src/python/test_qgsgeometry.py b/tests/src/python/test_qgsgeometry.py index 0ac06e945a1..6065c1f7c0a 100644 --- a/tests/src/python/test_qgsgeometry.py +++ b/tests/src/python/test_qgsgeometry.py @@ -3381,7 +3381,7 @@ class TestQgsGeometry(unittest.TestCase): wkt = "LineString( 0 0, 10 0, 10 10)" geom = QgsGeometry.fromWkt(wkt) - out = geom.singleSidedBuffer(1, 8, QgsGeometry.SideRight, QgsGeometry.JoinStyleMitre) + out = geom.singleSidedBuffer(1, 8, QgsGeometry.SideRight, QgsGeometry.JoinStyleMiter) result = out.exportToWkt() expected_wkt = "Polygon ((0 0, 10 0, 10 10, 11 10, 11 -1, 0 -1, 0 0))" self.assertTrue(compareWkt(result, expected_wkt, 0.00001), "Merge lines: mismatch Expected:\n{}\nGot:\n{}\n".format(expected_wkt, result))