Unit tests for reomve duplicates by attribute

This commit is contained in:
Nyall Dawson 2018-10-31 14:11:17 +10:00
parent 4e9da6f190
commit 4dd3e211e2
11 changed files with 548 additions and 0 deletions

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ duplicate_attributes.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>1</ogr:num_field1>
<ogr:num_field2 xsi:nil="true"/>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2>val2</ogr:text_field2>
</ogr:duplicate_attributes>
</gml:featureMember>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1 xsi:nil="true"/>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2 xsi:nil="true"/>
</ogr:duplicate_attributes>
</gml:featureMember>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>3</ogr:num_field1>
<ogr:num_field2>1</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>val1</ogr:text_field2>
</ogr:duplicate_attributes>
</gml:featureMember>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>99</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>1</ogr:text_field2>
</ogr:duplicate_attributes>
</gml:featureMember>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>99</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>1</ogr:text_field2>
</ogr:duplicate_attributes>
</gml:featureMember>
<gml:featureMember>
<ogr:duplicate_attributes fid="duplicate_attributes.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>7</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>VAL1</ogr:text_field>
<ogr:text_field2>VAL2</ogr:text_field2>
</ogr:duplicate_attributes>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="duplicate_attributes" type="ogr:duplicate_attributes_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="duplicate_attributes_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="num_field1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ remove_duplicates1.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:remove_duplicates1 fid="duplicate_attributes.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>1</ogr:num_field1>
<ogr:num_field2 xsi:nil="true"/>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2>val2</ogr:text_field2>
</ogr:remove_duplicates1>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates1 fid="duplicate_attributes.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1 xsi:nil="true"/>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2 xsi:nil="true"/>
</ogr:remove_duplicates1>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates1 fid="duplicate_attributes.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>3</ogr:num_field1>
<ogr:num_field2>1</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>val1</ogr:text_field2>
</ogr:remove_duplicates1>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates1 fid="duplicate_attributes.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>99</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>1</ogr:text_field2>
</ogr:remove_duplicates1>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates1 fid="duplicate_attributes.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>7</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>VAL1</ogr:text_field>
<ogr:text_field2>VAL2</ogr:text_field2>
</ogr:remove_duplicates1>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="remove_duplicates1" type="ogr:remove_duplicates1_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="remove_duplicates1_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="num_field1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ remove_duplicates2.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
<gml:coord><gml:X>-17</gml:X><gml:Y>-12</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:remove_duplicates2 fid="duplicate_attributes.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>1</ogr:num_field1>
<ogr:num_field2 xsi:nil="true"/>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2>val2</ogr:text_field2>
</ogr:remove_duplicates2>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates2 fid="duplicate_attributes.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1 xsi:nil="true"/>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2 xsi:nil="true"/>
</ogr:remove_duplicates2>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates2 fid="duplicate_attributes.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>3</ogr:num_field1>
<ogr:num_field2>1</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>val1</ogr:text_field2>
</ogr:remove_duplicates2>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="remove_duplicates2" type="ogr:remove_duplicates2_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="remove_duplicates2_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="num_field1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ remove_duplicates3.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-18</gml:X><gml:Y>-14</gml:Y></gml:coord>
<gml:coord><gml:X>-16</gml:X><gml:Y>-12</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:remove_duplicates3 fid="duplicate_attributes.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>1</ogr:num_field1>
<ogr:num_field2 xsi:nil="true"/>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2>val2</ogr:text_field2>
</ogr:remove_duplicates3>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates3 fid="duplicate_attributes.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-12</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1 xsi:nil="true"/>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val1</ogr:text_field>
<ogr:text_field2 xsi:nil="true"/>
</ogr:remove_duplicates3>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates3 fid="duplicate_attributes.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>3</ogr:num_field1>
<ogr:num_field2>1</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>val1</ogr:text_field2>
</ogr:remove_duplicates3>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates3 fid="duplicate_attributes.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-17,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>99</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>1</ogr:text_field2>
</ogr:remove_duplicates3>
</gml:featureMember>
<gml:featureMember>
<ogr:remove_duplicates3 fid="duplicate_attributes.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-16,-14</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>7</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>VAL1</ogr:text_field>
<ogr:text_field2>VAL2</ogr:text_field2>
</ogr:remove_duplicates3>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="remove_duplicates3" type="ogr:remove_duplicates3_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="remove_duplicates3_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="num_field1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ remove_duplicates_dupes.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
<gml:coord><gml:X>-18</gml:X><gml:Y>-13</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:remove_duplicates_dupes fid="duplicate_attributes.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-18,-13</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:num_field1>99</ogr:num_field1>
<ogr:num_field2>2</ogr:num_field2>
<ogr:text_field>val2</ogr:text_field>
<ogr:text_field2>1</ogr:text_field2>
</ogr:remove_duplicates_dupes>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="remove_duplicates_dupes" type="ogr:remove_duplicates_dupes_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="remove_duplicates_dupes_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="num_field1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="num_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="text_field2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

View File

@ -6256,4 +6256,47 @@ tests:
fields:
path: skip
- algorithm: native:removeduplicatesbyattribute
name: Remove dupes by attribute 1
params:
FIELDS:
- num_field1
INPUT:
name: custom/duplicate_attributes.gml
type: vector
results:
OUTPUT:
name: expected/remove_duplicates1.gml
type: vector
- algorithm: native:removeduplicatesbyattribute
name: Remove dupes by attribute 2
params:
FIELDS:
- num_field2
INPUT:
name: custom/duplicate_attributes.gml
type: vector
results:
OUTPUT:
name: expected/remove_duplicates2.gml
type: vector
- algorithm: native:removeduplicatesbyattribute
name: Remove dupes by attribute 3
params:
FIELDS:
- num_field2
- text_field
INPUT:
name: custom/duplicate_attributes.gml
type: vector
results:
DUPLICATES:
name: expected/remove_duplicates_dupes.gml
type: vector
OUTPUT:
name: expected/remove_duplicates3.gml
type: vector
# See ../README.md for a description of the file format