Skip to content

Commit 6e16651

Browse files
Gustrynirvn
authored andcommittedNov 9, 2018
[FEATURE] explode hstore algorithm (#8212)
1 parent df81e55 commit 6e16651

File tree

11 files changed

+673
-0
lines changed

11 files changed

+673
-0
lines changed
 
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ hstore.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:hstore fid="polys.0">
16+
<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>
17+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;restaurant&quot;,&quot;barrier&quot;=&gt;&quot;wall&quot;,&quot;cuisine&quot;=&gt;&quot;chinese&quot;,&quot;internet_access&quot;=&gt;&quot;yes&quot;</ogr:hstore>
18+
</ogr:hstore>
19+
</gml:featureMember>
20+
<gml:featureMember>
21+
<ogr:hstore fid="polys.1">
22+
<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>
23+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;fuel&quot;,&quot;building&quot;=&gt;&quot;roof&quot;,&quot;name&quot;=&gt;&quot;foo&quot;</ogr:hstore>
24+
</ogr:hstore>
25+
</gml:featureMember>
26+
<gml:featureMember>
27+
<ogr:hstore fid="polys.2">
28+
<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>
29+
<ogr:hstore>&quot;building&quot;=&gt;&quot;yes&quot;</ogr:hstore>
30+
</ogr:hstore>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:hstore fid="polys.3">
34+
<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>
35+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;restaurant&quot;,&quot;cuisine&quot;=&gt;&quot;burger&quot;,&quot;name&quot;=&gt;&quot;bar&quot;,&quot;operator&quot;=&gt;&quot;foo&quot;</ogr:hstore>
36+
</ogr:hstore>
37+
</gml:featureMember>
38+
<gml:featureMember>
39+
<ogr:hstore fid="polys.4">
40+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;bank&quot;,&quot;atm&quot;=&gt;&quot;yes&quot;</ogr:hstore>
41+
</ogr:hstore>
42+
</gml:featureMember>
43+
<gml:featureMember>
44+
<ogr:hstore fid="polys.5">
45+
<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>
46+
<ogr:hstore>&quot;stars&quot;=&gt;&quot;5&quot;,&quot;tourism&quot;=&gt;&quot;hotel&quot;</ogr:hstore>
47+
</ogr:hstore>
48+
</gml:featureMember>
49+
</ogr:FeatureCollection>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="hstore" type="ogr:hstore_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="hstore_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="hstore" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:string">
22+
<xs:maxLength value="255"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
</xs:sequence>
27+
</xs:extension>
28+
</xs:complexContent>
29+
</xs:complexType>
30+
</xs:schema>
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ hstore_all_keys.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:hstore_all_keys fid="polys.0">
16+
<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>
17+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;restaurant&quot;,&quot;barrier&quot;=&gt;&quot;wall&quot;,&quot;cuisine&quot;=&gt;&quot;chinese&quot;,&quot;internet_access&quot;=&gt;&quot;yes&quot;</ogr:hstore>
18+
<ogr:tourism xsi:nil="true"/>
19+
<ogr:stars xsi:nil="true"/>
20+
<ogr:atm xsi:nil="true"/>
21+
<ogr:operator xsi:nil="true"/>
22+
<ogr:name xsi:nil="true"/>
23+
<ogr:building xsi:nil="true"/>
24+
<ogr:internet_access>yes</ogr:internet_access>
25+
<ogr:cuisine>chinese</ogr:cuisine>
26+
<ogr:barrier>wall</ogr:barrier>
27+
<ogr:amenity>restaurant</ogr:amenity>
28+
</ogr:hstore_all_keys>
29+
</gml:featureMember>
30+
<gml:featureMember>
31+
<ogr:hstore_all_keys fid="polys.1">
32+
<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>
33+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;fuel&quot;,&quot;building&quot;=&gt;&quot;roof&quot;,&quot;name&quot;=&gt;&quot;foo&quot;</ogr:hstore>
34+
<ogr:tourism xsi:nil="true"/>
35+
<ogr:stars xsi:nil="true"/>
36+
<ogr:atm xsi:nil="true"/>
37+
<ogr:operator xsi:nil="true"/>
38+
<ogr:name>foo</ogr:name>
39+
<ogr:building>roof</ogr:building>
40+
<ogr:internet_access xsi:nil="true"/>
41+
<ogr:cuisine xsi:nil="true"/>
42+
<ogr:barrier xsi:nil="true"/>
43+
<ogr:amenity>fuel</ogr:amenity>
44+
</ogr:hstore_all_keys>
45+
</gml:featureMember>
46+
<gml:featureMember>
47+
<ogr:hstore_all_keys fid="polys.2">
48+
<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>
49+
<ogr:hstore>&quot;building&quot;=&gt;&quot;yes&quot;</ogr:hstore>
50+
<ogr:tourism xsi:nil="true"/>
51+
<ogr:stars xsi:nil="true"/>
52+
<ogr:atm xsi:nil="true"/>
53+
<ogr:operator xsi:nil="true"/>
54+
<ogr:name xsi:nil="true"/>
55+
<ogr:building>yes</ogr:building>
56+
<ogr:internet_access xsi:nil="true"/>
57+
<ogr:cuisine xsi:nil="true"/>
58+
<ogr:barrier xsi:nil="true"/>
59+
<ogr:amenity xsi:nil="true"/>
60+
</ogr:hstore_all_keys>
61+
</gml:featureMember>
62+
<gml:featureMember>
63+
<ogr:hstore_all_keys fid="polys.3">
64+
<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>
65+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;restaurant&quot;,&quot;cuisine&quot;=&gt;&quot;burger&quot;,&quot;name&quot;=&gt;&quot;bar&quot;,&quot;operator&quot;=&gt;&quot;foo&quot;</ogr:hstore>
66+
<ogr:tourism xsi:nil="true"/>
67+
<ogr:stars xsi:nil="true"/>
68+
<ogr:atm xsi:nil="true"/>
69+
<ogr:operator>foo</ogr:operator>
70+
<ogr:name>bar</ogr:name>
71+
<ogr:building xsi:nil="true"/>
72+
<ogr:internet_access xsi:nil="true"/>
73+
<ogr:cuisine>burger</ogr:cuisine>
74+
<ogr:barrier xsi:nil="true"/>
75+
<ogr:amenity>restaurant</ogr:amenity>
76+
</ogr:hstore_all_keys>
77+
</gml:featureMember>
78+
<gml:featureMember>
79+
<ogr:hstore_all_keys fid="polys.4">
80+
<ogr:hstore>&quot;amenity&quot;=&gt;&quot;bank&quot;,&quot;atm&quot;=&gt;&quot;yes&quot;</ogr:hstore>
81+
<ogr:tourism xsi:nil="true"/>
82+
<ogr:stars xsi:nil="true"/>
83+
<ogr:atm>yes</ogr:atm>
84+
<ogr:operator xsi:nil="true"/>
85+
<ogr:name xsi:nil="true"/>
86+
<ogr:building xsi:nil="true"/>
87+
<ogr:internet_access xsi:nil="true"/>
88+
<ogr:cuisine xsi:nil="true"/>
89+
<ogr:barrier xsi:nil="true"/>
90+
<ogr:amenity>bank</ogr:amenity>
91+
</ogr:hstore_all_keys>
92+
</gml:featureMember>
93+
<gml:featureMember>
94+
<ogr:hstore_all_keys fid="polys.5">
95+
<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>
96+
<ogr:hstore>&quot;stars&quot;=&gt;&quot;5&quot;,&quot;tourism&quot;=&gt;&quot;hotel&quot;</ogr:hstore>
97+
<ogr:tourism>hotel</ogr:tourism>
98+
<ogr:stars>5</ogr:stars>
99+
<ogr:atm xsi:nil="true"/>
100+
<ogr:operator xsi:nil="true"/>
101+
<ogr:name xsi:nil="true"/>
102+
<ogr:building xsi:nil="true"/>
103+
<ogr:internet_access xsi:nil="true"/>
104+
<ogr:cuisine xsi:nil="true"/>
105+
<ogr:barrier xsi:nil="true"/>
106+
<ogr:amenity xsi:nil="true"/>
107+
</ogr:hstore_all_keys>
108+
</gml:featureMember>
109+
</ogr:FeatureCollection>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="hstore_all_keys" type="ogr:hstore_all_keys_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="hstore_all_keys_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
<xs:element name="hstore" nillable="true" minOccurs="0" maxOccurs="1">
20+
<xs:simpleType>
21+
<xs:restriction base="xs:string">
22+
<xs:maxLength value="255"/>
23+
</xs:restriction>
24+
</xs:simpleType>
25+
</xs:element>
26+
<xs:element name="tourism" nillable="true" minOccurs="0" maxOccurs="1">
27+
<xs:simpleType>
28+
<xs:restriction base="xs:string">
29+
<xs:maxLength value="255"/>
30+
</xs:restriction>
31+
</xs:simpleType>
32+
</xs:element>
33+
<xs:element name="stars" nillable="true" minOccurs="0" maxOccurs="1">
34+
<xs:simpleType>
35+
<xs:restriction base="xs:string">
36+
<xs:maxLength value="255"/>
37+
</xs:restriction>
38+
</xs:simpleType>
39+
</xs:element>
40+
<xs:element name="atm" nillable="true" minOccurs="0" maxOccurs="1">
41+
<xs:simpleType>
42+
<xs:restriction base="xs:string">
43+
<xs:maxLength value="255"/>
44+
</xs:restriction>
45+
</xs:simpleType>
46+
</xs:element>
47+
<xs:element name="operator" nillable="true" minOccurs="0" maxOccurs="1">
48+
<xs:simpleType>
49+
<xs:restriction base="xs:string">
50+
<xs:maxLength value="255"/>
51+
</xs:restriction>
52+
</xs:simpleType>
53+
</xs:element>
54+
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
55+
<xs:simpleType>
56+
<xs:restriction base="xs:string">
57+
<xs:maxLength value="255"/>
58+
</xs:restriction>
59+
</xs:simpleType>
60+
</xs:element>
61+
<xs:element name="building" nillable="true" minOccurs="0" maxOccurs="1">
62+
<xs:simpleType>
63+
<xs:restriction base="xs:string">
64+
<xs:maxLength value="255"/>
65+
</xs:restriction>
66+
</xs:simpleType>
67+
</xs:element>
68+
<xs:element name="internet_access" nillable="true" minOccurs="0" maxOccurs="1">
69+
<xs:simpleType>
70+
<xs:restriction base="xs:string">
71+
<xs:maxLength value="255"/>
72+
</xs:restriction>
73+
</xs:simpleType>
74+
</xs:element>
75+
<xs:element name="cuisine" nillable="true" minOccurs="0" maxOccurs="1">
76+
<xs:simpleType>
77+
<xs:restriction base="xs:string">
78+
<xs:maxLength value="255"/>
79+
</xs:restriction>
80+
</xs:simpleType>
81+
</xs:element>
82+
<xs:element name="barrier" nillable="true" minOccurs="0" maxOccurs="1">
83+
<xs:simpleType>
84+
<xs:restriction base="xs:string">
85+
<xs:maxLength value="255"/>
86+
</xs:restriction>
87+
</xs:simpleType>
88+
</xs:element>
89+
<xs:element name="amenity" nillable="true" minOccurs="0" maxOccurs="1">
90+
<xs:simpleType>
91+
<xs:restriction base="xs:string">
92+
<xs:maxLength value="255"/>
93+
</xs:restriction>
94+
</xs:simpleType>
95+
</xs:element>
96+
</xs:sequence>
97+
</xs:extension>
98+
</xs:complexContent>
99+
</xs:complexType>
100+
</xs:schema>

0 commit comments

Comments
 (0)