Skip to content

Commit

Permalink
Spell check 'mitre' -> 'miter' (i.e. use en-us variation)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 7, 2017
1 parent 75a372c commit 4ab4a1f
Show file tree
Hide file tree
Showing 35 changed files with 166 additions and 164 deletions.
14 changes: 7 additions & 7 deletions python/core/geometry/qgsgeometry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ Test for containment of a point (uses GEOS)
enum JoinStyle
{
JoinStyleRound,
JoinStyleMitre,
JoinStyleMiter,
JoinStyleBevel,
};

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/core/geometry/qgsgeometryengine.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions python/plugins/processing/algs/help/qgis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/Buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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))

Expand All @@ -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())
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/qgis/OffsetLine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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):
Expand All @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/qgis/SingleSidedBuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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):
Expand All @@ -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'
Expand All @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/qgis/VariableDistanceBuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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))
Expand All @@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,47 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.0">
<ogr:buffer_polys_miter fid="polys.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-2,-2 -2,4 4,4 4,1 3,1 3,-2 -2,-2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>aaaaa</ogr:name>
<ogr:intval>33</ogr:intval>
<ogr:floatval>44.123456</ogr:floatval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.1">
<ogr:buffer_polys_miter fid="polys.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.0,6.414213562373096 7.93754927857421,3.451405886594554 7.757968851470933,3.017860383945075 2.242031148529061,3.017860383945087 2.062450721425788,3.451405886594566 5.0,6.414213562373096</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>Aaaaa</ogr:name>
<ogr:intval>-33</ogr:intval>
<ogr:floatval>0</ogr:floatval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.2">
<ogr:buffer_polys_miter fid="polys.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,4 1,7 4,7 4,4 1,4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>bbaaa</ogr:name>
<ogr:floatval>0.123</ogr:floatval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.3">
<ogr:buffer_polys_miter fid="polys.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 11,2 11,-4 5,-4 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>ASDF</ogr:name>
<ogr:intval>0</ogr:intval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.4">
<ogr:buffer_polys_miter fid="polys.4">
<ogr:intval>120</ogr:intval>
<ogr:floatval>-100291.43213</ogr:floatval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
<gml:featureMember>
<ogr:buffer_polys_mitre fid="polys.5">
<ogr:buffer_polys_miter fid="polys.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.162277660168381,3.0 7.0,1.720759220056127 7.0,-4.618033988749896 1.0,-1.618033988749894 1,3 3.162277660168381,3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>elim</ogr:name>
<ogr:intval>2</ogr:intval>
<ogr:floatval>3.33</ogr:floatval>
</ogr:buffer_polys_mitre>
</ogr:buffer_polys_miter>
</gml:featureMember>
</ogr:FeatureCollection>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>line_offset_mitre</Name>
<ElementPath>line_offset_mitre</ElementPath>
<Name>line_offset_miter</Name>
<ElementPath>line_offset_miter</ElementPath>
<GeometryType>2</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
Expand Down
Loading

0 comments on commit 4ab4a1f

Please sign in to comment.