SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
1
GeoClue
- The Geolocation Service
William.L
wiliwe@gmail.com
2010-06-15
2
Outline
History
Overview
Dependencies
Components
Reference
3
History & Goal
Started during GNOME Summit 2006 in Boston.
Provides a convenient way to find out where the user is,
from a number of sources such as GPS, GSM cell, wifi
network, internetwork.
4
Overview
GeoClue
A software framework utilizing the D-Bus inter-process
communication(IPC) mechanism to provide location
information, and applications can use it to become geo-aware
Can geocode(getting a Position(longitude/latitude
coordinate) from an Address) and
reverse-geocode (getting an Address from a Position)
Licensed under the GNU LGPL
http://geoclue.freedesktop.org/
5
Dependencies (1/2)
GObject
Glib
D-Bus
GPSD
A GPS daemon on most Debian like system
http://gpsd.berlios.de/
Gypsy
Written by Iain Holmes at o-hand
A GPS multiplexing daemon which allows multiple clients
to access GPS data from multiple GPS sources
concurrently
http://gypsy.freedesktop.org/wiki/
6
Dependencies (2/2)
Wammu
A program to manage data in your cell phone such as
contacts, calendar or messages.
http://wammu.eu/
OpenCellID (basement station ID)
Aiming to create a complete database of CellID
worlwide, with their locations.
http://opencellid.org/
7
Components (1/10)
A set of geoinformation interfaces
For querying "current situation“
Position
Address
Velocity
Use a method / signal architecture
Ex : To get current position, use –
geoclue_position_get_position() method or "position-
changed" signal with a callback function
8
Components (2/10)
Class of Interfaces
Position - GeocluePosition
Via gpsd, gypsy, hostip, plazes, gsmloc
Address - GeoclueAddress
Via hostip, plazes, manual, localnet
Velocity - GeoclueVelocity
Via gpsd, gypsy
Geocode - GeoclueGeocode
Via nominatim (http://nominatim.openstreetmap.org/),
geonames (http://www.geonames.org/),
yahoo (http://developer.yahoo.com/maps/rest/V1/geocode.html)
ReverseGeocode - GeoclueReverseGeocode
Via nominatim, geonames
Accuracy - GeoclueAccuracy
Reports the horizontal and vertical accuracy levels
9
Components (3/10)
Provider
Implement more than one Geoclue interface
All Geoclue providers are D-Bus services
Do not have to run as daemons, as D-Bus will start them
when needed (providers may also shut down when they're no
longer used).
Currently has 9 providers -
http://www.freedesktop.org/wiki/Software/GeoClue/Providers
10
Components (4/10)
Type of Providers
User-specified address that maps to a
router's mac address (home, office).
A user-specified address
A web service that gets location based on
your current router mac address.
Interfaces with a user's Plazes account.
http://plazes.com
A web service that guesses location based
on the current IP address.
http://www.hostip.info
Description
Address
Address
Position, Address
Position, Address
Service
Localnet
Manual
Plazes
Hostip
Type
11
Components (5/10)
Type of Providers
Gets cell ID data, and estimates location
from a web service based upon that data
PositionGsmloc
A GPS daemon that supports bluetooth
and serial GPS devices
Position, VelocityGypsy
A web service that can convert an address
to a position. Conversely, it can also find
the nearest address to a given position.
A web service that converts an address to
a position
A GPS daemon that uses TCP sockets
Description
Geocode,
ReverseGeocode
Geocode
Position, Velocity
Service
Geonames
Yahoo
GPSd
Type
12
Components (6/10)
Problem on using Providers
A single provider cannot be the best solution to all problems
The "best" providers will be different depending on the user
Master Provider
Single window for user to use providers
It is an attempt to take away all of the complications of choosing
the right provider
Choose the best provider to provide what you are looking
for based on client requirements and provider availability,
accuracy and resource requirements.
The provider that is actually used may change over time
as conditions change, but the client can just ignore this
13
Components (7/10)
Usage of Master Provider
A typical Master provider use :
Getting a client-specific GeoclueMasterClient from GeoclueMaster
Setting GeoclueMasterClient requirements (such as accuracy)
Starting the wanted interfaces (such as Position)
Using the client just like a regular provider
Master provider is fairly new and may not be as stable
as the rest of Geoclue
14
Components (8/10)
Ex : Master Provider
#include <geoclue/geoclue-master.h>
static void position_changed(...) {
if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) {
g_print ("t%f, %fnn", latitude, longitude);}
else { g_print ("tLatitude and longitude not available.nn"); } }
int main ()
{
GMainLoop *loop;
GeoclueMaster *master;
GeoclueMasterClient *client;
GeocluePosition *pos;
GeocluePositionFields fields;
double lat, lon;
GError *error = NULL;
g_type_init ();
/ * create a MasterClient using Master * /
master = geoclue_master_get_default ();
client = geoclue_master_create_client (master, NULL, &error);
g_object_unref (master);
if (!client)
{
g_printerr ("Error creating GeoclueMasterClient");
g_error_free (error);
return 1;
}
15
Components (9/10)
/ * Set our requirements: We want at least city level accuracy, require signals,
and allow the use of network (but not e.g. GPS) * /
if (!geoclue_master_client_set_requirements (client, GEOCLUE_ACCURACY_LEVEL_LOCALITY,
0, TRUE, GEOCLUE_RESOURCE_NETWORK, &error))
{
g_printerr ("set_requirements failed: %s", error->message);
g_error_free (error);
g_object_unref (client);
return 1;
}
/ * Get a Position object * /
pos = geoclue_master_client_create_position (client, NULL);
if (!pos) {
g_printerr ("Failed to get a position object");
g_object_unref (client);
return 1;
}
/ * call get_position. We do not know which provider actually provides the answer (although we could find out using MasterClient API) * /
fields = geoclue_position_get_position (pos, NULL, &lat, &lon, NULL, NULL, &error);
if (error) {
g_printerr ("Error in geoclue_position_get_position: %s.n", error->message);
g_error_free (error);
error = NULL;
} else {
if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE &&
fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) {
g_print ("We're at %.3f, %.3f.n", lat, lon); }
}
g_signal_connect (G_OBJECT (pos), "position-changed", G_CALLBACK (position_changed), NULL);
16
Components (10/10)
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
g_main_loop_unref (loop);
g_object_unref (pos);
g_object_unref (client);
return 0;
}
17
References
GeoClue API
http://folks.o-hand.com/jku/geoclue-docs
Geoclue: Location Information Retrieval for Moblin
2.0 Linux
http://software.intel.com/en-us/articles/geoclue-location-
information- retrieval-for-moblin-20-linux/
http://software.intel.com/zh-cn/blogs/2009/03/11/moblin-sdk-
geoclue/

Mais conteúdo relacionado

Destaque

Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers BasicWilliam Lee
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)William Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginWilliam Lee
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBBWilliam Lee
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxWilliam Lee
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069William Lee
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)William Lee
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development ToolsWilliam Lee
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging SystemWilliam Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam Lee
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External StoragesWilliam Lee
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)William Lee
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesWilliam Lee
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - VoldWilliam Lee
 

