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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
\documentclass{beamer}
%packages
\usepackage[latin1]{inputenc}
\usepackage{minted}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[english]{babel}
\hypersetup{urlcolor=red,colorlinks}
\definecolor{bg}{rgb}{0.95,0.95,0.95}
\newminted{xml}{fontsize=\tiny}
\newminted{javascript}{fontsize=\tiny}
\usetheme{default}
\title[OSM-Projekt - What is...]{OSM-Projekt - An introduction into OpenStreetMap}
\author{Philipp Borgers}
\institute{Institute for Computer Science, Free University Berlin}
\date{15.4.2011}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Introduction}
\begin{itemize}
\item Huge database of geo data
\item Open Data, licenced under cc (ODbL?)
\item Everybody can contribute, it's like an wiki
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Community}
\begin{itemize}
\item \href{http://wiki.openstreetmap.org/wiki/Develop}{Developer wikipage}
\item \href{http://lists.openstreetmap.org/listinfo}{Mailinglists (dev@lists...)}
\item \href{irc://irc.oftc.net/#osm-dev}{\#osm-dev}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{data types - node}
\begin{itemize}
\item Id, Longitude, Latitude
\item Set of key/value pairs (tags)
\end{itemize}
\begin{xmlcode}
<node id="23" lat="51.5173639" lon="-0.140043" version="1" changeset="42" user="h4ck3r"
uid="23" visible="true" timestamp="2007-01-28T11:40:26Z">
<tag k="name" v="h4ck3rs h0m3"/>
</node>
\end{xmlcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{data types - way}
\begin{itemize}
\item Id and common attributes
\item List of all node id's that make up the way
\item Last node == first node (optional, closed way)
\item A set of key/value pairs (tags)
\end{itemize}
\begin{xmlcode}
<way id="42" visible="true" timestamp="2009-01-19T19:07:25Z" version="42" changeset="2342"
user="h4ck3r" uid="23">
<nd ref="1"/>
<nd ref="2"/>
<nd ref="3"/>
<nd ref="1"/>
<tag k="oneway" v="yes"/>
</way>
\end{xmlcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{data types - relation}
\begin{itemize}
\item Id and common attributes
\item A set of key/value pairs (tags)
\item An ordered list of primitives (members) with associated role attribute
\item A member consists of a type (node, way, relation), Id and a role attribute
\end{itemize}
\begin{xmlcode}
<relation id="23" timestamp="2008-12-21T19:31:43Z" user="h4ck3r" uid="42">
<member type="way" ref="2332" role="whatever"/>
<member type="node" ref="43" role="asdf"/>
<member type="relation" ref="1234" role="l33t"/>
<member type="way" ref="5678" role=""/>
<tag k="name" v="sample relation"/>
</relation>
\end{xmlcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{data types - tag}
\begin{itemize}
\item A key/value pair
\item They are everywhere, you can't hide
\end{itemize}
\begin{xmlcode}
<tag k="name" v="Institut fuer Informatik"/>
\end{xmlcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{data types - more on data types and elements}
\begin{itemize}
\item \href{http://wiki.openstreetmap.org/wiki/Data_Primitives}{Data primitives}
\item \href{http://wiki.openstreetmap.org/wiki/Elements}{OSM elements}
\item \href{http://wiki.openstreetmap.org/wiki/API\_v0.6}{OSM API 0.6}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{database - schema (tables)}
\begin{itemize}
\item nodes
\item ways
\item relations
\item users
\item way\_nodes
\item relation\_members
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{database - nodes table}
\begin{tabular}{| l | c | r |}
\hline
id & bigint & not null \\ \hline
version & integer & not null \\ \hline
user\_id & integer & not null \\ \hline
tstamp & timestamp without time zone & not null \\ \hline
changeset\_id & bigint & not null \\ \hline
tags & hstore & \\ \hline
geom & geometry & \\ \hline
\end{tabular}
\end{frame}
\begin{frame}[fragile]
\frametitle{XAPI}
\begin{itemize}
\item Database frontend used to retrieve node, ways and relations
\item XPATH like requests
\item Returns xml (osm xml schema)
\item \href{http://wiki.openstreetmap.org/wiki/Xapi}{Wiki page}
\item OSM community needs a good implementation
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{XAPI - Request format}
\begin{itemize}
\item api/0.6/node[predicate]
\item api/0.6/way[-6,50,2,61]
\item api/0.6/relation[name=U3]
\item api/0.6/*[-6,50,2,61][name=U3|U4|U5]
\item api/0.6/*[name=*]
\item api/0.6/node[amenity|leisure=golf\_curse]
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{XAPI - Implementations}
\begin{itemize}
\item \href{http://xapi.openstreetmap.org/scripts/}{G.TM implementation}
\item \href{https://github.com/iandees/xapi-servlet}{Java implementation}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{node.js}
\begin{itemize}
\item \href{http://nodejs.org/}{node.js} is asynchronous javascript
\item Event based
\item Written on top of the \href{http://code.google.com/p/v8/}{V8 Javascript Engine} (Virtual machine)
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Simple example - echo server}
\begin{javascriptcode}
var net = require('net');
var server = net.createServer(function (socket) {
socket.write("Echo server\r\n");
socket.pipe(socket);
});
server.listen(8124, "127.0.0.1");
\end{javascriptcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{Simple example - event}
Listen for events
\begin{javascriptcode}
server.on('connection', function(stream) {
console.log('someone connected!');
});
\end{javascriptcode}
Emit events
\begin{javascriptcode}
server.emit('connection',socket);
\end{javascriptcode}
\end{frame}
\begin{frame}[fragile]
\frametitle{Licence}
\begin{center}
\includegraphics[scale=0.25]{./cc.png}
\end{center}
\begin{center}
\href{http://creativecommons.org/licenses/by/3.0/}{Attribution 3.0 Unported (CC BY 3.0)}
\end{center}
\end{frame}
\begin{frame}[fragile]
\frametitle{more}
\begin{itemize}
\item \url{https://github.com/slomo/osm-spline-xapi}
\item \href{https://lists.spline.inf.fu-berlin.de/mailman/listinfo/xapi}{XAPI (course) mailinglist}
\item \url{http://osm.spline.de}
\end{itemize}
\end{frame}
\end{document}
|