Skip to content
Permalink
Browse files

Merge pull request #4996 from nyalldawson/spelling_and_stuff

Fix some spelling, add parameter names to tooltips in processing
  • Loading branch information
nyalldawson committed Aug 7, 2017
2 parents 0409da3 + 4ab4a1f commit f802c565739fc5922a9f92bb7e5d1514861701da
Showing with 178 additions and 170 deletions.
  1. +7 −7 python/core/geometry/qgsgeometry.sip
  2. +2 −2 python/core/geometry/qgsgeometryengine.sip
  3. +1 −1 python/core/symbology/qgssinglesymbolrenderer.sip
  4. +6 −6 python/plugins/processing/algs/help/qgis.yaml
  5. +3 −3 python/plugins/processing/algs/qgis/Buffer.py
  6. +5 −5 python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
  7. +5 −5 python/plugins/processing/algs/qgis/OffsetLine.py
  8. +5 −5 python/plugins/processing/algs/qgis/SingleSidedBuffer.py
  9. +5 −5 python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
  10. +1 −1 python/plugins/processing/core/parameters.py
  11. +7 −1 python/plugins/processing/gui/ParametersPanel.py
  12. +0 −1 python/plugins/processing/gui/wrappers.py
  13. +2 −2 python/plugins/processing/tests/testdata/expected/{buffer_polys_mitre.gfs → buffer_polys_miter.gfs}
  14. +12 −12 python/plugins/processing/tests/testdata/expected/{buffer_polys_mitre.gml → buffer_polys_miter.gml}
  15. +2 −2 python/plugins/processing/tests/testdata/expected/{line_offset_mitre.gfs → line_offset_miter.gfs}
  16. +14 −14 python/plugins/processing/tests/testdata/expected/{line_offset_mitre.gml → line_offset_miter.gml}
  17. +2 −2 ...tests/testdata/expected/{single_sided_buffer_line_mitre.gfs → single_sided_buffer_line_miter.gfs}
  18. +14 −14 ...tests/testdata/expected/{single_sided_buffer_line_mitre.gml → single_sided_buffer_line_miter.gml}
  19. +19 −19 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
  20. +2 −2 resources/function_help/json/offset_curve
  21. +2 −2 resources/function_help/json/single_sided_buffer
  22. +1 −0 scripts/spell_check/.agignore
  23. +2 −0 scripts/spell_check/spelling.dat
  24. +1 −1 src/analysis/vector/qgsgeometryanalyzer.cpp
  25. +2 −2 src/app/qgsmaptooloffsetcurve.cpp
  26. +1 −1 src/app/qgsoptions.cpp
  27. +4 −4 src/core/dxf/qgsdxfexport.cpp
  28. +6 −6 src/core/expression/qgsexpressionfunction.cpp
  29. +8 −8 src/core/geometry/qgsgeometry.cpp
  30. +7 −7 src/core/geometry/qgsgeometry.h
  31. +2 −2 src/core/geometry/qgsgeometryengine.h
  32. +6 −6 src/core/geometry/qgsgeos.cpp
  33. +5 −5 src/core/geometry/qgsgeos.h
  34. +4 −4 src/core/processing/qgsnativealgorithms.cpp
  35. +1 −1 src/core/symbology/qgssinglesymbolrenderer.h
  36. +6 −6 src/core/symbology/qgssymbollayerutils.cpp
  37. +1 −1 src/plugins/geometry_checker/checks/qgsgeometrygapcheck.cpp
  38. +1 −1 src/plugins/grass/qgsgrassnewmapset.h
  39. +1 −1 tests/code_layout/acceptable_missing_doc.py
  40. +2 −2 tests/src/core/testqgsexpression.cpp
  41. +1 −1 tests/src/python/test_qgsgeometry.py
@@ -618,7 +618,7 @@ Test for containment of a point (uses GEOS)
enum JoinStyle
{
JoinStyleRound,
JoinStyleMitre,
JoinStyleMiter,
JoinStyleBevel,
};

@@ -629,40 +629,40 @@ 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.
\param distance buffer distance
\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
@@ -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
@@ -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.
@@ -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.
@@ -32,7 +32,7 @@


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)
@@ -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 @@ def initAlgorithm(self, config=None):
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 @@ def processAlgorithm(self, parameters, context, feedback):
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())
@@ -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 @@ def initParameters(self, config=None):
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 @@ def prepareAlgorithm(self, parameters, context, feedback):
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):
@@ -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 @@ def __init__(self):
self.sides = [self.tr('Left'),
'Right']
self.join_styles = [self.tr('Round'),
'Mitre',
'Miter',
'Bevel']

def initParameters(self, config=None):
@@ -74,8 +74,8 @@ def initParameters(self, config=None):
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 @@ def prepareAlgorithm(self, parameters, context, feedback):
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):
@@ -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 @@ def initAlgorithm(self, config=None):
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 @@ def processAlgorithm(self, parameters, context, feedback):
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)

@@ -190,7 +190,7 @@ def setMinNumInputs(self, _minNumInputs):
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)
@@ -83,6 +83,10 @@ def layerRegistryChanged(self, layers):
for wrapper in list(self.wrappers.values()):
wrapper.refresh()

def formatParameterTooltip(self, parameter):
return '<p><b>{}</b></p><p>{}</p>'.format(parameter.description(),
self.tr('Python identifier: ‘{}’').format('<i>{}</i>'.format(parameter.name())))

def initWidgets(self):
# If there are advanced parameters — show corresponding groupbox
for param in self.alg.parameterDefinitions():
@@ -127,7 +131,7 @@ def initWidgets(self):
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 @@ def initWidgets(self):
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()):
@@ -1357,7 +1357,6 @@ def create_wrapper_from_metadata(param, dialog, row=0, col=0):

@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
@@ -1,7 +1,7 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>buffer_polys_mitre</Name>
<ElementPath>buffer_polys_mitre</ElementPath>
<Name>buffer_polys_miter</Name>
<ElementPath>buffer_polys_miter</ElementPath>
<GeometryType>3</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>

0 comments on commit f802c56

Please sign in to comment.
You can’t perform that action at this time.