Destaque (17)

Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers Basic
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
 
Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
 
CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)CWMP TR-069 Training (Chinese)
CWMP TR-069 Training (Chinese)
 
Qt Development Tools
Qt Development ToolsQt Development Tools
Qt Development Tools
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
IPv6 Overview
IPv6 OverviewIPv6 Overview
IPv6 Overview
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
 
Android Storage - Internal and External Storages
Android Storage - Internal and External StoragesAndroid Storage - Internal and External Storages
Android Storage - Internal and External Storages
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
 
MTP & PTP
MTP & PTPMTP & PTP
MTP & PTP
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 

Semelhante a GNOME GeoClue - The Geolocation Service in Gnome

Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication developmentGanesh Gembali
 
maXbox Starter 39 GEO Maps Tutorial
maXbox Starter 39 GEO Maps TutorialmaXbox Starter 39 GEO Maps Tutorial
maXbox Starter 39 GEO Maps TutorialMax Kleiner
 
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIAL
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIALGEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIAL
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIALSohail Akbar Goheer
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Boris Kravtsov
 
OGCE Project Overview
OGCE Project OverviewOGCE Project Overview
OGCE Project Overviewmarpierc
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech ProjectsJody Garnett
 
EDINA's Open Geo-Services
EDINA's Open Geo-ServicesEDINA's Open Geo-Services
EDINA's Open Geo-ServicesAddy Pope
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
Geolocation in Drupal
Geolocation in DrupalGeolocation in Drupal
Geolocation in DrupalMediacurrent
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedPeter Lubbers
 
LocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGigLocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGigFrank Gasdorf
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Ari Jolma
 
Building Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsBuilding Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsSergi Almar i Graupera
 
How to configure the cluster based on Multi-site (WAN) configuration
How to configure the clusterbased on Multi-site (WAN) configurationHow to configure the clusterbased on Multi-site (WAN) configuration
How to configure the cluster based on Multi-site (WAN) configurationAkihiro Kitada
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008xilinus
 

Semelhante a GNOME GeoClue - The Geolocation Service in Gnome (20)

Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication development
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
maXbox Starter 39 GEO Maps Tutorial
maXbox Starter 39 GEO Maps TutorialmaXbox Starter 39 GEO Maps Tutorial
maXbox Starter 39 GEO Maps Tutorial
 
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIAL
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIALGEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIAL
GEOSERVER - DOWNLOAD AND INSTALLATION STEP BY STEP TUTORIAL
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
 
OGCE Project Overview
OGCE Project OverviewOGCE Project Overview
OGCE Project Overview
 
PPT
PPTPPT
PPT
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
 
EDINA's Open Geo-Services
EDINA's Open Geo-ServicesEDINA's Open Geo-Services
EDINA's Open Geo-Services
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
Geolocation in Drupal
Geolocation in DrupalGeolocation in Drupal
Geolocation in Drupal
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
LocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGigLocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGig
 
DIY Uber
DIY UberDIY Uber
DIY Uber
 
A Case for Grails
A Case for GrailsA Case for Grails
A Case for Grails
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
Building Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSocketsBuilding Real-Time Applications with Android and WebSockets
Building Real-Time Applications with Android and WebSockets
 
How to configure the cluster based on Multi-site (WAN) configuration
How to configure the clusterbased on Multi-site (WAN) configurationHow to configure the clusterbased on Multi-site (WAN) configuration
How to configure the cluster based on Multi-site (WAN) configuration
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 

Mais de William Lee

Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHPWilliam Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerWilliam Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding WindowWilliam Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserWilliam Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserWilliam Lee
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASPWilliam Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web PageWilliam Lee
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)William Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OSWilliam Lee
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)William Lee
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069William Lee
 

Mais de William Lee (19)

Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASP
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)
 
Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069Introdunction to Network Management Protocols - SNMP & TR-069
Introdunction to Network Management Protocols - SNMP & TR-069
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

