Skip to content

Commit 4dd3e21

Browse files
committedNov 1, 2018
Unit tests for reomve duplicates by attribute
1 parent 4e9da6f commit 4dd3e21

11 files changed

+548
-0
lines changed
 
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="http://ogr.maptools.org/ duplicate_attributes.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>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
10+
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:duplicate_attributes fid="duplicate_attributes.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:num_field1>1</ogr:num_field1>
18+
<ogr:num_field2 xsi:nil="true"/>
19+
<ogr:text_field>val1</ogr:text_field>
20+
<ogr:text_field2>val2</ogr:text_field2>
21+
</ogr:duplicate_attributes>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:duplicate_attributes fid="duplicate_attributes.1">
25+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
26+
<ogr:num_field1 xsi:nil="true"/>
27+
<ogr:num_field2>2</ogr:num_field2>
28+
<ogr:text_field>val1</ogr:text_field>
29+
<ogr:text_field2 xsi:nil="true"/>
30+
</ogr:duplicate_attributes>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:duplicate_attributes fid="duplicate_attributes.2">
34+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
35+
<ogr:num_field1>3</ogr:num_field1>
36+
<ogr:num_field2>1</ogr:num_field2>
37+
<ogr:text_field>val2</ogr:text_field>
38+
<ogr:text_field2>val1</ogr:text_field2>
39+
</ogr:duplicate_attributes>
40+
</gml:featureMember>
41+
<gml:featureMember>
42+
<ogr:duplicate_attributes fid="duplicate_attributes.3">
43+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
44+
<ogr:num_field1>99</ogr:num_field1>
45+
<ogr:num_field2>2</ogr:num_field2>
46+
<ogr:text_field>val2</ogr:text_field>
47+
<ogr:text_field2>1</ogr:text_field2>
48+
</ogr:duplicate_attributes>
49+
</gml:featureMember>
50+
<gml:featureMember>
51+
<ogr:duplicate_attributes fid="duplicate_attributes.4">
52+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
53+
<ogr:num_field1>99</ogr:num_field1>
54+
<ogr:num_field2>2</ogr:num_field2>
55+
<ogr:text_field>val2</ogr:text_field>
56+
<ogr:text_field2>1</ogr:text_field2>
57+
</ogr:duplicate_attributes>
58+
</gml:featureMember>
59+
<gml:featureMember>
60+
<ogr:duplicate_attributes fid="duplicate_attributes.5">
61+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
62+
<ogr:num_field1>7</ogr:num_field1>
63+
<ogr:num_field2>2</ogr:num_field2>
64+
<ogr:text_field>VAL1</ogr:text_field>
65+
<ogr:text_field2>VAL2</ogr:text_field2>
66+
</ogr:duplicate_attributes>
67+
</gml:featureMember>
68+
</ogr:FeatureCollection>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="duplicate_attributes" type="ogr:duplicate_attributes_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="duplicate_attributes_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:element name="num_field1" 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="num_field2" 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:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="30"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="30"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
</xs:sequence>
48+
</xs:extension>
49+
</xs:complexContent>
50+
</xs:complexType>
51+
</xs:schema>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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/ remove_duplicates1.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>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
10+
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:remove_duplicates1 fid="duplicate_attributes.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:num_field1>1</ogr:num_field1>
18+
<ogr:num_field2 xsi:nil="true"/>
19+
<ogr:text_field>val1</ogr:text_field>
20+
<ogr:text_field2>val2</ogr:text_field2>
21+
</ogr:remove_duplicates1>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:remove_duplicates1 fid="duplicate_attributes.1">
25+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
26+
<ogr:num_field1 xsi:nil="true"/>
27+
<ogr:num_field2>2</ogr:num_field2>
28+
<ogr:text_field>val1</ogr:text_field>
29+
<ogr:text_field2 xsi:nil="true"/>
30+
</ogr:remove_duplicates1>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:remove_duplicates1 fid="duplicate_attributes.2">
34+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
35+
<ogr:num_field1>3</ogr:num_field1>
36+
<ogr:num_field2>1</ogr:num_field2>
37+
<ogr:text_field>val2</ogr:text_field>
38+
<ogr:text_field2>val1</ogr:text_field2>
39+
</ogr:remove_duplicates1>
40+
</gml:featureMember>
41+
<gml:featureMember>
42+
<ogr:remove_duplicates1 fid="duplicate_attributes.3">
43+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
44+
<ogr:num_field1>99</ogr:num_field1>
45+
<ogr:num_field2>2</ogr:num_field2>
46+
<ogr:text_field>val2</ogr:text_field>
47+
<ogr:text_field2>1</ogr:text_field2>
48+
</ogr:remove_duplicates1>
49+
</gml:featureMember>
50+
<gml:featureMember>
51+
<ogr:remove_duplicates1 fid="duplicate_attributes.5">
52+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
53+
<ogr:num_field1>7</ogr:num_field1>
54+
<ogr:num_field2>2</ogr:num_field2>
55+
<ogr:text_field>VAL1</ogr:text_field>
56+
<ogr:text_field2>VAL2</ogr:text_field2>
57+
</ogr:remove_duplicates1>
58+
</gml:featureMember>
59+
</ogr:FeatureCollection>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="remove_duplicates1" type="ogr:remove_duplicates1_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="remove_duplicates1_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:element name="num_field1" 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="num_field2" 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:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="30"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="30"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
</xs:sequence>
48+
</xs:extension>
49+
</xs:complexContent>
50+
</xs:complexType>
51+
</xs:schema>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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/ remove_duplicates2.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>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
10+
<gml:coord><gml:X>-17</gml:X><gml:Y>-12</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:remove_duplicates2 fid="duplicate_attributes.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:num_field1>1</ogr:num_field1>
18+
<ogr:num_field2 xsi:nil="true"/>
19+
<ogr:text_field>val1</ogr:text_field>
20+
<ogr:text_field2>val2</ogr:text_field2>
21+
</ogr:remove_duplicates2>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:remove_duplicates2 fid="duplicate_attributes.1">
25+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
26+
<ogr:num_field1 xsi:nil="true"/>
27+
<ogr:num_field2>2</ogr:num_field2>
28+
<ogr:text_field>val1</ogr:text_field>
29+
<ogr:text_field2 xsi:nil="true"/>
30+
</ogr:remove_duplicates2>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:remove_duplicates2 fid="duplicate_attributes.2">
34+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
35+
<ogr:num_field1>3</ogr:num_field1>
36+
<ogr:num_field2>1</ogr:num_field2>
37+
<ogr:text_field>val2</ogr:text_field>
38+
<ogr:text_field2>val1</ogr:text_field2>
39+
</ogr:remove_duplicates2>
40+
</gml:featureMember>
41+
</ogr:FeatureCollection>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="remove_duplicates2" type="ogr:remove_duplicates2_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="remove_duplicates2_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:element name="num_field1" 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="num_field2" 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:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="30"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="30"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
</xs:sequence>
48+
</xs:extension>
49+
</xs:complexContent>
50+
</xs:complexType>
51+
</xs:schema>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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/ remove_duplicates3.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>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
10+
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:remove_duplicates3 fid="duplicate_attributes.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:num_field1>1</ogr:num_field1>
18+
<ogr:num_field2 xsi:nil="true"/>
19+
<ogr:text_field>val1</ogr:text_field>
20+
<ogr:text_field2>val2</ogr:text_field2>
21+
</ogr:remove_duplicates3>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:remove_duplicates3 fid="duplicate_attributes.1">
25+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
26+
<ogr:num_field1 xsi:nil="true"/>
27+
<ogr:num_field2>2</ogr:num_field2>
28+
<ogr:text_field>val1</ogr:text_field>
29+
<ogr:text_field2 xsi:nil="true"/>
30+
</ogr:remove_duplicates3>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:remove_duplicates3 fid="duplicate_attributes.2">
34+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
35+
<ogr:num_field1>3</ogr:num_field1>
36+
<ogr:num_field2>1</ogr:num_field2>
37+
<ogr:text_field>val2</ogr:text_field>
38+
<ogr:text_field2>val1</ogr:text_field2>
39+
</ogr:remove_duplicates3>
40+
</gml:featureMember>
41+
<gml:featureMember>
42+
<ogr:remove_duplicates3 fid="duplicate_attributes.3">
43+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
44+
<ogr:num_field1>99</ogr:num_field1>
45+
<ogr:num_field2>2</ogr:num_field2>
46+
<ogr:text_field>val2</ogr:text_field>
47+
<ogr:text_field2>1</ogr:text_field2>
48+
</ogr:remove_duplicates3>
49+
</gml:featureMember>
50+
<gml:featureMember>
51+
<ogr:remove_duplicates3 fid="duplicate_attributes.5">
52+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
53+
<ogr:num_field1>7</ogr:num_field1>
54+
<ogr:num_field2>2</ogr:num_field2>
55+
<ogr:text_field>VAL1</ogr:text_field>
56+
<ogr:text_field2>VAL2</ogr:text_field2>
57+
</ogr:remove_duplicates3>
58+
</gml:featureMember>
59+
</ogr:FeatureCollection>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="remove_duplicates3" type="ogr:remove_duplicates3_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="remove_duplicates3_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:element name="num_field1" 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="num_field2" 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:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="30"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="30"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
</xs:sequence>
48+
</xs:extension>
49+
</xs:complexContent>
50+
</xs:complexType>
51+
</xs:schema>
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+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ remove_duplicates_dupes.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>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
10+
<gml:coord><gml:X>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:remove_duplicates_dupes fid="duplicate_attributes.4">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:num_field1>99</ogr:num_field1>
18+
<ogr:num_field2>2</ogr:num_field2>
19+
<ogr:text_field>val2</ogr:text_field>
20+
<ogr:text_field2>1</ogr:text_field2>
21+
</ogr:remove_duplicates_dupes>
22+
</gml:featureMember>
23+
</ogr:FeatureCollection>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="remove_duplicates_dupes" type="ogr:remove_duplicates_dupes_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="remove_duplicates_dupes_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:element name="num_field1" 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="num_field2" 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:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="30"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="30"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
</xs:sequence>
48+
</xs:extension>
49+
</xs:complexContent>
50+
</xs:complexType>
51+
</xs:schema>

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6256,4 +6256,47 @@ tests:
62566256
fields:
62576257
path: skip
62586258

