1 | = About OpenStreetMap = |
---|
2 | |
---|
3 | "OpenStreetMap is a project aimed squarely at creating and providing free |
---|
4 | geographic data such as street maps to anyone who wants them." |
---|
5 | "The project was started because most maps you think of as free actually have |
---|
6 | legal or technical restrictions on their use, holding back people from using |
---|
7 | them in creative, productive or unexpected ways." |
---|
8 | [Source: http://wiki.openstreetmap.org/index.php/Press] |
---|
9 | |
---|
10 | OpenStreetMap uses a topological data structure: |
---|
11 | |
---|
12 | * Nodes are points with a geographic position. |
---|
13 | * Ways are lists of nodes, representing a polyline or polygon. |
---|
14 | * Relations are groups of nodes, ways and other relations which can be assigned certain properties. |
---|
15 | * Tags can be applied to nodes, ways or relations and consist of name=value pairs. |
---|
16 | |
---|
17 | This is how nodes, ways and relations are described in the OpenStreetmap XML |
---|
18 | file: |
---|
19 | |
---|
20 | {{{ |
---|
21 | <?xml version='1.0' encoding='UTF-8'?> |
---|
22 | <osm version='0.5' generator='JOSM'> |
---|
23 | ... |
---|
24 | <node id='252791067' timestamp='2008-03-18T19:45:06+00:00' user='Russell Cloran' visible='true' lat='-33.9291602' lon='18.4251865'> |
---|
25 | <tag k='created_by' v='JOSM' /> |
---|
26 | </node> |
---|
27 | <node id='252791066' timestamp='2008-03-18T19:45:05+00:00' user='Russell Cloran' visible='true' lat='-33.9305174' lon='18.4265772'> |
---|
28 | <tag k='created_by' v='JOSM' /> |
---|
29 | </node> |
---|
30 | <node id='252791065' timestamp='2008-03-18T19:45:04+00:00' user='Russell Cloran' visible='true' lat='-33.930418' lon='18.4231201'> |
---|
31 | <tag k='created_by' v='JOSM' /> |
---|
32 | </node> |
---|
33 | ... |
---|
34 | <node id='260366643' timestamp='2008-04-28T10:59:11+01:00' user='Adrian Frith' visible='true' lat='-33.9287313' lon='18.415251'> |
---|
35 | <tag k='created_by' v='JOSM' /> |
---|
36 | <tag k='name' v='South African Museum' /> |
---|
37 | <tag k='tourism' v='museum' /> |
---|
38 | </node> |
---|
39 | ... |
---|
40 | <way id='26358722' timestamp='2008-08-17T15:41:55+01:00' user='Adrian Frith' visible='true'> |
---|
41 | <nd ref='288787699' /> |
---|
42 | <nd ref='288787695' /> |
---|
43 | <tag k='highway' v='residential' /> |
---|
44 | <tag k='name' v='Guinea Fowl Crescent' /> |
---|
45 | </way> |
---|
46 | <way id='26358723' timestamp='2008-08-17T15:41:56+01:00' user='Adrian Frith' visible='true'> |
---|
47 | <nd ref='288787696' /> |
---|
48 | <nd ref='288787723' /> |
---|
49 | <nd ref='288787724' /> |
---|
50 | <nd ref='288787728' /> |
---|
51 | <nd ref='288787725' /> |
---|
52 | <nd ref='288787677' /> |
---|
53 | <tag k='highway' v='residential' /> |
---|
54 | <tag k='name' v='Old Farm Road' /> |
---|
55 | </way> |
---|
56 | ... |
---|
57 | <relation id='27924' timestamp='2008-08-17T09:53:48+01:00' user='Adrian Frith' visible='true'> |
---|
58 | <member type='way' ref='4994378' role='outer' /> |
---|
59 | <member type='way' ref='5022484' role='innner' /> |
---|
60 | <tag k='type' v='multipolygon' /> |
---|
61 | </relation> |
---|
62 | <relation id='22713' timestamp='2008-07-27T22:49:25+01:00' user='Adrian Frith' visible='true'> |
---|
63 | <member type='way' ref='25817796' role='outer' /> |
---|
64 | <member type='way' ref='25817797' role='inner' /> |
---|
65 | <tag k='type' v='multipolygon' /> |
---|
66 | </relation> |
---|
67 | ... |
---|
68 | </osm> |
---|
69 | }}} |
---|
70 | |
---|
71 | The OSM data can be downloaded from OpenStreetMap website using an API |
---|
72 | (see http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5), |
---|
73 | or with some other OSM tools, for example JOSM editor. |
---|
74 | |
---|
75 | Note: The API has a download size limitation, which can make it a bit |
---|
76 | inconvenient to download extensive areas with many features. |
---|
77 | |
---|
78 | When using the osm2pgrouting converter (see later), we take only nodes and ways |
---|
79 | of types and classes specified in "mapconfig.xml" file to be converted to |
---|
80 | pgRouting table format: |
---|
81 | |
---|
82 | {{{ |
---|
83 | <?xml version="1.0" encoding="UTF-8"?> |
---|
84 | <configuration> |
---|
85 | <type name="highway" id="1"> |
---|
86 | <class name="motorway" id="101" /> |
---|
87 | <class name="motorway_link" id="102" /> |
---|
88 | <class name="motorway_junction" id="103" /> |
---|
89 | ... |
---|
90 | <class name="road" id="100" /> |
---|
91 | </type> |
---|
92 | <type name="junction" id="4"> |
---|
93 | <class name="roundabout" id="401" /> |
---|
94 | </type> |
---|
95 | </configuration> |
---|
96 | }}} |
---|
97 | |
---|
98 | Detailed description of all possible types and classes can be found here: |
---|
99 | http://wiki.openstreetmap.org/index.php/Map_features. |
---|
100 | |
---|
101 | For Cape Town the OpenStreetMap data is very comprehensive with many details. |
---|
102 | A compilation of the greater Cape Town area created with JOSM is available as |
---|
103 | capetown_20080829.osm. |
---|