GNOME GeoClue - The Geolocation Service in Gnome

  • 1. 1 GeoClue - The Geolocation Service William.L wiliwe@gmail.com 2010-06-15
  • 3. 3 History & Goal Started during GNOME Summit 2006 in Boston. Provides a convenient way to find out where the user is, from a number of sources such as GPS, GSM cell, wifi network, internetwork.
  • 4. 4 Overview GeoClue A software framework utilizing the D-Bus inter-process communication(IPC) mechanism to provide location information, and applications can use it to become geo-aware Can geocode(getting a Position(longitude/latitude coordinate) from an Address) and reverse-geocode (getting an Address from a Position) Licensed under the GNU LGPL http://geoclue.freedesktop.org/
  • 5. 5 Dependencies (1/2) GObject Glib D-Bus GPSD A GPS daemon on most Debian like system http://gpsd.berlios.de/ Gypsy Written by Iain Holmes at o-hand A GPS multiplexing daemon which allows multiple clients to access GPS data from multiple GPS sources concurrently http://gypsy.freedesktop.org/wiki/
  • 6. 6 Dependencies (2/2) Wammu A program to manage data in your cell phone such as contacts, calendar or messages. http://wammu.eu/ OpenCellID (basement station ID) Aiming to create a complete database of CellID worlwide, with their locations. http://opencellid.org/
  • 7. 7 Components (1/10) A set of geoinformation interfaces For querying "current situation“ Position Address Velocity Use a method / signal architecture Ex : To get current position, use – geoclue_position_get_position() method or "position- changed" signal with a callback function
  • 8. 8 Components (2/10) Class of Interfaces Position - GeocluePosition Via gpsd, gypsy, hostip, plazes, gsmloc Address - GeoclueAddress Via hostip, plazes, manual, localnet Velocity - GeoclueVelocity Via gpsd, gypsy Geocode - GeoclueGeocode Via nominatim (http://nominatim.openstreetmap.org/), geonames (http://www.geonames.org/), yahoo (http://developer.yahoo.com/maps/rest/V1/geocode.html) ReverseGeocode - GeoclueReverseGeocode Via nominatim, geonames Accuracy - GeoclueAccuracy Reports the horizontal and vertical accuracy levels
  • 9. 9 Components (3/10) Provider Implement more than one Geoclue interface All Geoclue providers are D-Bus services Do not have to run as daemons, as D-Bus will start them when needed (providers may also shut down when they're no longer used). Currently has 9 providers - http://www.freedesktop.org/wiki/Software/GeoClue/Providers
  • 10. 10 Components (4/10) Type of Providers User-specified address that maps to a router's mac address (home, office). A user-specified address A web service that gets location based on your current router mac address. Interfaces with a user's Plazes account. http://plazes.com A web service that guesses location based on the current IP address. http://www.hostip.info Description Address Address Position, Address Position, Address Service Localnet Manual Plazes Hostip Type
  • 11. 11 Components (5/10) Type of Providers Gets cell ID data, and estimates location from a web service based upon that data PositionGsmloc A GPS daemon that supports bluetooth and serial GPS devices Position, VelocityGypsy A web service that can convert an address to a position. Conversely, it can also find the nearest address to a given position. A web service that converts an address to a position A GPS daemon that uses TCP sockets Description Geocode, ReverseGeocode Geocode Position, Velocity Service Geonames Yahoo GPSd Type
  • 12. 12 Components (6/10) Problem on using Providers A single provider cannot be the best solution to all problems The "best" providers will be different depending on the user Master Provider Single window for user to use providers It is an attempt to take away all of the complications of choosing the right provider Choose the best provider to provide what you are looking for based on client requirements and provider availability, accuracy and resource requirements. The provider that is actually used may change over time as conditions change, but the client can just ignore this
  • 13. 13 Components (7/10) Usage of Master Provider A typical Master provider use : Getting a client-specific GeoclueMasterClient from GeoclueMaster Setting GeoclueMasterClient requirements (such as accuracy) Starting the wanted interfaces (such as Position) Using the client just like a regular provider Master provider is fairly new and may not be as stable as the rest of Geoclue
  • 14. 14 Components (8/10) Ex : Master Provider #include <geoclue/geoclue-master.h> static void position_changed(...) { if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) { g_print ("t%f, %fnn", latitude, longitude);} else { g_print ("tLatitude and longitude not available.nn"); } } int main () { GMainLoop *loop; GeoclueMaster *master; GeoclueMasterClient *client; GeocluePosition *pos; GeocluePositionFields fields; double lat, lon; GError *error = NULL; g_type_init (); / * create a MasterClient using Master * / master = geoclue_master_get_default (); client = geoclue_master_create_client (master, NULL, &error); g_object_unref (master); if (!client) { g_printerr ("Error creating GeoclueMasterClient"); g_error_free (error); return 1; }
  • 15. 15 Components (9/10) / * Set our requirements: We want at least city level accuracy, require signals, and allow the use of network (but not e.g. GPS) * / if (!geoclue_master_client_set_requirements (client, GEOCLUE_ACCURACY_LEVEL_LOCALITY, 0, TRUE, GEOCLUE_RESOURCE_NETWORK, &error)) { g_printerr ("set_requirements failed: %s", error->message); g_error_free (error); g_object_unref (client); return 1; } / * Get a Position object * / pos = geoclue_master_client_create_position (client, NULL); if (!pos) { g_printerr ("Failed to get a position object"); g_object_unref (client); return 1; } / * call get_position. We do not know which provider actually provides the answer (although we could find out using MasterClient API) * / fields = geoclue_position_get_position (pos, NULL, &lat, &lon, NULL, NULL, &error); if (error) { g_printerr ("Error in geoclue_position_get_position: %s.n", error->message); g_error_free (error); error = NULL; } else { if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) { g_print ("We're at %.3f, %.3f.n", lat, lon); } } g_signal_connect (G_OBJECT (pos), "position-changed", G_CALLBACK (position_changed), NULL);
  • 16. 16 Components (10/10) loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (pos); g_object_unref (client); return 0; }
  • 17. 17 References GeoClue API http://folks.o-hand.com/jku/geoclue-docs Geoclue: Location Information Retrieval for Moblin 2.0 Linux http://software.intel.com/en-us/articles/geoclue-location- information- retrieval-for-moblin-20-linux/ http://software.intel.com/zh-cn/blogs/2009/03/11/moblin-sdk- geoclue/