1
Petrozavodsk, Apr 2013
Location Based Services and Geo-tagging.
Geo2tag platform introduction.
2
Petrozavodsk, Apr 2013
Agenda
● Architecture overview
● Installation process
● Source code overview
● JSON interface
● Client libraries
– http_requests
– Jgeo
● Qt example
● Android example
3
Petrozavodsk, Apr 2013
Location Based Services
● LBS = using geographical context
– Indoor services
– Mobile healthcare
– City information
● Transport
● Traffic
● ...
4
Petrozavodsk, Apr 2013
Geo-tagging
● Def: the process of adding geographical
identification metadata to various media:
– Photo, video
– Web-pages,
– SMS, QR-codes
– files
5
Petrozavodsk, Apr 2013
Terminology
● Tag – tuple <t, L, B, H, data>,
– t – time
– B,L,H – coordinates
– data – text data ~1K
● Channel – classifier for group of tags
6
Petrozavodsk, Apr 2013
Main features of tagging system
● Access to tags
● Classification
● Filtering
● Session and User management
● Massive data processing
7
Petrozavodsk, Apr 2013
Features
● Current
– Basic geo-tagging
– Plain and spacial filtration
– Load balancing across Databases and web
servers
● Will be published in 2013
– Exporters (wikimapia, google maps, OSM,
4square)
– Channel aggregation
– Multi-service databases
8
Petrozavodsk, Apr 2013
Installation (test system)
● Visit http://build64.geo2tag.org/
● Add line to /etc/apt/sources.list
– deb http://build64.geo2tag.org/ geo2tag main
● Install packages
– sudo apt-get update
– sudo apt-get install –reinstall geo2tag
● Check installation
– http://<url>/service/version
– http://<url>/service/build
9
Petrozavodsk, Apr 2013
Channels and tags
LBS Platform
Канал
Channel
Channel
Channel
Channel
Tag
- time
- coordinates
- data (link)
Filtration
- time
- radius
- figure (2D or 3D)
Tag
Tag
Tag
10
Petrozavodsk, Apr 2013
Geo2tag architecture
Queryengine
Session manager
HP
database
BLOBs
cache
Indexer
Cluster/cloud
infrastructure
backend
clients
Libraries:
jgeo, http_reqs
Session cache
web
android
web
Qt-based
embedded
JSON
System cache
11
Petrozavodsk, Apr 2013
Resources
● Main site http://geo2tag.org
● Tracker https://geo2tag.atlassian.net/
● Sources https://github.com/OSLL/geo2tag
● Support: geo2tag-support@osll.spb.ru
● CI server: pulse.geo2tag.org
12
Petrozavodsk, Apr 2013
JSON/REST API
Command:
– Service URL
– Function
– Parameters
Example
http://debug.geo2tag.org/service?{json}
– Json: '{"login":"User","password":"pwd@"}
13
Petrozavodsk, Apr 2013
RESTful API
● REST = Representational State Transfer
– 2000 by Roy Fielding
– The model of http (v 1.0)
– HTTP POST is being used for
communication.
14
Petrozavodsk, Apr 2013
Goals of REST
● Scalability of component interactions
● Generality of interfaces
● Independent deployment of components
● encapsulate legacy systems
15
Petrozavodsk, Apr 2013
Java script Object Notation
● Text-based, Object-oriented, data
interchange format.
● Structure:
– A collection of name/value pairs
– Ordered list of values.
16
Petrozavodsk, Apr 2013
Grammar
● Begin-array – [ left square bracket
● Begin-object – { left curly bracket
● End-array – ] right square bracket
● End-object – } right curly bracket
● Name-separator – : colon
● Value-separator – ; , comma
17
Petrozavodsk, Apr 2013
Examples
{
"Image": {
"Width": 800,
"Height": 600,
"Title": "View from 15th Floor",
"Thumbnail": {
"Url": "http://www.example.com/image/481989943",
"Height": 125,
"Width": "100"
},
"IDs": [116, 943, 234, 38793]
}
18
Petrozavodsk, Apr 2013
Geo2tag REST API
Based on JSON objects interchange
● Command:
– URI
● Service URL
● Function
– Parameters: JSON object
Example
URI http://debug.geo2tag.org/service/login
– Params (Json): '{"login":"User","password":"test"}
19
Petrozavodsk, Apr 2013
Session token
client server
/version
{“errno”: 0, “version” : “1.02”}
/login {“login” : “user”, “password”:”pwd”}
{“errno”: 0, “auth_token” : “765888876588”}
/loadTags {“auth_token” : “765888876588”,
“latitude”:23.0, ”longitude”:12.0, “radius”: 5}
{“errno”: 0, ...}
20
Petrozavodsk, Apr 2013
Invoking by curl
$ curl -d '{"login":"User","password":"test"}'
http://debug.geo2tag.org/service/login
21
Petrozavodsk, Apr 2013
Live example
(curl)
22
Petrozavodsk, Apr 2013
Command security
● Plain commands (version, build,...)
● Session management
– login
– closeSession
● Authorized commands
– With session token
23
Petrozavodsk, Apr 2013
Session workflow
● Check version
● Acquire session token
● … R/W tags, channels
● Close session
24
Petrozavodsk, Apr 2013
Login
● /login
– login
– password
25
Petrozavodsk, Apr 2013
User management
● /addUser
– login
– password
– Email
● /deleteUser
– login
26
Petrozavodsk, Apr 2013
Channel Management
● /addChannel
– name
– description
– url
– radius
● /owned
● /subscribe
● /subscribed
27
Petrozavodsk, Apr 2013
Working with tags
● /writeTag
– channel
– description
– {coordinates}
– time
– title
● /loadTags
– latitude
– longitude
– radius
–
28
Petrozavodsk, Apr 2013
Qt interface
(http_requests)
29
Petrozavodsk, Apr 2013
Qt interface
(demo application)
30
Petrozavodsk, Apr 2013
java interface
(jgeo)
31
Petrozavodsk, Apr 2013
Practice: Android
32
Petrozavodsk, Apr 2013
Demo: LoginActivity
33
Petrozavodsk, Apr 2013
Demo: RequestSender
34
Petrozavodsk, Apr 2013
Demo: login()
35
Petrozavodsk, Apr 2013
Demo: Chat Activity
36
Petrozavodsk, Apr 2013
Demo: Activity Transition
37
Petrozavodsk, Apr 2013
Demo: Location Updating
38
Petrozavodsk, Apr 2013
Demo: availableChannels()
39
Petrozavodsk, Apr 2013
Demo: subscribeChannel()
40
Petrozavodsk, Apr 2013
Demo: Channel chooser
41
Petrozavodsk, Apr 2013
Demo: writeTag()
42
Petrozavodsk, Apr 2013
Demo: loadTags()
43
Petrozavodsk, Apr 2013
Demo: TagsView updating
44
Petrozavodsk, Apr 2013
Demo: background updating
45
Petrozavodsk, Apr 2013
Practice: Qt
46
Petrozavodsk, Apr 2013
Contacts
geo2tag-maintainer@fruct.org

Fruct13 geo2tag-training