6259+
- algorithm: native:removeduplicatesbyattribute
6260+
name: Remove dupes by attribute 1
6261+
params:
6262+
FIELDS:
6263+
- num_field1
6264+
INPUT:
6265+
name: custom/duplicate_attributes.gml
6266+
type: vector
6267+
results:
6268+
OUTPUT:
6269+
name: expected/remove_duplicates1.gml
6270+
type: vector
6271+
6272+
- algorithm: native:removeduplicatesbyattribute
6273+
name: Remove dupes by attribute 2
6274+
params:
6275+
FIELDS:
6276+
- num_field2
6277+
INPUT:
6278+
name: custom/duplicate_attributes.gml
6279+
type: vector
6280+
results:
6281+
OUTPUT:
6282+
name: expected/remove_duplicates2.gml
6283+
type: vector
6284+
6285+
- algorithm: native:removeduplicatesbyattribute
6286+
name: Remove dupes by attribute 3
6287+
params:
6288+
FIELDS:
6289+
- num_field2
6290+
- text_field
6291+
INPUT:
6292+
name: custom/duplicate_attributes.gml
6293+
type: vector
6294+
results:
6295+
DUPLICATES:
6296+
name: expected/remove_duplicates_dupes.gml
6297+
type: vector
6298+
OUTPUT:
6299+
name: expected/remove_duplicates3.gml
6300+
type: vector
6301+
62596302
# See ../README.md for a description of the file format

0 commit comments

Comments
 (0)
Please sign in to comment.