Skip to content

Commit c371b72

Browse files
authored
Merge pull request #5184 from nyalldawson/join_locate
[FEATURE] Reworked processing 'Join by location' alg
2 parents d084cc6 + be88da8 commit c371b72

35 files changed

+2854
-191
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,18 @@ qgis:joinattributesbylocation: >
267267

268268
The additional attributes and their values are taken from a second vector layer. A spatial criteria is applied to select the values from the second layer that are added to each feature from the first layer in the resulting one.
269269

270-
271270
qgis:joinattributestable: >
272271
This algorithm takes an input vector layer and creates a new vector layer that is an extended version of the input one, with additional attributes in its attribute table.
273272

274273
The additional attributes and their values are taken from a second vector layer. An attribute is selected in each of them to define the join criteria.
275274

275+
qgis:joinbylocationsummary: >
276+
This algorithm takes an input vector layer and creates a new vector layer that is an extended version of the input one, with additional attributes in its attribute table.
277+
278+
The additional attributes and their values are taken from a second vector layer. A spatial criteria is applied to select the values from the second layer that are added to each feature from the first layer in the resulting one.
279+
280+
The algorithm calculates a statistical summary for the values from matching features in the second layer (e.g. maximum value, mean value, etc).
281+
276282
qgis:keepnbiggestparts: >
277283
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.
278284

python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
from .SnapGeometries import SnapGeometriesToLayer
151151
from .SpatialiteExecuteSQL import SpatialiteExecuteSQL
152152
from .SpatialIndex import SpatialIndex
153+
from .SpatialJoin import SpatialJoin
154+
from .SpatialJoinSummary import SpatialJoinSummary
153155
from .SplitWithLines import SplitWithLines
154156
from .StatisticsByCategories import StatisticsByCategories
155157
from .SumLines import SumLines
@@ -166,7 +168,6 @@
166168
from .VoronoiPolygons import VoronoiPolygons
167169
from .ZonalStatistics import ZonalStatistics
168170

169-
# from .SpatialJoin import SpatialJoin
170171

171172
pluginPath = os.path.normpath(os.path.join(
172173
os.path.split(os.path.dirname(__file__))[0], os.pardir))
@@ -180,9 +181,6 @@ def __init__(self):
180181
self.externalAlgs = []
181182

182183
def getAlgs(self):
183-
# algs = [
184-
# SpatialJoin(),
185-
# ]
186184
algs = [AddTableField(),
187185
Aggregate(),
188186
Aspect(),
@@ -293,6 +291,8 @@ def getAlgs(self):
293291
SnapGeometriesToLayer(),
294292
SpatialiteExecuteSQL(),
295293
SpatialIndex(),
294+
SpatialJoin(),
295+
SpatialJoinSummary(),
296296
SplitWithLines(),
297297
StatisticsByCategories(),
298298
SumLines(),

0 commit comments

Comments
 (0)