Skip to content

Instantly share code, notes, and snippets.

@simon04
Created August 31, 2016 10:51
Show Gist options
  • Save simon04/24ac9e9b1d0ce3c6655c1ffb2329ebc7 to your computer and use it in GitHub Desktop.
Save simon04/24ac9e9b1d0ce3c6655c1ffb2329ebc7 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Using optional BOM (0xEF 0xBB 0xBF) -->
<!-- From http://forum.openstreetmap.org/viewtopic.php?id=7186 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://openstreetmap.org/osm/0.6"
xmlns="http://openstreetmap.org/osm/0.6">
<xs:element name="osm">
<xs:complexType>
<xs:sequence>
<xs:element ref="bounds"/> <!-- exactly once -->
<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="CGImap 0.0.2"/>
<!-- <xs:attribute name="generator" type="xs:string"/> -->
</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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment