Implementation of the new REST API for Open Source LBS-platform Geo2Tag
Implementation of the new REST
API for Open Source LBS-platform
Mark Zaslavskiy, ITMO University, Fruct Ltd.
Dmitry Mouromtsev, ITMO University.
Introduction and initial state
• Geo2Tag is an OpenSource LBS-platform – open
backend for geo- and geocontext services.
• Existing sources are written in C++ with
PostgreSql as a data storage.
• Platform development is performed using
▫ Students of various IT departments do most of the
▫ Professional developers provide process control.
•Encourage usage of the platform
by 3rd party developers.
•Simplify existing sources for
better understanding by students.
▫ Rewrite API and backend to be more understandable and
▫ Add instruments for platform customization and data import.
▫ Change API to be more RESTful:
Resource-based API URLs;
Support of paginated requests;
Plugin system ( = background data processing).
▫ Change backend to Python, due to portability and easier support.
▫ Change data storage to MongoDb due to built-in georequests and
flexible collection structure.
▫ service data,
▫ instance logs.
• Service db:
▫ service logs.
• resource-based urls
• pagination support – all queries which produce lists
where extended with number and offset
• all platform entities (services, points, channels,
users, plugins) where made identifiable
▫ curl -b 'cookiefile.cookie' -X GET
▫ curl -b 'cookiefile.cookie' -X DELETE
OAuth2 authorization support
• Old API was trying to perform full stack of user
registration and it cause a lot of actions must be
done by instance administrator.
▫ Only OAuth2 authorization.
▫ During the authorization user account is created
in case of first login and identifier is stored in an
▫ Google and Facebook as OAuth providers with
ability of fast addition of other providers.
• Plugin is an extension for Geo2Tag REST
API isolated inside /<prefix>/plugins/
• Plugins are deployed as pep8-comparable
python packages which match Geo2Tag
• Plugins are installed by instance
• Goal: demonstrate how Geo2Tag plugins can be used
and add ability to high level import of data into the
• Solution: built-in general interfaces for OpenData
import plugin development:
▫ Data acquiring/parsing/importing classes.
▫ Interfaces for keeping references between
imported data and sources.
▫ Import versioning interfaces.
▫ Wrapper around Geonames geocoder for Open
Data without geographical coordinates.
OpenKarelia import plugin
• Import of digital museum objects from
OpenKarelia information system
• Plugin retrieves name, image, brief
description, date information.
• Interval dates are converted from
OpenKarelia format to Geo2Tag format.
• New API and backend with support of
• For encouraging 3rd party developers
OpenData import API was added
• Future plans
▫ Web UI for administration.
▫ API for high level management of imported
• Mark Zaslavskiy, email@example.com
• Project resources: http://test.geo2tag.org/,
• Demo server http://demo.geo2tag.org/