Skip to content
Permalink
Browse files

Merge 8ac4e6f into cherry-pick-backport-9662-to-release-3_6-17fcd0fa-…

…1105-4e76-89a0-a7ad7b0a73cd
  • Loading branch information
backporting committed Apr 1, 2019
2 parents b0de77f + 8ac4e6f commit 653f0ff5afb926ee1cfe706dc891d60c3e98fa45
@@ -275,9 +275,6 @@ def addField(original, stat, type):
features = source.getFeatures()
total = 100.0 / source.featureCount() if source.featureCount() else 0

# bounding box transform
bbox_transform = QgsCoordinateTransform(source.sourceCrs(), join_source.sourceCrs(), context.project())

for current, f in enumerate(features):
if feedback.isCanceled():
break
@@ -294,12 +291,11 @@ def addField(original, stat, type):
sink.addFeature(f, QgsFeatureSink.FastInsert)
continue

bbox = bbox_transform.transformBoundingBox(f.geometry().boundingBox())
engine = None

values = []

request = QgsFeatureRequest().setFilterRect(bbox).setSubsetOfAttributes(join_field_indexes).setDestinationCrs(source.sourceCrs(), context.transformContext())
request = QgsFeatureRequest().setFilterRect(f.geometry().boundingBox()).setSubsetOfAttributes(join_field_indexes).setDestinationCrs(source.sourceCrs(), context.transformContext())
for test_feat in join_source.getFeatures(request):
if feedback.isCanceled():
break
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ line_3857.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-170142.2790295565</gml:X><gml:Y>-601233.6051123593</gml:Y></gml:coord>
<gml:coord><gml:X>1198122.331412013</gml:X><gml:Y>487793.1282708889</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:line_3857 fid="line_3857.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>193303.008118985,455636.648094066 67700.5927073567,337822.202907407 40976.6745346706,33011.8416339877 -44539.8636179277,-303824.512095835 -170142.279029556,-309175.468327608</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>5</ogr:val>
</ogr:line_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:line_3857 fid="line_3857.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>-63246.6063388065,487793.128270889 -33850.2963488532,142591.63526526</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>4</ogr:val>
</ogr:line_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:line_3857 fid="line_3857.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>67700.5927073567,-368051.169570389 78390.1599764311,-23108.5844752597 300198.680809733,-47160.4899983067 628902.874333781,254888.031682493</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>8</ogr:val>
</ogr:line_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:line_3857 fid="line_3857.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>733126.155207261,57063.981869392 1016399.68783774,54391.4880260408</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>7</ogr:val>
</ogr:line_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:line_3857 fid="line_3857.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>992348.161482323,262911.813488384 1198122.33141201,-263698.89064191</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>2</ogr:val>
</ogr:line_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:line_3857 fid="line_3857.5">
<ogr:geometryProperty><gml:LineString srsName="EPSG:3857"><gml:coordinates>882780.096974306,-601233.605112359 762522.465197217,-440351.072066794 1024416.86328955,-263698.89064191</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:val>1</ogr:val>
</ogr:line_3857>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,30 @@
<?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="line_3857" type="ogr:line_3857_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="line_3857_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:LineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="val" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ points_3857.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0</gml:X><gml:Y>-557305.2572745769</gml:Y></gml:coord>
<gml:coord><gml:X>890555.9263461898</gml:X><gml:Y>334111.1714019597</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:points_3857 fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>111319.490793272,111325.142866385</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>333958.47237982,334111.17140196</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>222638.981586547,222684.208505545</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>556597.453966367,222684.208505545</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>445277.963173095,111325.142866385</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>0.0,-557305.257274577</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>890555.92634619,-111325.142866386</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>779236.435552915,-111325.142866386</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
<gml:featureMember>
<ogr:points_3857 fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:3857"><gml:coordinates>0.0,-111325.142866386</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:points_3857>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,37 @@
<?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="points_3857" type="ogr:points_3857_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="points_3857_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="id" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:long">
<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:long">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

0 comments on commit 653f0ff

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