mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
fix non-default field order in join bys
This commit is contained in:
parent
df64196854
commit
ea374ff4c3
127
python/plugins/processing/tests/testdata/expected/join_attributes_subset_ordered.gml
vendored
Normal file
127
python/plugins/processing/tests/testdata/expected/join_attributes_subset_ordered.gml
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
gml:id="aFeatureCollection"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ join_attributes_subset_ordered.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml/3.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>3 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.0">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 1</gml:lowerCorner><gml:upperCorner>1 1</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.0"><gml:pos>1 1</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.0</ogr:fid>
|
||||
<ogr:id>1</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:fid_2>airports.0</ogr:fid_2>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:ELEV>78</ogr:ELEV>
|
||||
<ogr:NAME>NOATAK</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.1">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>3 3</gml:lowerCorner><gml:upperCorner>3 3</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.1"><gml:pos>3 3</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.1</ogr:fid>
|
||||
<ogr:id>2</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:fid_2>airports.1</ogr:fid_2>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:ELEV>264</ogr:ELEV>
|
||||
<ogr:NAME>AMBLER</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 2</gml:lowerCorner><gml:upperCorner>2 2</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.2"><gml:pos>2 2</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.2</ogr:fid>
|
||||
<ogr:id>3</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:fid_2>airports.2</ogr:fid_2>
|
||||
<ogr:fk_region>26</ogr:fk_region>
|
||||
<ogr:ELEV>585</ogr:ELEV>
|
||||
<ogr:NAME>BETTLES</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.3">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 5</gml:lowerCorner><gml:upperCorner>2 5</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.3"><gml:pos>2 5</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.3</ogr:fid>
|
||||
<ogr:id>4</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:fid_2>airports.3</ogr:fid_2>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:ELEV>9</ogr:ELEV>
|
||||
<ogr:NAME>RALPH WIEN MEM</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.4">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 4</gml:lowerCorner><gml:upperCorner>1 4</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.4"><gml:pos>1 4</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.4</ogr:fid>
|
||||
<ogr:id>5</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:fid_2>airports.4</ogr:fid_2>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:ELEV>21</ogr:ELEV>
|
||||
<ogr:NAME>SELAWIK</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.5">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>-5 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.5"><gml:pos>-5 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.5</ogr:fid>
|
||||
<ogr:id>6</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:fid_2>airports.5</ogr:fid_2>
|
||||
<ogr:fk_region>26</ogr:fk_region>
|
||||
<ogr:ELEV>1113</ogr:ELEV>
|
||||
<ogr:NAME>INDIAN MOUNTAIN LRRS</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.6">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 8</gml:lowerCorner><gml:upperCorner>-1 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.6"><gml:pos>-1 8</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.6</ogr:fid>
|
||||
<ogr:id>7</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:fid_2>airports.6</ogr:fid_2>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:ELEV>21</ogr:ELEV>
|
||||
<ogr:NAME>BUCKLAND</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.7">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 7</gml:lowerCorner><gml:upperCorner>-1 7</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.7"><gml:pos>-1 7</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.7</ogr:fid>
|
||||
<ogr:id>8</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:fid_2>airports.7</ogr:fid_2>
|
||||
<ogr:fk_region>16</ogr:fk_region>
|
||||
<ogr:ELEV>243</ogr:ELEV>
|
||||
<ogr:NAME>TIN CITY LRRS</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_ordered gml:id="join_attributes_subset_ordered.8">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 0</gml:lowerCorner><gml:upperCorner>-1 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_ordered.geom.8"><gml:pos>-1 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.8</ogr:fid>
|
||||
<ogr:id>9</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:fid_2>airports.8</ogr:fid_2>
|
||||
<ogr:fk_region>16</ogr:fk_region>
|
||||
<ogr:ELEV>1329</ogr:ELEV>
|
||||
<ogr:NAME>GRANITE MOUNTAIN AFS</ogr:NAME>
|
||||
</ogr:join_attributes_subset_ordered>
|
||||
</ogr:featureMember>
|
||||
</ogr:FeatureCollection>
|
93
python/plugins/processing/tests/testdata/expected/join_attributes_subset_ordered.xsd
vendored
Normal file
93
python/plugins/processing/tests/testdata/expected/join_attributes_subset_ordered.xsd
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
<?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/3.2"
|
||||
xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
|
||||
elementFormDefault="qualified"
|
||||
version="1.0">
|
||||
<xs:annotation>
|
||||
<xs:appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
|
||||
<gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
|
||||
<xs:import namespace="http://www.opengis.net/gmlsf/2.0" schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="featureMember">
|
||||
<xs:complexType>
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureMemberType">
|
||||
<xs:sequence>
|
||||
<xs:element ref="gml:AbstractFeature"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="join_attributes_subset_ordered" type="ogr:join_attributes_subset_ordered_Type" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="join_attributes_subset_ordered_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/><!-- srsName="urn:ogc:def:crs:EPSG::4326" -->
|
||||
<xs:element name="fid" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="id" 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="id2" 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="fid_2" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="fk_region" 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="ELEV" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="NAME" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="26"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
127
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.gml
vendored
Normal file
127
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.gml
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
gml:id="aFeatureCollection"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ join_attributes_subset_unordered.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml/3.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>3 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.0">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 1</gml:lowerCorner><gml:upperCorner>1 1</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.0"><gml:pos>1 1</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.0</ogr:fid>
|
||||
<ogr:id>1</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:ELEV>78</ogr:ELEV>
|
||||
<ogr:NAME>NOATAK</ogr:NAME>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:fid_2>airports.0</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.1">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>3 3</gml:lowerCorner><gml:upperCorner>3 3</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.1"><gml:pos>3 3</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.1</ogr:fid>
|
||||
<ogr:id>2</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:ELEV>264</ogr:ELEV>
|
||||
<ogr:NAME>AMBLER</ogr:NAME>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:fid_2>airports.1</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 2</gml:lowerCorner><gml:upperCorner>2 2</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.2"><gml:pos>2 2</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.2</ogr:fid>
|
||||
<ogr:id>3</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:ELEV>585</ogr:ELEV>
|
||||
<ogr:NAME>BETTLES</ogr:NAME>
|
||||
<ogr:fk_region>26</ogr:fk_region>
|
||||
<ogr:fid_2>airports.2</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.3">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 5</gml:lowerCorner><gml:upperCorner>2 5</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.3"><gml:pos>2 5</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.3</ogr:fid>
|
||||
<ogr:id>4</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:ELEV>9</ogr:ELEV>
|
||||
<ogr:NAME>RALPH WIEN MEM</ogr:NAME>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:fid_2>airports.3</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.4">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 4</gml:lowerCorner><gml:upperCorner>1 4</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.4"><gml:pos>1 4</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.4</ogr:fid>
|
||||
<ogr:id>5</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:ELEV>21</ogr:ELEV>
|
||||
<ogr:NAME>SELAWIK</ogr:NAME>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:fid_2>airports.4</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.5">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>-5 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.5"><gml:pos>-5 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.5</ogr:fid>
|
||||
<ogr:id>6</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:ELEV>1113</ogr:ELEV>
|
||||
<ogr:NAME>INDIAN MOUNTAIN LRRS</ogr:NAME>
|
||||
<ogr:fk_region>26</ogr:fk_region>
|
||||
<ogr:fid_2>airports.5</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.6">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 8</gml:lowerCorner><gml:upperCorner>-1 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.6"><gml:pos>-1 8</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.6</ogr:fid>
|
||||
<ogr:id>7</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:ELEV>21</ogr:ELEV>
|
||||
<ogr:NAME>BUCKLAND</ogr:NAME>
|
||||
<ogr:fk_region>18</ogr:fk_region>
|
||||
<ogr:fid_2>airports.6</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.7">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 7</gml:lowerCorner><gml:upperCorner>-1 7</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.7"><gml:pos>-1 7</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.7</ogr:fid>
|
||||
<ogr:id>8</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:ELEV>243</ogr:ELEV>
|
||||
<ogr:NAME>TIN CITY LRRS</ogr:NAME>
|
||||
<ogr:fk_region>16</ogr:fk_region>
|
||||
<ogr:fid_2>airports.7</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:join_attributes_subset_unordered gml:id="join_attributes_subset_unordered.8">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 0</gml:lowerCorner><gml:upperCorner>-1 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="join_attributes_subset_unordered.geom.8"><gml:pos>-1 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.8</ogr:fid>
|
||||
<ogr:id>9</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:ELEV>1329</ogr:ELEV>
|
||||
<ogr:NAME>GRANITE MOUNTAIN AFS</ogr:NAME>
|
||||
<ogr:fk_region>16</ogr:fk_region>
|
||||
<ogr:fid_2>airports.8</ogr:fid_2>
|
||||
</ogr:join_attributes_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
</ogr:FeatureCollection>
|
27
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.qmd
vendored
Normal file
27
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.qmd
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis version="3.37.0-Master">
|
||||
<identifier></identifier>
|
||||
<parentidentifier></parentidentifier>
|
||||
<language></language>
|
||||
<type></type>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<links/>
|
||||
<dates/>
|
||||
<fees></fees>
|
||||
<encoding></encoding>
|
||||
<crs>
|
||||
<spatialrefsys nativeFormat="Wkt">
|
||||
<wkt></wkt>
|
||||
<proj4></proj4>
|
||||
<srsid>0</srsid>
|
||||
<srid>0</srid>
|
||||
<authid></authid>
|
||||
<description></description>
|
||||
<projectionacronym></projectionacronym>
|
||||
<ellipsoidacronym></ellipsoidacronym>
|
||||
<geographicflag>false</geographicflag>
|
||||
</spatialrefsys>
|
||||
</crs>
|
||||
<extent/>
|
||||
</qgis>
|
93
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.xsd
vendored
Normal file
93
python/plugins/processing/tests/testdata/expected/join_attributes_subset_unordered.xsd
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
<?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/3.2"
|
||||
xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
|
||||
elementFormDefault="qualified"
|
||||
version="1.0">
|
||||
<xs:annotation>
|
||||
<xs:appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
|
||||
<gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
|
||||
<xs:import namespace="http://www.opengis.net/gmlsf/2.0" schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="featureMember">
|
||||
<xs:complexType>
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureMemberType">
|
||||
<xs:sequence>
|
||||
<xs:element ref="gml:AbstractFeature"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="join_attributes_subset_unordered" type="ogr:join_attributes_subset_unordered_Type" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="join_attributes_subset_unordered_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/><!-- srsName="urn:ogc:def:crs:EPSG::4326" -->
|
||||
<xs:element name="fid" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="id" 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="id2" 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="ELEV" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="NAME" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="26"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="fk_region" 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="fid_2" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
181
python/plugins/processing/tests/testdata/expected/nearest_field_subset_unordered.gml
vendored
Normal file
181
python/plugins/processing/tests/testdata/expected/nearest_field_subset_unordered.gml
vendored
Normal file
@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
gml:id="aFeatureCollection"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ nearest_field_subset_unordered.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml/3.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>3 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.0">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 1</gml:lowerCorner><gml:upperCorner>1 1</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.0"><gml:pos>1 1</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.0</ogr:fid>
|
||||
<ogr:id>1</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>143.164179420743</ogr:distance>
|
||||
<ogr:feature_x>1</ogr:feature_x>
|
||||
<ogr:feature_y>1</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.1">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>3 3</gml:lowerCorner><gml:upperCorner>3 3</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.1"><gml:pos>3 3</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.1</ogr:fid>
|
||||
<ogr:id>2</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>144.284792930099</ogr:distance>
|
||||
<ogr:feature_x>3</ogr:feature_x>
|
||||
<ogr:feature_y>3</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.2">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 2</gml:lowerCorner><gml:upperCorner>2 2</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.2"><gml:pos>2 2</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.2</ogr:fid>
|
||||
<ogr:id>3</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>143.718620470863</ogr:distance>
|
||||
<ogr:feature_x>2</ogr:feature_x>
|
||||
<ogr:feature_y>2</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.3">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>2 5</gml:lowerCorner><gml:upperCorner>2 5</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.3"><gml:pos>2 5</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.3</ogr:fid>
|
||||
<ogr:id>4</ogr:id>
|
||||
<ogr:id2>2</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>146.511007370441</ogr:distance>
|
||||
<ogr:feature_x>5</ogr:feature_x>
|
||||
<ogr:feature_y>2</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.4">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1 4</gml:lowerCorner><gml:upperCorner>1 4</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.4"><gml:pos>1 4</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.4</ogr:fid>
|
||||
<ogr:id>5</ogr:id>
|
||||
<ogr:id2>1</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>145.946619282078</ogr:distance>
|
||||
<ogr:feature_x>4</ogr:feature_x>
|
||||
<ogr:feature_y>1</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.5">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5 0</gml:lowerCorner><gml:upperCorner>-5 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.5"><gml:pos>-5 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.5</ogr:fid>
|
||||
<ogr:id>6</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>144.624849231736</ogr:distance>
|
||||
<ogr:feature_x>0</ogr:feature_x>
|
||||
<ogr:feature_y>-5</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.6">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 8</gml:lowerCorner><gml:upperCorner>-1 8</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.6"><gml:pos>-1 8</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.6</ogr:fid>
|
||||
<ogr:id>7</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>150.403335400207</ogr:distance>
|
||||
<ogr:feature_x>8</ogr:feature_x>
|
||||
<ogr:feature_y>-1</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.7">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 7</gml:lowerCorner><gml:upperCorner>-1 7</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.7"><gml:pos>-1 7</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.7</ogr:fid>
|
||||
<ogr:id>8</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>149.4758135261</ogr:distance>
|
||||
<ogr:feature_x>7</ogr:feature_x>
|
||||
<ogr:feature_y>-1</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
<ogr:featureMember>
|
||||
<ogr:nearest_field_subset_unordered gml:id="nearest_field_subset_unordered.8">
|
||||
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 0</gml:lowerCorner><gml:upperCorner>-1 0</gml:upperCorner></gml:Envelope></gml:boundedBy>
|
||||
<ogr:geometryProperty><gml:Point srsName="urn:ogc:def:crs:EPSG::4326" gml:id="nearest_field_subset_unordered.geom.8"><gml:pos>-1 0</gml:pos></gml:Point></ogr:geometryProperty>
|
||||
<ogr:fid>points.8</ogr:fid>
|
||||
<ogr:id>9</ogr:id>
|
||||
<ogr:id2>0</ogr:id2>
|
||||
<ogr:USE>Other</ogr:USE>
|
||||
<ogr:NAME>ANNETTE ISLAND</ogr:NAME>
|
||||
<ogr:fk_region>19</ogr:fk_region>
|
||||
<ogr:ELEV>108</ogr:ELEV>
|
||||
<ogr:n>1</ogr:n>
|
||||
<ogr:distance>143.010515479685</ogr:distance>
|
||||
<ogr:feature_x>0</ogr:feature_x>
|
||||
<ogr:feature_y>-1</ogr:feature_y>
|
||||
<ogr:nearest_x>-131.572235108872</ogr:nearest_x>
|
||||
<ogr:nearest_y>55.0424346921242</ogr:nearest_y>
|
||||
</ogr:nearest_field_subset_unordered>
|
||||
</ogr:featureMember>
|
||||
</ogr:FeatureCollection>
|
131
python/plugins/processing/tests/testdata/expected/nearest_field_subset_unordered.xsd
vendored
Normal file
131
python/plugins/processing/tests/testdata/expected/nearest_field_subset_unordered.xsd
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
<?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/3.2"
|
||||
xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
|
||||
elementFormDefault="qualified"
|
||||
version="1.0">
|
||||
<xs:annotation>
|
||||
<xs:appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
|
||||
<gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
|
||||
<xs:import namespace="http://www.opengis.net/gmlsf/2.0" schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="featureMember">
|
||||
<xs:complexType>
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureMemberType">
|
||||
<xs:sequence>
|
||||
<xs:element ref="gml:AbstractFeature"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="nearest_field_subset_unordered" type="ogr:nearest_field_subset_unordered_Type" substitutionGroup="gml:AbstractFeature"/>
|
||||
<xs:complexType name="nearest_field_subset_unordered_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/><!-- srsName="urn:ogc:def:crs:EPSG::4326" -->
|
||||
<xs:element name="fid" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="id" 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="id2" 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="USE" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="23"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="NAME" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="26"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="fk_region" 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="ELEV" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="n" 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="distance" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="feature_x" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="feature_y" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="nearest_x" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="nearest_y" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
@ -2554,6 +2554,27 @@ tests:
|
||||
name: expected/join_to_nearest_no_matches.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: native:joinbynearest
|
||||
name: Join by nearest field unordered
|
||||
params:
|
||||
INPUT:
|
||||
name: points.gml|layername=points
|
||||
type: vector
|
||||
INPUT_2:
|
||||
name: airports.gml|layername=airports
|
||||
type: vector
|
||||
NEIGHBORS: 1
|
||||
PREFIX: ''
|
||||
FIELDS_TO_COPY:
|
||||
- USE
|
||||
- NAME
|
||||
- fk_region
|
||||
- ELEV
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/nearest_field_subset_unordered.gml
|
||||
type: vector
|
||||
|
||||
- name: Generate XYZ tiles (Directory)
|
||||
algorithm: qgis:tilesxyzdirectory
|
||||
project: ../../../../../tests/testdata/xyztiles.qgs
|
||||
@ -3273,4 +3294,52 @@ tests:
|
||||
name: expected/join_attributes_table_issue_47650.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: native:joinbyattributes
|
||||
name: Join by nearest ordered field subet
|
||||
params:
|
||||
DISCARD_NONMATCHING: true
|
||||
FIELD: id
|
||||
FIELDS_TO_COPY:
|
||||
- fid
|
||||
- fk_region
|
||||
- ELEV
|
||||
- NAME
|
||||
FIELD_2: ID
|
||||
INPUT:
|
||||
name: points.gml|layername=points
|
||||
type: vector
|
||||
INPUT_2:
|
||||
name: airports.gml|layername=airports
|
||||
type: vector
|
||||
METHOD: 1
|
||||
PREFIX: ''
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/join_attributes_subset_ordered.gml
|
||||
type: vector
|
||||
|
||||
|
||||
- algorithm: native:joinbyattributes
|
||||
name: Join by nearest unordered field subset
|
||||
params:
|
||||
DISCARD_NONMATCHING: true
|
||||
FIELD: id
|
||||
FIELDS_TO_COPY:
|
||||
- ELEV
|
||||
- NAME
|
||||
- fk_region
|
||||
- fid
|
||||
FIELD_2: ID
|
||||
INPUT:
|
||||
name: points.gml|layername=points
|
||||
type: vector
|
||||
INPUT_2:
|
||||
name: airports.gml|layername=airports
|
||||
type: vector
|
||||
METHOD: 1
|
||||
PREFIX: ''
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/join_attributes_subset_unordered.gml
|
||||
type: vector
|
||||
# See ../README.md for a description of the file format
|
||||
|
@ -197,12 +197,10 @@ QVariantMap QgsJoinByAttributeAlgorithm::processAlgorithm( const QVariantMap &pa
|
||||
|
||||
// only keep selected attributes
|
||||
QgsAttributes attributes;
|
||||
const int attributeCount = feat.attributeCount();
|
||||
for ( int j = 0; j < attributeCount; ++j )
|
||||
QList<int>::const_iterator fieldItr;
|
||||
for ( fieldItr = fields2Indices.constBegin(); fieldItr != fields2Indices.constEnd(); ++fieldItr )
|
||||
{
|
||||
if ( !fields2Indices.contains( j ) )
|
||||
continue;
|
||||
attributes << feat.attribute( j );
|
||||
attributes << feat.attribute( *fieldItr );
|
||||
}
|
||||
|
||||
input2AttributeCache.insert( feat.attribute( joinField2Index ), attributes );
|
||||
|
@ -202,12 +202,10 @@ QVariantMap QgsJoinByNearestAlgorithm::processAlgorithm( const QVariantMap ¶
|
||||
|
||||
// only keep selected attributes
|
||||
QgsAttributes attributes;
|
||||
const int attributeCount = f.attributeCount();
|
||||
for ( int j = 0; j < attributeCount; ++j )
|
||||
QList<int>::const_iterator fieldItr;
|
||||
for ( fieldItr = fields2Indices.constBegin(); fieldItr != fields2Indices.constEnd(); ++fieldItr )
|
||||
{
|
||||
if ( ! fields2Indices.contains( j ) )
|
||||
continue;
|
||||
attributes << f.attribute( j );
|
||||
attributes << f.attribute( *fieldItr );
|
||||
}
|
||||
input2AttributeCache.insert( f.id(), attributes );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user