Skip to content

Commit 8b07b4e

Browse files
authoredSep 14, 2018
Merge pull request #7626 from rudivs/kneighbour
[feature] Adapted k-neighbour concave hull plugin as QGIS 3 algorithm
2 parents 1192b63 + 8fa27e1 commit 8b07b4e

19 files changed

+1086
-2
lines changed
 

‎images/images.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<file>themes/default/algorithms/mAlgorithmExtractVertices.svg</file>
9393
<file>themes/default/algorithms/mAlgorithmExtractLayerExtent.svg</file>
9494
<file>themes/default/algorithms/mAlgorithmIntersect.svg</file>
95+
<file>themes/default/algorithms/mAlgorithmConcaveHull.svg</file>
9596
<file>themes/default/algorithms/mAlgorithmLineIntersections.svg</file>
9697
<file>themes/default/algorithms/mAlgorithmLineToPolygon.svg</file>
9798
<file>themes/default/algorithms/mAlgorithmMeanCoordinates.svg</file>
Lines changed: 134 additions & 0 deletions
Loading

‎python/plugins/processing/algs/help/qgis.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ qgis:joinbylocationsummary: >
233233
qgis:keepnbiggestparts: >
234234
This algorithm takes a polygon layer and creates a new polygon layer in which multipart geometries have been removed, leaving only the n largest (in terms of area) parts.
235235

236+
qgis:knearestconcavehull: >
237+
This algorithm generates a concave hull polygon from a set of points. If the input layer is a line or polygon layer, it will use the nodes.
238+
239+
The number of neighbours to consider determines the concaveness of the output polygon. A lower number will result in a concave hull that follows the points very closely, while a higher number will have a smoother shape. The minimum number of neighbour points to consider is 3. A value equal to or greater than the number of points will result in a convex hull.
240+
241+
If a field is selected, the algorithm will group the features in the input layer using unique values in that field and generate individual polygons in the output layer for each group.
242+
236243
qgis:lineintersections: >
237244
This algorithm creates point features where the lines in the Intersect layer intersect the lines in the Input layer.
238245

‎python/plugins/processing/algs/qgis/ConcaveHull.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
from qgis.PyQt.QtCore import QCoreApplication
2929
from math import sqrt
3030

