mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[processing] Expose buffer settings (cap/join style/mitre limit)
Also make fixed distance buffer correctly handle null geometries (copy the row as a geometryless row)
This commit is contained in:
parent
0a2b661ecb
commit
5025c828e5
@ -167,6 +167,14 @@ qgis:fieldcalculator: >
|
||||
qgis:fixeddistancebuffer: >
|
||||
This algorithm computes a buffer area for all the features in an input layer, using a fixed distance.
|
||||
|
||||
The segments parameter controls the number of line segments to use to approximate a quarter circle when creating rounded offsets.
|
||||
|
||||
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 offseting 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.
|
||||
|
||||
qgis:frequencyanalysis: >
|
||||
This algorithms generates a table with frequency analysis of the values of a selected attribute from an input vector layer
|
||||
|
||||
|
@ -32,15 +32,12 @@ from processing.tools import vector
|
||||
|
||||
|
||||
def buffering(progress, writer, distance, field, useField, layer, dissolve,
|
||||
segments):
|
||||
segments, endCapStyle=1, joinStyle=1, mitreLimit=2):
|
||||
|
||||
if useField:
|
||||
field = layer.fieldNameIndex(field)
|
||||
|
||||
outFeat = QgsFeature()
|
||||
inFeat = QgsFeature()
|
||||
inGeom = QgsGeometry()
|
||||
outGeom = QgsGeometry()
|
||||
|
||||
current = 0
|
||||
features = vector.features(layer)
|
||||
@ -49,6 +46,7 @@ def buffering(progress, writer, distance, field, useField, layer, dissolve,
|
||||
# With dissolve
|
||||
if dissolve:
|
||||
first = True
|
||||
buffered_geometries = []
|
||||
for inFeat in features:
|
||||
attrs = inFeat.attributes()
|
||||
if useField:
|
||||
@ -57,23 +55,19 @@ def buffering(progress, writer, distance, field, useField, layer, dissolve,
|
||||
value = distance
|
||||
|
||||
inGeom = inFeat.geometry()
|
||||
if inGeom.isEmpty() or inGeom.isGeosEmpty():
|
||||
if not inGeom:
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, 'Feature {} has empty geometry. Skipping...'.format(inFeat.id()))
|
||||
continue
|
||||
if not inGeom.isGeosValid():
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, 'Feature {} has invalid geometry. Skipping...'.format(inFeat.id()))
|
||||
continue
|
||||
outGeom = inGeom.buffer(float(value), segments)
|
||||
if first:
|
||||
tempGeom = QgsGeometry(outGeom)
|
||||
first = False
|
||||
else:
|
||||
tempGeom = tempGeom.combine(outGeom)
|
||||
buffered_geometries.append(inGeom.buffer(float(value), segments, endCapStyle, joinStyle, mitreLimit))
|
||||
|
||||
current += 1
|
||||
progress.setPercentage(int(current * total))
|
||||
|
||||
outFeat.setGeometry(tempGeom)
|
||||
final_geometry = QgsGeometry.unaryUnion(buffered_geometries)
|
||||
outFeat.setGeometry(final_geometry)
|
||||
outFeat.setAttributes(attrs)
|
||||
writer.addFeature(outFeat)
|
||||
else:
|
||||
@ -85,15 +79,15 @@ def buffering(progress, writer, distance, field, useField, layer, dissolve,
|
||||
else:
|
||||
value = distance
|
||||
inGeom = inFeat.geometry()
|
||||
outFeat = QgsFeature()
|
||||
if inGeom.isEmpty() or inGeom.isGeosEmpty():
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, 'Feature {} has empty geometry. Skipping...'.format(inFeat.id()))
|
||||
continue
|
||||
if not inGeom.isGeosValid():
|
||||
pass
|
||||
elif not inGeom.isGeosValid():
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING, 'Feature {} has invalid geometry. Skipping...'.format(inFeat.id()))
|
||||
continue
|
||||
|
||||
outGeom = inGeom.buffer(float(value), segments)
|
||||
outFeat.setGeometry(outGeom)
|
||||
else:
|
||||
outGeom = inGeom.buffer(float(value), segments, endCapStyle, joinStyle, mitreLimit)
|
||||
outFeat.setGeometry(outGeom)
|
||||
outFeat.setAttributes(attrs)
|
||||
writer.addFeature(outFeat)
|
||||
current += 1
|
||||
|
@ -35,6 +35,8 @@ from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.parameters import ParameterVector
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterNumber
|
||||
from processing.core.parameters import ParameterSelection
|
||||
|
||||
from processing.core.outputs import OutputVector
|
||||
from . import Buffer as buff
|
||||
from processing.tools import dataobjects
|
||||
@ -50,6 +52,9 @@ class FixedDistanceBuffer(GeoAlgorithm):
|
||||
DISTANCE = 'DISTANCE'
|
||||
SEGMENTS = 'SEGMENTS'
|
||||
DISSOLVE = 'DISSOLVE'
|
||||
END_CAP_STYLE = 'END_CAP_STYLE'
|
||||
JOIN_STYLE = 'JOIN_STYLE'
|
||||
MITRE_LIMIT = 'MITRE_LIMIT'
|
||||
|
||||
def getIcon(self):
|
||||
return QIcon(os.path.join(pluginPath, 'images', 'ftools', 'buffer.png'))
|
||||
@ -65,6 +70,22 @@ class FixedDistanceBuffer(GeoAlgorithm):
|
||||
self.tr('Segments'), 1, default=5))
|
||||
self.addParameter(ParameterBoolean(self.DISSOLVE,
|
||||
self.tr('Dissolve result'), False))
|
||||
self.end_cap_styles = [self.tr('Round'),
|
||||
'Flat',
|
||||
'Square']
|
||||
self.addParameter(ParameterSelection(
|
||||
self.END_CAP_STYLE,
|
||||
self.tr('End cap style'),
|
||||
self.end_cap_styles, default=0))
|
||||
self.join_styles = [self.tr('Round'),
|
||||
'Mitre',
|
||||
'Bevel']
|
||||
self.addParameter(ParameterSelection(
|
||||
self.JOIN_STYLE,
|
||||
self.tr('Join style'),
|
||||
self.join_styles, default=0))
|
||||
self.addParameter(ParameterNumber(self.MITRE_LIMIT,
|
||||
self.tr('Mitre limit'), 1, default=2))
|
||||
|
||||
self.addOutput(OutputVector(self.OUTPUT, self.tr('Buffer')))
|
||||
|
||||
@ -73,10 +94,13 @@ class FixedDistanceBuffer(GeoAlgorithm):
|
||||
distance = self.getParameterValue(self.DISTANCE)
|
||||
dissolve = self.getParameterValue(self.DISSOLVE)
|
||||
segments = int(self.getParameterValue(self.SEGMENTS))
|
||||
end_cap_style = self.getParameterValue(self.END_CAP_STYLE) + 1
|
||||
join_style = self.getParameterValue(self.JOIN_STYLE) + 1
|
||||
miter_limit = self.getParameterValue(self.MITRE_LIMIT)
|
||||
|
||||
writer = self.getOutputFromName(
|
||||
self.OUTPUT).getVectorWriter(layer.fields().toList(),
|
||||
QgsWkbTypes.Polygon, layer.crs())
|
||||
|
||||
buff.buffering(progress, writer, distance, None, False, layer,
|
||||
dissolve, segments)
|
||||
dissolve, segments, end_cap_style, join_style, miter_limit)
|
||||
|
48
python/plugins/processing/tests/testdata/expected/buffer_lines.gml
vendored
Normal file
48
python/plugins/processing/tests/testdata/expected/buffer_lines.gml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ buffer_lines.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-2</gml:X><gml:Y>-4</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>11.98768834059514</gml:X><gml:Y>5.987688340595138</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8,3 8.034074173710932,3.258819045102521 8.133974596215561,3.5 8.292893218813452,3.707106781186547 10.292893218813452,5.707106781186548 10.546009500260457,5.891006524188368 10.843565534959772,5.987688340595138 11.156434465040231,5.987688340595137 11.453990499739549,5.891006524188367 11.707106781186548,5.707106781186548 11.891006524188368,5.453990499739547 11.987688340595138,5.156434465040232 11.987688340595138,4.843565534959771 11.891006524188368,4.546009500260455 11.70710678118655,4.292893218813454 10.0,2.585786437626905 10,2 9.951056516295154,1.690983005625053 9.809016994374948,1.412214747707527 9.587785252292472,1.190983005625053 9.309016994374948,1.048943483704846 9,1 6,1 5.690983005625051,1.048943483704847 5.412214747707526,1.190983005625053 5.190983005625052,1.412214747707528 5.048943483704846,1.690983005625053 5,2 5.048943483704846,2.309016994374947 5.190983005625052,2.587785252292472 5.412214747707526,2.809016994374947 5.690983005625051,2.951056516295153 6,3 8,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,0 1.309016994374949,-0.048943483704847 1.587785252292474,-0.190983005625053 1.809016994374948,-0.412214747707527 1.951056516295154,-0.690983005625053 2,-1 1.951056516295154,-1.309016994374947 1.809016994374948,-1.587785252292472 1.587785252292474,-1.809016994374947 1.309016994374949,-1.951056516295153 1,-2 -1,-2 -1.309016994374949,-1.951056516295153 -1.587785252292474,-1.809016994374947 -1.809016994374948,-1.587785252292472 -1.951056516295154,-1.309016994374947 -2,-1 -1.951056516295154,-0.690983005625053 -1.809016994374948,-0.412214747707528 -1.587785252292474,-0.190983005625053 -1.309016994374949,-0.048943483704847 -1,0 1,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,2 1.048943483704846,2.309016994374947 1.190983005625053,2.587785252292473 1.412214747707527,2.809016994374947 1.690983005625053,2.951056516295154 2,3 2.048943483704847,3.309016994374949 2.190983005625053,3.587785252292474 2.412214747707528,3.809016994374948 2.690983005625053,3.951056516295154 3,4 3.309016994374947,3.951056516295154 3.587785252292472,3.809016994374948 3.809016994374947,3.587785252292474 3.951056516295153,3.309016994374949 4,3 4,2 3.951056516295154,1.690983005625053 3.809016994374947,1.412214747707527 3.587785252292473,1.190983005625053 3.309016994374947,1.048943483704846 3,1 3,0 2.951056516295153,-0.309016994374949 2.809016994374947,-0.587785252292474 2.587785252292472,-0.809016994374948 2.309016994374947,-0.951056516295154 2,-1 1.690983005625053,-0.951056516295154 1.412214747707528,-0.809016994374948 1.190983005625054,-0.587785252292475 1.048943483704847,-0.309016994374949 1,0 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 5.309016994374948,1.951056516295153 5.587785252292474,1.809016994374947 5.809016994374947,1.587785252292473 5.951056516295154,1.309016994374947 6,1 5.951056516295154,0.690983005625053 5.809016994374948,0.412214747707528 5.587785252292474,0.190983005625054 5.309016994374949,0.048943483704847 5,0 3,0 2.690983005625051,0.048943483704847 2.412214747707526,0.190983005625053 2.190983005625052,0.412214747707528 2.048943483704846,0.690983005625053 2,1 2.048943483704846,1.309016994374947 2.190983005625052,1.587785252292472 2.412214747707526,1.809016994374947 2.690983005625051,1.951056516295153 3,2 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.4">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10,-2 10.309016994374948,-2.048943483704847 10.587785252292472,-2.190983005625053 10.809016994374948,-2.412214747707528 10.951056516295154,-2.690983005625053 11,-3 10.951056516295154,-3.309016994374947 10.809016994374948,-3.587785252292472 10.587785252292475,-3.809016994374947 10.30901699437495,-3.951056516295153 10,-4 7,-4 6.690983005625051,-3.951056516295153 6.412214747707526,-3.809016994374947 6.190983005625052,-3.587785252292472 6.048943483704846,-3.309016994374947 6,-3 6.048943483704846,-2.690983005625053 6.190983005625052,-2.412214747707528 6.412214747707526,-2.190983005625053 6.690983005625051,-2.048943483704847 7,-2 10,-2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>9.292893218813452,1.707106781186547 9.546009500260457,1.891006524188368 9.843565534959772,1.987688340595138 10.156434465040231,1.987688340595138 10.453990499739549,1.891006524188368 10.707106781186548,1.707106781186547 10.891006524188368,1.453990499739547 10.987688340595138,1.156434465040232 10.987688340595138,0.84356553495977 10.891006524188368,0.546009500260455 10.70710678118655,0.292893218813454 6.707106781186548,-3.707106781186547 6.453990499739546,-3.891006524188368 6.15643446504023,-3.987688340595138 5.843565534959769,-3.987688340595138 5.546009500260453,-3.891006524188368 5.292893218813452,-3.707106781186547 5.108993475811633,-3.453990499739548 5.012311659404863,-3.156434465040232 5.012311659404862,-2.843565534959771 5.108993475811631,-2.546009500260455 5.29289321881345,-2.292893218813454 9.292893218813452,1.707106781186547</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines fid="lines.6">
|
||||
</ogr:buffer_lines>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
23
python/plugins/processing/tests/testdata/expected/buffer_lines.xsd
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/buffer_lines.xsd
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="buffer_lines" type="ogr:buffer_lines_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="buffer_lines_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
48
python/plugins/processing/tests/testdata/expected/buffer_lines_flat.gml
vendored
Normal file
48
python/plugins/processing/tests/testdata/expected/buffer_lines_flat.gml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ buffer_lines_flat.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-1</gml:X><gml:Y>-4</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>11.70710678118655</gml:X><gml:Y>5.707106781186548</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8,3 8.034074173710932,3.258819045102521 8.133974596215561,3.5 8.292893218813452,3.707106781186547 10.292893218813452,5.707106781186548 11.707106781186548,4.292893218813452 10.0,2.585786437626905 10,2 9.951056516295154,1.690983005625053 9.809016994374948,1.412214747707527 9.587785252292472,1.190983005625053 9.309016994374948,1.048943483704846 9,1 6,1 6,3 8,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,0 1,-2 -1,-2 -1,0 1,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,2 1.048943483704846,2.309016994374947 1.190983005625053,2.587785252292473 1.412214747707527,2.809016994374947 1.690983005625053,2.951056516295154 2,3 4,3 4,2 3.951056516295154,1.690983005625053 3.809016994374947,1.412214747707527 3.587785252292473,1.190983005625053 3.309016994374947,1.048943483704846 3,1 3,0 1,0 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 5,0 3,0 3,2 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.4">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10,-2 10,-4 7,-4 7,-2 10,-2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>9.292893218813452,1.707106781186547 10.707106781186548,0.292893218813453 6.707106781186548,-3.707106781186547 5.292893218813452,-2.292893218813453 9.292893218813452,1.707106781186547</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_flat fid="lines.6">
|
||||
</ogr:buffer_lines_flat>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
23
python/plugins/processing/tests/testdata/expected/buffer_lines_flat.xsd
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/buffer_lines_flat.xsd
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="buffer_lines_flat" type="ogr:buffer_lines_flat_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="buffer_lines_flat_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
48
python/plugins/processing/tests/testdata/expected/buffer_lines_square.gml
vendored
Normal file
48
python/plugins/processing/tests/testdata/expected/buffer_lines_square.gml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ buffer_lines_square.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-2</gml:X><gml:Y>-4.414213562373095</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>12.4142135623731</gml:X><gml:Y>6.414213562373096</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8,3 8.034074173710932,3.258819045102521 8.133974596215561,3.5 8.292893218813452,3.707106781186547 10.292893218813452,5.707106781186548 11.0,6.414213562373096 12.414213562373096,5.0 10.0,2.585786437626905 10,2 9.951056516295154,1.690983005625053 9.809016994374948,1.412214747707527 9.587785252292472,1.190983005625053 9.309016994374948,1.048943483704846 9,1 6,1 5,1 5,3 8,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,0 2,0 2,-2 -1,-2 -2,-2 -2,0 1,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,2 1.048943483704846,2.309016994374947 1.190983005625053,2.587785252292473 1.412214747707527,2.809016994374947 1.690983005625053,2.951056516295154 2,3 2,4 4,4 4,2 3.951056516295154,1.690983005625053 3.809016994374947,1.412214747707527 3.587785252292473,1.190983005625053 3.309016994374947,1.048943483704846 3,1 3,0 3,-1 1,-1 1,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,2 6,2 6,0 3,0 2,0 2,2 5,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.4">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10,-2 11,-2 11,-4 7,-4 6,-4 6,-2 10,-2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>9.292893218813452,1.707106781186547 10.0,2.414213562373095 11.414213562373096,1.0 6.707106781186548,-3.707106781186547 6.0,-4.414213562373095 4.585786437626904,-3.0 9.292893218813452,1.707106781186547</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_lines_square fid="lines.6">
|
||||
</ogr:buffer_lines_square>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
23
python/plugins/processing/tests/testdata/expected/buffer_lines_square.xsd
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/buffer_lines_square.xsd
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="buffer_lines_square" type="ogr:buffer_lines_square_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="buffer_lines_square_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
@ -6,14 +6,14 @@
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-1.5</gml:X><gml:Y>-3.5</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>10.5</gml:X><gml:Y>6.5</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>-2</gml:X><gml:Y>-4</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>11</gml:X><gml:Y>7</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1.0,-1.5 -1.154508497187476,-1.475528258147576 -1.293892626146238,-1.404508497187473 -1.404508497187475,-1.293892626146235 -1.475528258147577,-1.154508497187473 -1.5,-1.0 -1.5,3.0 -1.475528258147577,3.154508497187474 -1.404508497187474,3.293892626146237 -1.293892626146237,3.404508497187474 -1.154508497187474,3.475528258147577 -1.0,3.5 3.0,3.5 3.154508497187474,3.475528258147577 3.293892626146237,3.404508497187474 3.404508497187474,3.293892626146237 3.475528258147577,3.154508497187474 3.5,3.0 3.5,2.0 3.475528258147577,1.845491502812526 3.404508497187474,1.706107373853763 3.293892626146237,1.595491502812526 3.154508497187474,1.524471741852423 3.0,1.5 2.5,1.5 2.5,-1.0 2.475528258147577,-1.154508497187474 2.404508497187474,-1.293892626146237 2.293892626146237,-1.404508497187474 2.154508497187474,-1.475528258147577 2.0,-1.5 -1.0,-1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-2 -1.309016994374953,-1.951056516295152 -1.587785252292476,-1.809016994374945 -1.809016994374949,-1.587785252292471 -1.951056516295154,-1.309016994374946 -2,-1 -2,3 -1.951056516295154,3.309016994374947 -1.809016994374947,3.587785252292473 -1.587785252292473,3.809016994374947 -1.309016994374947,3.951056516295154 -1,4 3,4 3.309016994374947,3.951056516295154 3.587785252292473,3.809016994374947 3.809016994374947,3.587785252292473 3.951056516295154,3.309016994374947 4,3 4,2 3.951056516295154,1.690983005625053 3.809016994374947,1.412214747707527 3.587785252292473,1.190983005625053 3.309016994374947,1.048943483704846 3,1 3,-1 2.951056516295154,-1.309016994374947 2.809016994374947,-1.587785252292473 2.587785252292473,-1.809016994374947 2.309016994374947,-1.951056516295154 2,-2 -1,-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>
|
||||
@ -21,7 +21,7 @@
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.646446609406726,5.353553390593274 4.773004750130227,5.445503262094184 4.921782767479884,5.493844170297569 5.078217232520116,5.493844170297569 5.226995249869773,5.445503262094184 5.353553390593274,5.353553390593274 6.353553390593274,4.353553390593274 6.440960632174178,4.235698368412999 6.490392640201615,4.097545161008064 6.497592363336098,3.95099142983522 6.461939766255643,3.808658283817455 6.386505226681368,3.682803357918177 6.277785116509802,3.584265193848728 6.145142338627231,3.521529832133896 6.0,3.5 4.0,3.5 3.834860469022414,3.528058334845817 3.688255099070632,3.609084258765987 3.576637900385857,3.733983961742333 3.512536043909088,3.888739533021844 3.503143895053379,4.055982238051655 3.549515566048791,4.21694186955878 3.646446609406726,4.353553390593274 4.646446609406726,5.353553390593274</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.292893218813452,5.707106781186548 4.546009500260453,5.891006524188368 4.843565534959769,5.987688340595138 5.156434465040231,5.987688340595138 5.453990499739547,5.891006524188368 5.707106781186548,5.707106781186548 6.707106781186548,4.707106781186548 6.881921264348355,4.471396736825998 6.98078528040323,4.195090322016128 6.995184726672197,3.90198285967044 6.923879532511287,3.61731656763491 6.773010453362737,3.365606715836355 6.555570233019602,3.168530387697455 6.290284677254463,3.043059664267791 6.0,3.0 4,3 3.669720938044828,3.056116669691634 3.376510198141263,3.218168517531973 3.153275800771714,3.467967923484666 3.025072087818176,3.777479066043688 3.006287790106758,4.11196447610331 3.099031132097581,4.43388373911756 3.292893218813453,4.707106781186548 4.292893218813452,5.707106781186548</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>
|
||||
@ -29,21 +29,27 @@
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.0,4.5 1.845491502812524,4.524471741852424 1.706107373853762,4.595491502812528 1.595491502812525,4.706107373853764 1.524471741852423,4.845491502812527 1.5,5.0 1.5,6.0 1.524471741852423,6.154508497187474 1.595491502812526,6.293892626146237 1.706107373853764,6.404508497187473 1.845491502812526,6.475528258147577 2.0,6.5 3.0,6.5 3.154508497187474,6.475528258147577 3.293892626146237,6.404508497187473 3.404508497187474,6.293892626146237 3.475528258147577,6.154508497187473 3.5,6.0 3.5,5.0 3.475528258147577,4.845491502812527 3.404508497187474,4.706107373853763 3.293892626146237,4.595491502812527 3.154508497187474,4.524471741852423 3.0,4.5 2.0,4.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,4 1.690983005625047,4.048943483704848 1.412214747707524,4.190983005625055 1.190983005625051,4.412214747707529 1.048943483704846,4.690983005625054 1,5 1,6 1.048943483704846,6.309016994374947 1.190983005625053,6.587785252292473 1.412214747707527,6.809016994374947 1.690983005625053,6.951056516295154 2,7 3,7 3.309016994374947,6.951056516295154 3.587785252292473,6.809016994374947 3.809016994374947,6.587785252292473 3.951056516295154,6.309016994374947 4,6 4,5 3.951056516295154,4.690983005625053 3.809016994374947,4.412214747707527 3.587785252292473,4.190983005625053 3.309016994374947,4.048943483704846 3,4 2,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>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.5,1.0 5.524471741852423,1.154508497187474 5.595491502812527,1.293892626146237 5.706107373853763,1.404508497187474 5.845491502812527,1.475528258147577 6.0,1.5 10.0,1.5 10.154508497187473,1.475528258147577 10.293892626146237,1.404508497187474 10.404508497187473,1.293892626146237 10.475528258147577,1.154508497187474 10.5,1.0 10.5,-3.0 10.475528258147577,-3.154508497187474 10.404508497187473,-3.293892626146237 10.293892626146237,-3.404508497187474 10.154508497187473,-3.475528258147577 10.0,-3.5 6.0,-3.5 5.845491502812524,-3.475528258147576 5.706107373853762,-3.404508497187472 5.595491502812526,-3.293892626146235 5.524471741852423,-3.154508497187473 5.5,-3.0 5.5,1.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7.5,-0.5 7.5,-1.5 8.5,-1.5 8.5,-0.5 7.5,-0.5</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,1 5.048943483704846,1.309016994374947 5.190983005625053,1.587785252292473 5.412214747707527,1.809016994374947 5.690983005625053,1.951056516295154 6,2 10,2 10.309016994374947,1.951056516295154 10.587785252292473,1.809016994374947 10.809016994374947,1.587785252292473 10.951056516295154,1.309016994374947 11,1 11,-3 10.951056516295154,-3.309016994374947 10.809016994374947,-3.587785252292473 10.587785252292473,-3.809016994374947 10.309016994374947,-3.951056516295154 10,-4 6,-4 5.690983005625047,-3.951056516295152 5.412214747707524,-3.809016994374945 5.190983005625051,-3.587785252292471 5.048943483704846,-3.309016994374946 5,-3 5,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>ASDF</ogr:name>
|
||||
<ogr:intval>0</ogr:intval>
|
||||
</ogr:buffer_polys>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.4">
|
||||
<ogr:intval>120</ogr:intval>
|
||||
<ogr:floatval>-100291.43213</ogr:floatval>
|
||||
</ogr:buffer_polys>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys fid="polys.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.0,2.5 3.158113883008419,2.474341649025257 6.158113883008419,1.474341649025257 6.296190906059295,1.402828682156291 6.40562109258778,1.292355142331883 6.475820631275006,1.153605751367112 6.5,1.0 6.5,-3.0 6.471531536948011,-3.166306974187634 6.389367961346215,-3.313675932575473 6.262865556059567,-3.42532540417602 6.10642963729163,-3.488541433561138 5.9378741657362,-3.496125367943453 5.776393202250021,-3.447213595499958 1.776393202250021,-1.447213595499958 1.662695537258234,-1.369087658171455 1.574674595823979,-1.262865556059565 1.519030821108041,-1.136633264456335 1.5,-1.0 1.5,2.0 1.524471741852423,2.154508497187474 1.595491502812526,2.293892626146237 1.706107373853764,2.404508497187474 1.845491502812526,2.475528258147577 2.0,2.5 3.0,2.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 3.316227766016838,2.948683298050514 6.316227766016838,1.948683298050514 6.592381812118591,1.805657364312581 6.811242185175561,1.584710284663765 6.951641262550011,1.307211502734223 7,1 7,-3 6.943063073896022,-3.332613948375267 6.778735922692429,-3.627351865150946 6.525731112119134,-3.85065080835204 6.212859274583259,-3.977082867122276 5.875748331472399,-3.992250735886906 5.552786404500042,-3.894427190999916 1.552786404500042,-1.894427190999916 1.325391074516467,-1.738175316342909 1.149349191647958,-1.525731112119131 1.038061642216082,-1.27326652891267 1,-1 1,2 1.048943483704846,2.309016994374947 1.190983005625053,2.587785252292473 1.412214747707527,2.809016994374947 1.690983005625053,2.951056516295154 2,3 3,3</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>
|
||||
|
58
python/plugins/processing/tests/testdata/expected/buffer_polys_bevel.gml
vendored
Normal file
58
python/plugins/processing/tests/testdata/expected/buffer_polys_bevel.gml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ buffer_polys_bevel.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-2</gml:X><gml:Y>-4</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>11</gml:X><gml:Y>7</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-2 -2,-1 -2,3 -1,4 3,4 4,3 4,2 3,1 3,-1 2,-2 -1,-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_bevel>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.292893218813452,5.707106781186548 5.707106781186548,5.707106781186548 6.707106781186548,4.707106781186548 6,3 4,3 3.292893218813453,4.707106781186548 4.292893218813452,5.707106781186548</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_bevel>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,4 1,5 1,6 2,7 3,7 4,6 4,5 3,4 2,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_bevel>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,1 6,2 10,2 11,1 11,-3 10,-4 6,-4 5,-3 5,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>ASDF</ogr:name>
|
||||
<ogr:intval>0</ogr:intval>
|
||||
</ogr:buffer_polys_bevel>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.4">
|
||||
<ogr:intval>120</ogr:intval>
|
||||
<ogr:floatval>-100291.43213</ogr:floatval>
|
||||
</ogr:buffer_polys_bevel>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_bevel fid="polys.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 3.316227766016838,2.948683298050514 6.316227766016838,1.948683298050514 7,1 7,-3 5.552786404500042,-3.894427190999916 1.552786404500042,-1.894427190999916 1,-1 1,2 2,3 3,3</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_bevel>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
43
python/plugins/processing/tests/testdata/expected/buffer_polys_bevel.xsd
vendored
Normal file
43
python/plugins/processing/tests/testdata/expected/buffer_polys_bevel.xsd
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="buffer_polys_bevel" type="ogr:buffer_polys_bevel_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="buffer_polys_bevel_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="5"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="intval" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:totalDigits value="16"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="floatval" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
58
python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gml
vendored
Normal file
58
python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.gml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ buffer_polys_mitre.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>-2</gml:X><gml:Y>-4.618033988749896</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>11</gml:X><gml:Y>7</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre 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>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre 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>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre 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>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre 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>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre fid="polys.4">
|
||||
<ogr:intval>120</ogr:intval>
|
||||
<ogr:floatval>-100291.43213</ogr:floatval>
|
||||
</ogr:buffer_polys_mitre>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:buffer_polys_mitre 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>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
43
python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.xsd
vendored
Normal file
43
python/plugins/processing/tests/testdata/expected/buffer_polys_mitre.xsd
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="buffer_polys_mitre" type="ogr:buffer_polys_mitre_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="buffer_polys_mitre_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="5"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="intval" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:totalDigits value="16"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="floatval" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
@ -656,4 +656,90 @@ tests:
|
||||
results:
|
||||
OUTPUT_LAYER:
|
||||
name: expected/multiline_offset.gml
|
||||
type: vector
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:fixeddistancebuffer
|
||||
name: Buffer polygons using bevel
|
||||
params:
|
||||
DISSOLVE: false
|
||||
DISTANCE: 1.0
|
||||
END_CAP_STYLE: '0'
|
||||
INPUT:
|
||||
name: polys.gml
|
||||
type: vector
|
||||
JOIN_STYLE: '2'
|
||||
MITRE_LIMIT: 2
|
||||
SEGMENTS: 5
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/buffer_polys_bevel.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:fixeddistancebuffer
|
||||
name: Buffer polygons using mitre
|
||||
params:
|
||||
DISSOLVE: false
|
||||
DISTANCE: 1.0
|
||||
END_CAP_STYLE: '0'
|
||||
INPUT:
|
||||
name: polys.gml
|
||||
type: vector
|
||||
JOIN_STYLE: '1'
|
||||
MITRE_LIMIT: 2
|
||||
SEGMENTS: 5
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/buffer_polys_mitre.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:fixeddistancebuffer
|
||||
name: Buffer lines
|
||||
params:
|
||||
DISSOLVE: false
|
||||
DISTANCE: 1.0
|
||||
END_CAP_STYLE: '0'
|
||||
INPUT:
|
||||
name: lines.gml
|
||||
type: vector
|
||||
JOIN_STYLE: '0'
|
||||
MITRE_LIMIT: 2
|
||||
SEGMENTS: 5
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/buffer_lines.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:fixeddistancebuffer
|
||||
name: Buffer lines (flat)
|
||||
params:
|
||||
DISSOLVE: false
|
||||
DISTANCE: 1.0
|
||||
END_CAP_STYLE: '1'
|
||||
INPUT:
|
||||
name: lines.gml
|
||||
type: vector
|
||||
JOIN_STYLE: '0'
|
||||
MITRE_LIMIT: 2
|
||||
SEGMENTS: 5
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/buffer_lines_flat.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:fixeddistancebuffer
|
||||
name: Buffer lines (square)
|
||||
params:
|
||||
DISSOLVE: false
|
||||
DISTANCE: 1.0
|
||||
END_CAP_STYLE: '2'
|
||||
INPUT:
|
||||
name: lines.gml
|
||||
type: vector
|
||||
JOIN_STYLE: '0'
|
||||
MITRE_LIMIT: 2
|
||||
SEGMENTS: 5
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/buffer_lines_square.gml
|
||||
type: vector
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user