Skip to content
Permalink
Browse files

Merge pull request #5184 from nyalldawson/join_locate

[FEATURE] Reworked processing 'Join by location' alg
  • Loading branch information
nyalldawson committed Sep 13, 2017
2 parents d084cc6 + be88da8 commit c371b72dfef6c4d1fb9e18cfad39f8f79de04146
Showing with 2,854 additions and 191 deletions.
  1. +7 −1 python/plugins/processing/algs/help/qgis.yaml
  2. +4 −4 python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
  3. +138 −185 python/plugins/processing/algs/qgis/SpatialJoin.py
  4. +341 −0 python/plugins/processing/algs/qgis/SpatialJoinSummary.py
  5. +1 −1 python/plugins/processing/algs/qgis/StatisticsByCategories.py
  6. BIN python/plugins/processing/tests/testdata/custom/points_with_date.dbf
  7. +1 −0 python/plugins/processing/tests/testdata/custom/points_with_date.prj
  8. +1 −0 python/plugins/processing/tests/testdata/custom/points_with_date.qpj
  9. BIN python/plugins/processing/tests/testdata/custom/points_with_date.shp
  10. BIN python/plugins/processing/tests/testdata/custom/points_with_date.shx
  11. +48 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect.gfs
  12. +111 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect.gml
  13. +48 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_discardnomatch.gfs
  14. +90 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_discardnomatch.gml
  15. +48 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_first_only.gfs
  16. +67 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_first_only.gml
  17. +48 −0 ...ugins/processing/tests/testdata/expected/join_by_location_intersect_first_only_discardnomatch.gfs
  18. +46 −0 ...ugins/processing/tests/testdata/expected/join_by_location_intersect_first_only_discardnomatch.gml
  19. +37 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_subset_fields.gfs
  20. +97 −0 python/plugins/processing/tests/testdata/expected/join_by_location_intersect_subset_fields.gml
  21. +64 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_date.gfs
  22. +76 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_date.gml
  23. +172 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_intersect.gfs
  24. +142 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_intersect.gml
  25. +172 −0 .../plugins/processing/tests/testdata/expected/join_by_location_summary_intersect_discardnomatch.gfs
  26. +121 −0 .../plugins/processing/tests/testdata/expected/join_by_location_summary_intersect_discardnomatch.gml
  27. +73 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_string.gfs
  28. +131 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_string.gml
  29. +62 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_subset_stats.gfs
  30. +76 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_subset_stats.gml
  31. +102 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_touches.gfs
  32. +100 −0 python/plugins/processing/tests/testdata/expected/join_by_location_summary_touches.gml
  33. +48 −0 python/plugins/processing/tests/testdata/expected/join_by_location_touches.gfs
  34. +68 −0 python/plugins/processing/tests/testdata/expected/join_by_location_touches.gml
  35. +314 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
@@ -267,12 +267,18 @@ qgis:joinattributesbylocation: >

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.


qgis:joinattributestable: >
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.

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.

qgis:joinbylocationsummary: >
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.

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.

The algorithm calculates a statistical summary for the values from matching features in the second layer (e.g. maximum value, mean value, etc).

qgis:keepnbiggestparts: >
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.

@@ -150,6 +150,8 @@
from .SnapGeometries import SnapGeometriesToLayer
from .SpatialiteExecuteSQL import SpatialiteExecuteSQL
from .SpatialIndex import SpatialIndex
from .SpatialJoin import SpatialJoin
from .SpatialJoinSummary import SpatialJoinSummary
from .SplitWithLines import SplitWithLines
from .StatisticsByCategories import StatisticsByCategories
from .SumLines import SumLines
@@ -166,7 +168,6 @@
from .VoronoiPolygons import VoronoiPolygons
from .ZonalStatistics import ZonalStatistics

# from .SpatialJoin import SpatialJoin

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

def getAlgs(self):
# algs = [
# SpatialJoin(),
# ]
algs = [AddTableField(),
Aggregate(),
Aspect(),
@@ -293,6 +291,8 @@ def getAlgs(self):
SnapGeometriesToLayer(),
SpatialiteExecuteSQL(),
SpatialIndex(),
SpatialJoin(),
SpatialJoinSummary(),
SplitWithLines(),
StatisticsByCategories(),
SumLines(),

0 comments on commit c371b72

Please sign in to comment.
You can’t perform that action at this time.