31-
from qgis.core import (QgsFeature,
31+
from qgis.core import (QgsApplication,
32+
QgsFeature,
3233
QgsFeatureSink,
3334
QgsWkbTypes,
3435
QgsProcessing,
@@ -75,7 +76,16 @@ def name(self):
7576
return 'concavehull'
7677

7778
def displayName(self):
78-
return self.tr('Concave hull')
79+
return self.tr('Concave hull (alpha shapes)')
80+
81+
def shortDescription(self):
82+
return self.tr('Creates a concave hull using the alpha shapes algorithm.')
83+
84+
def icon(self):
85+
return QgsApplication.getThemeIcon("/algorithms/mAlgorithmConcaveHull.svg")
86+
87+
def svgIconPath(self):
88+
return QgsApplication.iconPath("/algorithms/mAlgorithmConcaveHull.svg")
7989

8090
def processAlgorithm(self, parameters, context, feedback):
8191
layer = self.parameterAsSource(parameters, ConcaveHull.INPUT, context)

‎python/plugins/processing/algs/qgis/KNearestConcaveHull.py

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

‎python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
from .ImportIntoPostGIS import ImportIntoPostGIS
8484
from .ImportIntoSpatialite import ImportIntoSpatialite
8585
from .KeepNBiggestParts import KeepNBiggestParts
86+
from .KNearestConcaveHull import KNearestConcaveHull
8687
from .LinesToPolygons import LinesToPolygons
8788
from .MinimumBoundingGeometry import MinimumBoundingGeometry
8889
from .NearestNeighbourAnalysis import NearestNeighbourAnalysis
@@ -194,6 +195,7 @@ def getAlgs(self):
194195
ImportIntoPostGIS(),
195196
ImportIntoSpatialite(),
196197
KeepNBiggestParts(),
198+
KNearestConcaveHull(),
197199
LinesToPolygons(),
198200
MinimumBoundingGeometry(),
199201
NearestNeighbourAnalysis(),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ points_duplicate.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-0.4127659574468086</gml:X><gml:Y>-0.1702127659574468</gml:Y></gml:coord>
10+
<gml:coord><gml:X>0.1659574468085108</gml:X><gml:Y>0.2042553191489361</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:points_duplicate fid="points_duplicate.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.412765957446809,0.204255319148936</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
</ogr:points_duplicate>
18+
</gml:featureMember>
19+
<gml:featureMember>
20+
<ogr:points_duplicate fid="points_duplicate.1">
21+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.165957446808511,-0.170212765957447</gml:coordinates></gml:Point></ogr:geometryProperty>
22+
</ogr:points_duplicate>
23+
</gml:featureMember>
24+
</ogr:FeatureCollection>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="points_duplicate" type="ogr:points_duplicate_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="points_duplicate_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
</xs:sequence>
20+
</xs:extension>
21+
</xs:complexContent>
22+
</xs:complexType>
23+
</xs:schema>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ knearest_concave_hull_lines.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>11</gml:X><gml:Y>5</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:knearest_concave_hull_lines fid="knearest_concave_hull_lines.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 7,-3 10,-3 10,1 11,5 3,3 2,2 1,-1 -1,-1 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:id>0</ogr:id>
18+
</ogr:knearest_concave_hull_lines>
19+
</gml:featureMember>
20+
</ogr:FeatureCollection>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="knearest_concave_hull_lines" type="ogr:knearest_concave_hull_lines_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="knearest_concave_hull_lines_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:integer">
22+
<xs:totalDigits value="10"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
</xs:sequence>
27+
</xs:extension>
28+
</xs:complexContent>
29+
</xs:complexType>
30+
</xs:schema>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ knearest_concave_hull_multipoints.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0</gml:X><gml:Y>-5</gml:Y></gml:coord>
10+
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:knearest_concave_hull_multipoints fid="knearest_concave_hull_multipoints.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,-5 7,-1 8,-1 5,2 3,3 2,2 1,1 0,-1 0,-5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:id>0</ogr:id>
18+
</ogr:knearest_concave_hull_multipoints>
19+
</gml:featureMember>
20+
</ogr:FeatureCollection>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="knearest_concave_hull_multipoints" type="ogr:knearest_concave_hull_multipoints_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="knearest_concave_hull_multipoints_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:integer">
22+
<xs:totalDigits value="10"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
</xs:sequence>
27+
</xs:extension>
28+
</xs:complexContent>
29+
</xs:complexType>
30+
</xs:schema>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ knearest_concave_hull_points_7.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0</gml:X><gml:Y>-5</gml:Y></gml:coord>
10+
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:knearest_concave_hull_points_7 fid="knearest_concave_hull_points_7.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,-5 7,-1 8,-1 5,2 3,3 2,2 1,1 0,-1 0,-5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:id>0</ogr:id>
18+
</ogr:knearest_concave_hull_points_7>
19+
</gml:featureMember>
20+
</ogr:FeatureCollection>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="knearest_concave_hull_points_7" type="ogr:knearest_concave_hull_points_7_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="knearest_concave_hull_points_7_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:integer">
22+
<xs:totalDigits value="10"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
</xs:sequence>
27+
</xs:extension>
28+
</xs:complexContent>
29+
</xs:complexType>
30+
</xs:schema>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ knearest_concave_hull_points_id2.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0</gml:X><gml:Y>-5</gml:Y></gml:coord>
10+
<gml:coord><gml:X>8</gml:X><gml:Y>2</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:knearest_concave_hull_points_id2 fid="knearest_concave_hull_points_id2.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,-5 7,-1 8,-1 2,2 0,-1 0,-5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:id>0</ogr:id>
18+
<ogr:id2>0</ogr:id2>
19+
</ogr:knearest_concave_hull_points_id2>
20+
</gml:featureMember>
21+
</ogr:FeatureCollection>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="knearest_concave_hull_points_id2" type="ogr:knearest_concave_hull_points_id2_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="knearest_concave_hull_points_id2_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:integer">
22+
<xs:totalDigits value="10"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
<xs:element name="id2" nillable="true" minOccurs="0" maxOccurs="1">
27+
<xs:simpleType>
28+
<xs:restriction base="xs:integer">
29+
<xs:totalDigits value="10"/>
30+
</xs:restriction>
31+
</xs:simpleType>
32+
</xs:element>
33+
</xs:sequence>
34+
</xs:extension>
35+
</xs:complexContent>
36+
</xs:complexType>
37+
</xs:schema>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ knearest_concave_hull_polys.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:knearest_concave_hull_polys fid="knearest_concave_hull_polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 10,-3 10,1 6,1 6,4 5,5 3,6 2,6 2,5 2,2 -1,3 -1,-1 2,-1 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:id>0</ogr:id>
18+
</ogr:knearest_concave_hull_polys>
19+
</gml:featureMember>
20+
</ogr:FeatureCollection>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="knearest_concave_hull_polys" type="ogr:knearest_concave_hull_polys_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="knearest_concave_hull_polys_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:integer">
22+
<xs:totalDigits value="10"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
</xs:sequence>
27+
</xs:extension>
28+
</xs:complexContent>
29+
</xs:complexType>
30+
</xs:schema>

‎python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5404,6 +5404,80 @@ tests:
54045404
name: expected/concave_hull_points_07.gml
54055405
type: vector
54065406

5407+
- algorithm: qgis:knearestconcavehull
5408+
name: K-nearest Neighbor Concave Hull - Points (k=7)
5409+
params:
5410+
KNEIGHBORS: 7
5411+
INPUT:
5412+
name: points.gml
5413+
type: vector
5414+
results:
5415+
OUTPUT:
5416+
name: expected/knearest_concave_hull_points_7.gml
5417+
type: vector
5418+
5419+
- algorithm: qgis:knearestconcavehull
5420+
name: K-nearest Neighbor Concave Hull - Group by field
5421+
params:
5422+
FIELD: id2
5423+
INPUT:
5424+
name: points.gml
5425+
type: vector
5426+
KNEIGHBORS: 3
5427+
results:
5428+
OUTPUT:
5429+
name: expected/knearest_concave_hull_points_id2.gml
5430+
type: vector
5431+
5432+
- algorithm: qgis:knearestconcavehull
5433+
name: K-nearest Neighbor Concave Hull - Lines (k=3)
5434+
params:
5435+
INPUT:
5436+
name: lines.gml
5437+
type: vector
5438+
KNEIGHBORS: 3
5439+
results:
5440+
OUTPUT:
5441+
name: expected/knearest_concave_hull_lines.gml
5442+
type: vector
5443+
5444+
- algorithm: qgis:knearestconcavehull
5445+
name: K-nearest Neighbor Concave Hull - Polys (k=3)
5446+
params:
5447+
INPUT:
5448+
name: polys.gml
5449+
type: vector
5450+
KNEIGHBORS: 3
5451+
results:
5452+
OUTPUT:
5453+
name: expected/knearest_concave_hull_polys.gml
5454+
type: vector
5455+
5456+
- algorithm: qgis:knearestconcavehull
5457+
name: K-nearest Neighbor Concave Hull - MultiPoints (k=3)
5458+
params:
5459+
INPUT:
5460+
name: multipoints.gml
5461+
type: vector
5462+
KNEIGHBORS: 3
5463+
results:
5464+
OUTPUT:
5465+
name: expected/knearest_concave_hull_multipoints.gml
5466+
type: vector
5467+
5468+
- algorithm: qgis:knearestconcavehull
5469+
name: K-nearest Neighbor Concave Hull - Duplicate Points
5470+
params:
5471+
INPUT:
5472+
name: custom/points_duplicate.gml
5473+
type: vector
5474+
KNEIGHBORS: 3
5475+
results:
5476+
OUTPUT:
5477+
name: expected/failure.gml
5478+
type: vector
5479+
expectedException: true
5480+
54075481
- algorithm: native:swapxy
54085482
name: Swap XY coordinates
54095483
params:

0 commit comments

Comments
 (0)
Please sign in to comment.