@@ -88,7 +88,7 @@ def initAlgorithm(self, config=None):
88
88
QgsProcessingParameterNumber .Integer ,
89
89
defaultValue = 3 , minValue = 3 ))
90
90
self .addParameter (QgsProcessingParameterField (self .FIELD ,
91
- self .tr ('Field (optional, set if creating concave hulls by class)' ),
91
+ self .tr ('Field (set if creating concave hulls by class)' ),
92
92
parentLayerParameterName = self .INPUT , optional = True ))
93
93
self .addParameter (QgsProcessingParameterFeatureSink (self .OUTPUT , self .tr ('Output layer' ),
94
94
QgsProcessing .TypeVectorPolygon ))
@@ -359,20 +359,6 @@ def point_in_polygon_q(point, list_of_points):
359
359
return inside
360
360
361
361
362
- def as_polygon (point_list ):
363
- """
364
- Returns the geometry described by *point_list* in as QgsGeometry
365
-
366
- :param point_list: list of tuples (x, y)
367
- :return: QgsGeometry
368
- """
369
- # create a list of QgsPoint() from list of point coordinate strings in *point_list*
370
- points = [QgsPoint (point [0 ], point [1 ]) for point in point_list ]
371
- # create the polygon geometry from list of point geometries
372
- poly = QgsGeometry .fromPolygon ([points ])
373
- return poly
374
-
375
-
376
362
def extract_points (geom ):
377
363
"""
378
364
Generate list of QgsPoints from QgsGeometry *geom* ( can be point, line, or polygon )
@@ -445,11 +431,10 @@ def concave_hull(points_list, k):
445
431
"""
446
432
# return an empty list if not enough points are given
447
433
if k > len (points_list ):
448
- return None
434
+ k = len ( points_list )
449
435
450
436
# the number of nearest neighbors k must be greater than or equal to 3
451
- # kk = max(k, 3)
452
- kk = max (k , 2 )
437
+ kk = max (k , 3 )
453
438
454
439
# delete duplicate points
455
440
point_set = clean_list (points_list )
0 commit comments