-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI_v0.6.xsd
119 lines (109 loc) · 4.22 KB
/
API_v0.6.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8"?>
<!-- From http://forum.openstreetmap.org/viewtopic.php?id=7186 -->
<!-- Got xds file from https://github.com/oschrenk/gis-java/blob/master/lib/gis/formats/osm.io/src/main/resources/OSMSchema.xsd -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="osm">
<xs:complexType>
<xs:sequence>
<xs:element name="note" minOccurs="0"/> <!-- overpass api has this -->
<xs:element name="meta" minOccurs="0"/>
<xs:element ref="bounds" minOccurs="0"/> <!-- exactly once -->
<!-- the things above would be present on the Overpass API,
but we will accept anything with just nodes, ways and relations
-->
<xs:element ref="node" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="way" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="relation" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="version" type="xs:float" fixed="0.6"/>
<xs:attribute name="generator" type="xs:string" fixed="Overpass API"/>
<!-- <xs:attribute name="generator" type="xs:string"/> -->
</xs:complexType>
</xs:element>
<xs:element name="note" type="xs:string"/>
<xs:element name="meta">
<xs:complexType>
<xs:attribute name="osm_base" type="xs:dateTime"/>
</xs:complexType>
</xs:element>
<xs:element name="bounds">
<xs:complexType>
<xs:attribute name="minlat" type="xs:double"/>
<xs:attribute name="minlon" type="xs:double"/>
<xs:attribute name="maxlat" type="xs:double"/>
<xs:attribute name="maxlon" type="xs:double"/>
</xs:complexType>
</xs:element>
<xs:element name="node">
<xs:complexType>
<xs:sequence>
<xs:element ref="tag" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedLong"/>
<xs:attribute name="lat" type="xs:double"/>
<xs:attribute name="lon" type="xs:double"/>
<xs:attribute name="user" type="xs:string"/>
<xs:attribute name="uid" type="xs:unsignedLong"/>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="version" type="xs:unsignedLong"/>
<xs:attribute name="changeset" type="xs:unsignedLong"/>
<xs:attribute name="timestamp" type="xs:dateTime"/>
</xs:complexType>
</xs:element>
<xs:element name="way">
<xs:complexType>
<xs:sequence>
<xs:element ref="nd" minOccurs="2" maxOccurs="2000"/> <!-- /api/capabilities may change -->
<xs:element ref="tag" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedLong"/>
<xs:attribute name="user" type="xs:string"/>
<xs:attribute name="uid" type="xs:unsignedLong"/>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="version" type="xs:unsignedLong"/>
<xs:attribute name="changeset" type="xs:unsignedLong"/>
<xs:attribute name="timestamp" type="xs:dateTime"/> <!-- Section 5.4 of ISO 8601 -->
</xs:complexType>
</xs:element>
<xs:element name="nd">
<xs:complexType>
<xs:attribute name="ref" type="xs:unsignedLong"/>
</xs:complexType>
</xs:element>
<xs:element name="tag">
<xs:complexType>
<xs:attribute name="k" type="xs:string"/>
<xs:attribute name="v" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="relation">
<xs:complexType>
<xs:sequence>
<xs:element ref="member" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="tag" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedLong"/>
<xs:attribute name="user" type="xs:string"/>
<xs:attribute name="uid" type="xs:unsignedLong"/>
<xs:attribute name="visible" type="xs:boolean"/>
<xs:attribute name="version" type="xs:unsignedLong"/>
<xs:attribute name="changeset" type="xs:unsignedLong"/>
<xs:attribute name="timestamp" type="xs:dateTime"/>
</xs:complexType>
</xs:element>
<xs:element name="member">
<xs:complexType>
<xs:attribute name="type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="node"/>
<xs:enumeration value="way"/>
<xs:enumeration value="relation"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ref" type="xs:unsignedLong"/>
<xs:attribute name="role" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>