Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEATURE] explode hstore algorithm (#8212)
- Loading branch information
Showing
11 changed files
with
673 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
python/plugins/processing/tests/testdata/custom/hstore.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ hstore.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord> | ||
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:hstore fid="polys.0"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"restaurant","barrier"=>"wall","cuisine"=>"chinese","internet_access"=>"yes"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore fid="polys.1"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"fuel","building"=>"roof","name"=>"foo"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore fid="polys.2"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"building"=>"yes"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore fid="polys.3"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"restaurant","cuisine"=>"burger","name"=>"bar","operator"=>"foo"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore fid="polys.4"> | ||
<ogr:hstore>"amenity"=>"bank","atm"=>"yes"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore fid="polys.5"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"stars"=>"5","tourism"=>"hotel"</ogr:hstore> | ||
</ogr:hstore> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
30 changes: 30 additions & 0 deletions
30
python/plugins/processing/tests/testdata/custom/hstore.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="hstore" type="ogr:hstore_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="hstore_Type"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureType"> | ||
<xs:sequence> | ||
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> | ||
<xs:element name="hstore" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |
109 changes: 109 additions & 0 deletions
109
python/plugins/processing/tests/testdata/expected/hstore_all_keys.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ hstore_all_keys.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord> | ||
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.0"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"restaurant","barrier"=>"wall","cuisine"=>"chinese","internet_access"=>"yes"</ogr:hstore> | ||
<ogr:tourism xsi:nil="true"/> | ||
<ogr:stars xsi:nil="true"/> | ||
<ogr:atm xsi:nil="true"/> | ||
<ogr:operator xsi:nil="true"/> | ||
<ogr:name xsi:nil="true"/> | ||
<ogr:building xsi:nil="true"/> | ||
<ogr:internet_access>yes</ogr:internet_access> | ||
<ogr:cuisine>chinese</ogr:cuisine> | ||
<ogr:barrier>wall</ogr:barrier> | ||
<ogr:amenity>restaurant</ogr:amenity> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.1"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"fuel","building"=>"roof","name"=>"foo"</ogr:hstore> | ||
<ogr:tourism xsi:nil="true"/> | ||
<ogr:stars xsi:nil="true"/> | ||
<ogr:atm xsi:nil="true"/> | ||
<ogr:operator xsi:nil="true"/> | ||
<ogr:name>foo</ogr:name> | ||
<ogr:building>roof</ogr:building> | ||
<ogr:internet_access xsi:nil="true"/> | ||
<ogr:cuisine xsi:nil="true"/> | ||
<ogr:barrier xsi:nil="true"/> | ||
<ogr:amenity>fuel</ogr:amenity> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.2"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"building"=>"yes"</ogr:hstore> | ||
<ogr:tourism xsi:nil="true"/> | ||
<ogr:stars xsi:nil="true"/> | ||
<ogr:atm xsi:nil="true"/> | ||
<ogr:operator xsi:nil="true"/> | ||
<ogr:name xsi:nil="true"/> | ||
<ogr:building>yes</ogr:building> | ||
<ogr:internet_access xsi:nil="true"/> | ||
<ogr:cuisine xsi:nil="true"/> | ||
<ogr:barrier xsi:nil="true"/> | ||
<ogr:amenity xsi:nil="true"/> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.3"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"amenity"=>"restaurant","cuisine"=>"burger","name"=>"bar","operator"=>"foo"</ogr:hstore> | ||
<ogr:tourism xsi:nil="true"/> | ||
<ogr:stars xsi:nil="true"/> | ||
<ogr:atm xsi:nil="true"/> | ||
<ogr:operator>foo</ogr:operator> | ||
<ogr:name>bar</ogr:name> | ||
<ogr:building xsi:nil="true"/> | ||
<ogr:internet_access xsi:nil="true"/> | ||
<ogr:cuisine>burger</ogr:cuisine> | ||
<ogr:barrier xsi:nil="true"/> | ||
<ogr:amenity>restaurant</ogr:amenity> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.4"> | ||
<ogr:hstore>"amenity"=>"bank","atm"=>"yes"</ogr:hstore> | ||
<ogr:tourism xsi:nil="true"/> | ||
<ogr:stars xsi:nil="true"/> | ||
<ogr:atm>yes</ogr:atm> | ||
<ogr:operator xsi:nil="true"/> | ||
<ogr:name xsi:nil="true"/> | ||
<ogr:building xsi:nil="true"/> | ||
<ogr:internet_access xsi:nil="true"/> | ||
<ogr:cuisine xsi:nil="true"/> | ||
<ogr:barrier xsi:nil="true"/> | ||
<ogr:amenity>bank</ogr:amenity> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:hstore_all_keys fid="polys.5"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:hstore>"stars"=>"5","tourism"=>"hotel"</ogr:hstore> | ||
<ogr:tourism>hotel</ogr:tourism> | ||
<ogr:stars>5</ogr:stars> | ||
<ogr:atm xsi:nil="true"/> | ||
<ogr:operator xsi:nil="true"/> | ||
<ogr:name xsi:nil="true"/> | ||
<ogr:building xsi:nil="true"/> | ||
<ogr:internet_access xsi:nil="true"/> | ||
<ogr:cuisine xsi:nil="true"/> | ||
<ogr:barrier xsi:nil="true"/> | ||
<ogr:amenity xsi:nil="true"/> | ||
</ogr:hstore_all_keys> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
100 changes: 100 additions & 0 deletions
100
python/plugins/processing/tests/testdata/expected/hstore_all_keys.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?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="hstore_all_keys" type="ogr:hstore_all_keys_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="hstore_all_keys_Type"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureType"> | ||
<xs:sequence> | ||
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> | ||
<xs:element name="hstore" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="tourism" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="stars" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="atm" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="operator" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</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="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="building" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="internet_access" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="cuisine" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="barrier" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
<xs:element name="amenity" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:maxLength value="255"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |
Oops, something went wrong.