Skip to content

Commit 458e994

Browse files
committedSep 12, 2017
[FEATURE] Reworked processing 'Join by location' alg
Improvements: - transparently handle different source/join CRS - added option to create output feature for EVERY joined feature (i.e. 1 to many type join) - added option to select joined fields to take - optimised performance of algorithm The previous option to create a summary of joined features has been removed, and will be moved to a separate 'Join by location (summary)' algorithm.
1 parent 5614df4 commit 458e994

15 files changed

+1054
-190
lines changed
 

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
from .SnapGeometries import SnapGeometriesToLayer
151151
from .SpatialiteExecuteSQL import SpatialiteExecuteSQL
152152
from .SpatialIndex import SpatialIndex
153+
from .SpatialJoin import SpatialJoin
153154
from .SplitWithLines import SplitWithLines
154155
from .StatisticsByCategories import StatisticsByCategories
155156
from .SumLines import SumLines
@@ -166,7 +167,6 @@
166167
from .VoronoiPolygons import VoronoiPolygons
167168
from .ZonalStatistics import ZonalStatistics
168169

169-
# from .SpatialJoin import SpatialJoin
170170

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

182182
def getAlgs(self):
183-
# algs = [
184-
# SpatialJoin(),
185-
# ]
186183
algs = [AddTableField(),
187184
Aggregate(),
188185
Aspect(),
@@ -293,6 +290,7 @@ def getAlgs(self):
293290
SnapGeometriesToLayer(),
294291
SpatialiteExecuteSQL(),
295292
SpatialIndex(),
293+
SpatialJoin(),
296294
SplitWithLines(),
297295
StatisticsByCategories(),
298296
SumLines(),

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

Lines changed: 138 additions & 185 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_intersect</Name>
4+
<ElementPath>join_by_location_intersect</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>10</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>6.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>fid_2</Name>
33+
<ElementPath>fid_2</ElementPath>
34+
<Type>String</Type>
35+
<Width>8</Width>
36+
</PropertyDefn>
37+
<PropertyDefn>
38+
<Name>id</Name>
39+
<ElementPath>id</ElementPath>
40+
<Type>Integer</Type>
41+
</PropertyDefn>
42+
<PropertyDefn>
43+
<Name>id2</Name>
44+
<ElementPath>id2</ElementPath>
45+
<Type>Integer</Type>
46+
</PropertyDefn>
47+
</GMLFeatureClass>
48+
</GMLFeatureClassList>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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:join_by_location_intersect fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:fid_2>points.0</ogr:fid_2>
21+
<ogr:id>1</ogr:id>
22+
<ogr:id2>2</ogr:id2>
23+
</ogr:join_by_location_intersect>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:join_by_location_intersect fid="polys.0">
27+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
28+
<ogr:name>aaaaa</ogr:name>
29+
<ogr:intval>33</ogr:intval>
30+
<ogr:floatval>44.123456</ogr:floatval>
31+
<ogr:fid_2>points.1</ogr:fid_2>
32+
<ogr:id>2</ogr:id>
33+
<ogr:id2>1</ogr:id2>
34+
</ogr:join_by_location_intersect>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:join_by_location_intersect fid="polys.0">
38+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
39+
<ogr:name>aaaaa</ogr:name>
40+
<ogr:intval>33</ogr:intval>
41+
<ogr:floatval>44.123456</ogr:floatval>
42+
<ogr:fid_2>points.2</ogr:fid_2>
43+
<ogr:id>3</ogr:id>
44+
<ogr:id2>0</ogr:id2>
45+
</ogr:join_by_location_intersect>
46+
</gml:featureMember>
47+
<gml:featureMember>
48+
<ogr:join_by_location_intersect fid="polys.5">
49+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
50+
<ogr:name>elim</ogr:name>
51+
<ogr:intval>2</ogr:intval>
52+
<ogr:floatval>3.33</ogr:floatval>
53+
<ogr:fid_2>points.2</ogr:fid_2>
54+
<ogr:id>3</ogr:id>
55+
<ogr:id2>0</ogr:id2>
56+
</ogr:join_by_location_intersect>
57+
</gml:featureMember>
58+
<gml:featureMember>
59+
<ogr:join_by_location_intersect fid="polys.5">
60+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
61+
<ogr:name>elim</ogr:name>
62+
<ogr:intval>2</ogr:intval>
63+
<ogr:floatval>3.33</ogr:floatval>
64+
<ogr:fid_2>points.4</ogr:fid_2>
65+
<ogr:id>5</ogr:id>
66+
<ogr:id2>1</ogr:id2>
67+
</ogr:join_by_location_intersect>
68+
</gml:featureMember>
69+
<gml:featureMember>
70+
<ogr:join_by_location_intersect fid="polys.3">
71+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
72+
<ogr:name>ASDF</ogr:name>
73+
<ogr:intval>0</ogr:intval>
74+
<ogr:fid_2>points.7</ogr:fid_2>
75+
<ogr:id>8</ogr:id>
76+
<ogr:id2>0</ogr:id2>
77+
</ogr:join_by_location_intersect>
78+
</gml:featureMember>
79+
<gml:featureMember>
80+
<ogr:join_by_location_intersect fid="polys.0">
81+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
82+
<ogr:name>aaaaa</ogr:name>
83+
<ogr:intval>33</ogr:intval>
84+
<ogr:floatval>44.123456</ogr:floatval>
85+
<ogr:fid_2>points.8</ogr:fid_2>
86+
<ogr:id>9</ogr:id>
87+
<ogr:id2>0</ogr:id2>
88+
</ogr:join_by_location_intersect>
89+
</gml:featureMember>
90+
<gml:featureMember>
91+
<ogr:join_by_location_intersect fid="polys.2">
92+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
93+
<ogr:name>bbaaa</ogr:name>
94+
<ogr:floatval>0.123</ogr:floatval>
95+
</ogr:join_by_location_intersect>
96+
</gml:featureMember>
97+
<gml:featureMember>
98+
<ogr:join_by_location_intersect fid="polys.1">
99+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
100+
<ogr:name>Aaaaa</ogr:name>
101+
<ogr:intval>-33</ogr:intval>
102+
<ogr:floatval>0</ogr:floatval>
103+
</ogr:join_by_location_intersect>
104+
</gml:featureMember>
105+
<gml:featureMember>
106+
<ogr:join_by_location_intersect fid="polys.4">
107+
<ogr:intval>120</ogr:intval>
108+
<ogr:floatval>-100291.43213</ogr:floatval>
109+
</ogr:join_by_location_intersect>
110+
</gml:featureMember>
111+
</ogr:FeatureCollection>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_intersect_discardnomatch</Name>
4+
<ElementPath>join_by_location_intersect_discardnomatch</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>7</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>3.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>fid_2</Name>
33+
<ElementPath>fid_2</ElementPath>
34+
<Type>String</Type>
35+
<Width>8</Width>
36+
</PropertyDefn>
37+
<PropertyDefn>
38+
<Name>id</Name>
39+
<ElementPath>id</ElementPath>
40+
<Type>Integer</Type>
41+
</PropertyDefn>
42+
<PropertyDefn>
43+
<Name>id2</Name>
44+
<ElementPath>id2</ElementPath>
45+
<Type>Integer</Type>
46+
</PropertyDefn>
47+
</GMLFeatureClass>
48+
</GMLFeatureClassList>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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>3</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:join_by_location_intersect_discardnomatch fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:fid_2>points.0</ogr:fid_2>
21+
<ogr:id>1</ogr:id>
22+
<ogr:id2>2</ogr:id2>
23+
</ogr:join_by_location_intersect_discardnomatch>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:join_by_location_intersect_discardnomatch fid="polys.0">
27+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
28+
<ogr:name>aaaaa</ogr:name>
29+
<ogr:intval>33</ogr:intval>
30+
<ogr:floatval>44.123456</ogr:floatval>
31+
<ogr:fid_2>points.1</ogr:fid_2>
32+
<ogr:id>2</ogr:id>
33+
<ogr:id2>1</ogr:id2>
34+
</ogr:join_by_location_intersect_discardnomatch>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:join_by_location_intersect_discardnomatch fid="polys.0">
38+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
39+
<ogr:name>aaaaa</ogr:name>
40+
<ogr:intval>33</ogr:intval>
41+
<ogr:floatval>44.123456</ogr:floatval>
42+
<ogr:fid_2>points.2</ogr:fid_2>
43+
<ogr:id>3</ogr:id>
44+
<ogr:id2>0</ogr:id2>
45+
</ogr:join_by_location_intersect_discardnomatch>
46+
</gml:featureMember>
47+
<gml:featureMember>
48+
<ogr:join_by_location_intersect_discardnomatch fid="polys.5">
49+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
50+
<ogr:name>elim</ogr:name>
51+
<ogr:intval>2</ogr:intval>
52+
<ogr:floatval>3.33</ogr:floatval>
53+
<ogr:fid_2>points.2</ogr:fid_2>
54+
<ogr:id>3</ogr:id>
55+
<ogr:id2>0</ogr:id2>
56+
</ogr:join_by_location_intersect_discardnomatch>
57+
</gml:featureMember>
58+
<gml:featureMember>
59+
<ogr:join_by_location_intersect_discardnomatch fid="polys.5">
60+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
61+
<ogr:name>elim</ogr:name>
62+
<ogr:intval>2</ogr:intval>
63+
<ogr:floatval>3.33</ogr:floatval>
64+
<ogr:fid_2>points.4</ogr:fid_2>
65+
<ogr:id>5</ogr:id>
66+
<ogr:id2>1</ogr:id2>
67+
</ogr:join_by_location_intersect_discardnomatch>
68+
</gml:featureMember>
69+
<gml:featureMember>
70+
<ogr:join_by_location_intersect_discardnomatch fid="polys.3">
71+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
72+
<ogr:name>ASDF</ogr:name>
73+
<ogr:intval>0</ogr:intval>
74+
<ogr:fid_2>points.7</ogr:fid_2>
75+
<ogr:id>8</ogr:id>
76+
<ogr:id2>0</ogr:id2>
77+
</ogr:join_by_location_intersect_discardnomatch>
78+
</gml:featureMember>
79+
<gml:featureMember>
80+
<ogr:join_by_location_intersect_discardnomatch fid="polys.0">
81+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
82+
<ogr:name>aaaaa</ogr:name>
83+
<ogr:intval>33</ogr:intval>
84+
<ogr:floatval>44.123456</ogr:floatval>
85+
<ogr:fid_2>points.8</ogr:fid_2>
86+
<ogr:id>9</ogr:id>
87+
<ogr:id2>0</ogr:id2>
88+
</ogr:join_by_location_intersect_discardnomatch>
89+
</gml:featureMember>
90+
</ogr:FeatureCollection>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_intersect_first_only</Name>
4+
<ElementPath>join_by_location_intersect_first_only</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>6</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>6.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>fid_2</Name>
33+
<ElementPath>fid_2</ElementPath>
34+
<Type>String</Type>
35+
<Width>8</Width>
36+
</PropertyDefn>
37+
<PropertyDefn>
38+
<Name>id</Name>
39+
<ElementPath>id</ElementPath>
40+
<Type>Integer</Type>
41+
</PropertyDefn>
42+
<PropertyDefn>
43+
<Name>id2</Name>
44+
<ElementPath>id2</ElementPath>
45+
<Type>Integer</Type>
46+
</PropertyDefn>
47+
</GMLFeatureClass>
48+
</GMLFeatureClassList>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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:join_by_location_intersect_first_only fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:fid_2>points.0</ogr:fid_2>
21+
<ogr:id>1</ogr:id>
22+
<ogr:id2>2</ogr:id2>
23+
</ogr:join_by_location_intersect_first_only>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:join_by_location_intersect_first_only fid="polys.5">
27+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
28+
<ogr:name>elim</ogr:name>
29+
<ogr:intval>2</ogr:intval>
30+
<ogr:floatval>3.33</ogr:floatval>
31+
<ogr:fid_2>points.2</ogr:fid_2>
32+
<ogr:id>3</ogr:id>
33+
<ogr:id2>0</ogr:id2>
34+
</ogr:join_by_location_intersect_first_only>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:join_by_location_intersect_first_only fid="polys.3">
38+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
39+
<ogr:name>ASDF</ogr:name>
40+
<ogr:intval>0</ogr:intval>
41+
<ogr:fid_2>points.7</ogr:fid_2>
42+
<ogr:id>8</ogr:id>
43+
<ogr:id2>0</ogr:id2>
44+
</ogr:join_by_location_intersect_first_only>
45+
</gml:featureMember>
46+
<gml:featureMember>
47+
<ogr:join_by_location_intersect_first_only fid="polys.1">
48+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
49+
<ogr:name>Aaaaa</ogr:name>
50+
<ogr:intval>-33</ogr:intval>
51+
<ogr:floatval>0</ogr:floatval>
52+
</ogr:join_by_location_intersect_first_only>
53+
</gml:featureMember>
54+
<gml:featureMember>
55+
<ogr:join_by_location_intersect_first_only fid="polys.2">
56+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
57+
<ogr:name>bbaaa</ogr:name>
58+
<ogr:floatval>0.123</ogr:floatval>
59+
</ogr:join_by_location_intersect_first_only>
60+
</gml:featureMember>
61+
<gml:featureMember>
62+
<ogr:join_by_location_intersect_first_only fid="polys.4">
63+
<ogr:intval>120</ogr:intval>
64+
<ogr:floatval>-100291.43213</ogr:floatval>
65+
</ogr:join_by_location_intersect_first_only>
66+
</gml:featureMember>
67+
</ogr:FeatureCollection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_intersect_first_only_discardnomatch</Name>
4+
<ElementPath>join_by_location_intersect_first_only_discardnomatch</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>3</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>3.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>fid_2</Name>
33+
<ElementPath>fid_2</ElementPath>
34+
<Type>String</Type>
35+
<Width>8</Width>
36+
</PropertyDefn>
37+
<PropertyDefn>
38+
<Name>id</Name>
39+
<ElementPath>id</ElementPath>
40+
<Type>Integer</Type>
41+
</PropertyDefn>
42+
<PropertyDefn>
43+
<Name>id2</Name>
44+
<ElementPath>id2</ElementPath>
45+
<Type>Integer</Type>
46+
</PropertyDefn>
47+
</GMLFeatureClass>
48+
</GMLFeatureClassList>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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>3</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:join_by_location_intersect_first_only_discardnomatch fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:fid_2>points.0</ogr:fid_2>
21+
<ogr:id>1</ogr:id>
22+
<ogr:id2>2</ogr:id2>
23+
</ogr:join_by_location_intersect_first_only_discardnomatch>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:join_by_location_intersect_first_only_discardnomatch fid="polys.5">
27+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
28+
<ogr:name>elim</ogr:name>
29+
<ogr:intval>2</ogr:intval>
30+
<ogr:floatval>3.33</ogr:floatval>
31+
<ogr:fid_2>points.2</ogr:fid_2>
32+
<ogr:id>3</ogr:id>
33+
<ogr:id2>0</ogr:id2>
34+
</ogr:join_by_location_intersect_first_only_discardnomatch>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:join_by_location_intersect_first_only_discardnomatch fid="polys.3">
38+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
39+
<ogr:name>ASDF</ogr:name>
40+
<ogr:intval>0</ogr:intval>
41+
<ogr:fid_2>points.7</ogr:fid_2>
42+
<ogr:id>8</ogr:id>
43+
<ogr:id2>0</ogr:id2>
44+
</ogr:join_by_location_intersect_first_only_discardnomatch>
45+
</gml:featureMember>
46+
</ogr:FeatureCollection>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_intersect_subset_fields</Name>
4+
<ElementPath>join_by_location_intersect_subset_fields</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>10</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>6.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>id</Name>
33+
<ElementPath>id</ElementPath>
34+
<Type>Integer</Type>
35+
</PropertyDefn>
36+
</GMLFeatureClass>
37+
</GMLFeatureClassList>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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:join_by_location_intersect_subset_fields fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:id>1</ogr:id>
21+
</ogr:join_by_location_intersect_subset_fields>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:join_by_location_intersect_subset_fields fid="polys.0">
25+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
26+
<ogr:name>aaaaa</ogr:name>
27+
<ogr:intval>33</ogr:intval>
28+
<ogr:floatval>44.123456</ogr:floatval>
29+
<ogr:id>2</ogr:id>
30+
</ogr:join_by_location_intersect_subset_fields>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:join_by_location_intersect_subset_fields fid="polys.0">
34+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
35+
<ogr:name>aaaaa</ogr:name>
36+
<ogr:intval>33</ogr:intval>
37+
<ogr:floatval>44.123456</ogr:floatval>
38+
<ogr:id>3</ogr:id>
39+
</ogr:join_by_location_intersect_subset_fields>
40+
</gml:featureMember>
41+
<gml:featureMember>
42+
<ogr:join_by_location_intersect_subset_fields fid="polys.5">
43+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
44+
<ogr:name>elim</ogr:name>
45+
<ogr:intval>2</ogr:intval>
46+
<ogr:floatval>3.33</ogr:floatval>
47+
<ogr:id>3</ogr:id>
48+
</ogr:join_by_location_intersect_subset_fields>
49+
</gml:featureMember>
50+
<gml:featureMember>
51+
<ogr:join_by_location_intersect_subset_fields fid="polys.5">
52+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
53+
<ogr:name>elim</ogr:name>
54+
<ogr:intval>2</ogr:intval>
55+
<ogr:floatval>3.33</ogr:floatval>
56+
<ogr:id>5</ogr:id>
57+
</ogr:join_by_location_intersect_subset_fields>
58+
</gml:featureMember>
59+
<gml:featureMember>
60+
<ogr:join_by_location_intersect_subset_fields fid="polys.3">
61+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
62+
<ogr:name>ASDF</ogr:name>
63+
<ogr:intval>0</ogr:intval>
64+
<ogr:id>8</ogr:id>
65+
</ogr:join_by_location_intersect_subset_fields>
66+
</gml:featureMember>
67+
<gml:featureMember>
68+
<ogr:join_by_location_intersect_subset_fields fid="polys.0">
69+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
70+
<ogr:name>aaaaa</ogr:name>
71+
<ogr:intval>33</ogr:intval>
72+
<ogr:floatval>44.123456</ogr:floatval>
73+
<ogr:id>9</ogr:id>
74+
</ogr:join_by_location_intersect_subset_fields>
75+
</gml:featureMember>
76+
<gml:featureMember>
77+
<ogr:join_by_location_intersect_subset_fields fid="polys.1">
78+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
79+
<ogr:name>Aaaaa</ogr:name>
80+
<ogr:intval>-33</ogr:intval>
81+
<ogr:floatval>0</ogr:floatval>
82+
</ogr:join_by_location_intersect_subset_fields>
83+
</gml:featureMember>
84+
<gml:featureMember>
85+
<ogr:join_by_location_intersect_subset_fields fid="polys.2">
86+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
87+
<ogr:name>bbaaa</ogr:name>
88+
<ogr:floatval>0.123</ogr:floatval>
89+
</ogr:join_by_location_intersect_subset_fields>
90+
</gml:featureMember>
91+
<gml:featureMember>
92+
<ogr:join_by_location_intersect_subset_fields fid="polys.4">
93+
<ogr:intval>120</ogr:intval>
94+
<ogr:floatval>-100291.43213</ogr:floatval>
95+
</ogr:join_by_location_intersect_subset_fields>
96+
</gml:featureMember>
97+
</ogr:FeatureCollection>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>join_by_location_touches</Name>
4+
<ElementPath>join_by_location_touches</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>5</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>3.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>fid_2</Name>
33+
<ElementPath>fid_2</ElementPath>
34+
<Type>String</Type>
35+
<Width>8</Width>
36+
</PropertyDefn>
37+
<PropertyDefn>
38+
<Name>id</Name>
39+
<ElementPath>id</ElementPath>
40+
<Type>Integer</Type>
41+
</PropertyDefn>
42+
<PropertyDefn>
43+
<Name>id2</Name>
44+
<ElementPath>id2</ElementPath>
45+
<Type>Integer</Type>
46+
</PropertyDefn>
47+
</GMLFeatureClass>
48+
</GMLFeatureClassList>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
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>3</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:join_by_location_touches fid="polys.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:fid_2>points.1</ogr:fid_2>
21+
<ogr:id>2</ogr:id>
22+
<ogr:id2>1</ogr:id2>
23+
</ogr:join_by_location_touches>
24+
</gml:featureMember>
25+
<gml:featureMember>
26+
<ogr:join_by_location_touches fid="polys.0">
27+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
28+
<ogr:name>aaaaa</ogr:name>
29+
<ogr:intval>33</ogr:intval>
30+
<ogr:floatval>44.123456</ogr:floatval>
31+
<ogr:fid_2>points.2</ogr:fid_2>
32+
<ogr:id>3</ogr:id>
33+
<ogr:id2>0</ogr:id2>
34+
</ogr:join_by_location_touches>
35+
</gml:featureMember>
36+
<gml:featureMember>
37+
<ogr:join_by_location_touches fid="polys.5">
38+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
39+
<ogr:name>elim</ogr:name>
40+
<ogr:intval>2</ogr:intval>
41+
<ogr:floatval>3.33</ogr:floatval>
42+
<ogr:fid_2>points.2</ogr:fid_2>
43+
<ogr:id>3</ogr:id>
44+
<ogr:id2>0</ogr:id2>
45+
</ogr:join_by_location_touches>
46+
</gml:featureMember>
47+
<gml:featureMember>
48+
<ogr:join_by_location_touches fid="polys.3">
49+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
50+
<ogr:name>ASDF</ogr:name>
51+
<ogr:intval>0</ogr:intval>
52+
<ogr:fid_2>points.7</ogr:fid_2>
53+
<ogr:id>8</ogr:id>
54+
<ogr:id2>0</ogr:id2>
55+
</ogr:join_by_location_touches>
56+
</gml:featureMember>
57+
<gml:featureMember>
58+
<ogr:join_by_location_touches fid="polys.0">
59+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
60+
<ogr:name>aaaaa</ogr:name>
61+
<ogr:intval>33</ogr:intval>
62+
<ogr:floatval>44.123456</ogr:floatval>
63+
<ogr:fid_2>points.8</ogr:fid_2>
64+
<ogr:id>9</ogr:id>
65+
<ogr:id2>0</ogr:id2>
66+
</ogr:join_by_location_touches>
67+
</gml:featureMember>
68+
</ogr:FeatureCollection>

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

Lines changed: 158 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3623,4 +3623,161 @@ tests:
36233623
pk: date
36243624
compare:
36253625
fields:
3626-
fid: skip
3626+
fid: skip
3627+
3628+
- algorithm: qgis:joinattributesbylocation
3629+
name: Join by location (intersects)
3630+
params:
3631+
DISCARD_NONMATCHING: false
3632+
INPUT:
3633+
name: polys.gml
3634+
type: vector
3635+
JOIN:
3636+
name: custom/points.shp
3637+
type: vector
3638+
METHOD: 0
3639+
PREDICATE:
3640+
- 0
3641+
results:
3642+
OUTPUT:
3643+
name: expected/join_by_location_intersect.gml
3644+
type: vector
3645+
pk:
3646+
- name
3647+
- id
3648+
- id2
3649+
compare:
3650+
fields:
3651+
fid: skip
3652+
fid_2: skip
3653+
3654+
- algorithm: qgis:joinattributesbylocation
3655+
name: Join by location (intersects), discard no match
3656+
params:
3657+
DISCARD_NONMATCHING: true
3658+
INPUT:
3659+
name: polys.gml
3660+
type: vector
3661+
JOIN:
3662+
name: custom/points.shp
3663+
type: vector
3664+
METHOD: 0
3665+
PREDICATE:
3666+
- 0
3667+
results:
3668+
OUTPUT:
3669+
name: expected/join_by_location_intersect_discardnomatch.gml
3670+
type: vector
3671+
pk:
3672+
- name
3673+
- id
3674+
- id2
3675+
compare:
3676+
fields:
3677+
fid: skip
3678+
fid_2: skip
3679+
3680+
- algorithm: qgis:joinattributesbylocation
3681+
name: Join by location (intersects), first match only
3682+
params:
3683+
DISCARD_NONMATCHING: false
3684+
INPUT:
3685+
name: polys.gml
3686+
type: vector
3687+
JOIN:
3688+
name: custom/points.shp
3689+
type: vector
3690+
METHOD: 1
3691+
PREDICATE:
3692+
- 0
3693+
results:
3694+
OUTPUT:
3695+
name: expected/join_by_location_intersect_first_only.gml
3696+
type: vector
3697+
pk:
3698+
- name
3699+
compare:
3700+
fields:
3701+
fid: skip
3702+
fid_2: skip
3703+
id: skip # cant check these - order of match is not predictable
3704+
id2: skip
3705+
3706+
- algorithm: qgis:joinattributesbylocation
3707+
name: Join by location (intersects), first match only, discard no match
3708+
params:
3709+
DISCARD_NONMATCHING: true
3710+
INPUT:
3711+
name: expected/join_by_location_intersect_first_only.gml
3712+
type: vector
3713+
JOIN:
3714+
name: custom/points.shp
3715+
type: vector
3716+
METHOD: 1
3717+
PREDICATE:
3718+
- 0
3719+
results:
3720+
OUTPUT:
3721+
name: expected/join_by_location_intersect_first_only_discardnomatch.gml
3722+
type: vector
3723+
pk:
3724+
- name
3725+
compare:
3726+
fields:
3727+
fid: skip
3728+
fid_2: skip
3729+
id: skip # cant check these - order of match is not predictable
3730+
id2: skip
3731+
3732+
- algorithm: qgis:joinattributesbylocation
3733+
name: Join by location (intersects), subset of fields
3734+
params:
3735+
DISCARD_NONMATCHING: false
3736+
INPUT:
3737+
name: polys.gml
3738+
type: vector
3739+
JOIN:
3740+
name: custom/points.shp
3741+
type: vector
3742+
JOIN_FIELDS:
3743+
- id
3744+
METHOD: 0
3745+
PREDICATE:
3746+
- 0
3747+
results:
3748+
OUTPUT:
3749+
name: expected/join_by_location_intersect_subset_fields.gml
3750+
type: vector
3751+
pk:
3752+
- name
3753+
- id
3754+
compare:
3755+
fields:
3756+
fid: skip
3757+
fid_2: skip
3758+
3759+
- algorithm: qgis:joinattributesbylocation
3760+
name: Join by location (touches)
3761+
params:
3762+
DISCARD_NONMATCHING: true
3763+
INPUT:
3764+
name: polys.gml
3765+
type: vector
3766+
JOIN:
3767+
name: custom/points.shp
3768+
type: vector
3769+
METHOD: 0
3770+
PREDICATE:
3771+
- 3
3772+
results:
3773+
OUTPUT:
3774+
name: expected/join_by_location_touches.gml
3775+
type: vector
3776+
pk:
3777+
- name
3778+
- id
3779+
- id2
3780+
compare:
3781+
fields:
3782+
fid: skip
3783+
fid_2: skip

0 commit comments

Comments
 (0)
Please sign in to comment.