libosmscout

From OpenStreetMap Wiki
Jump to: navigation, search

libosmscout (Development and issue tracker under github.com/Framstag/libosmscout/, mailing list and web pages are still provided by libosmscout.sourceforge.net) offers applications simple, high-level interfaces to offline rendering and routing functionalities based on OpenStreetMap data, initial written by Tim Teulings and further developed by a small community. For details see a copy of one of Tims postings to the osm routing mailing list below.

It does so by preprocessing .osm /.pbf data files and generating binary data and index files for fast access.

To get an impression of the rendering quality and routing functionality have a look at the rather old screenshots and demo video or look at the blog of the main author for old acitivity and screenshots. Tim Teulings had also a talk at the State of the Map Europe 2014 that you can watch here.

See also libosmscout.sourceforge.net/examples/screenshots/ for further links to screenshots and videos.

The source code is licenced LGPL and is hosted at github.com/Framstag/libosmscout/, irregular updates of the source are still pushed to libosmscout.sourceforge.net.

Note that libosmscout code is in continuous development and improvement. Features are still added form time to time. This web page tries to be up to date. If you have the feeling, that the documentation does not match, please try to contact the author and even better the libosmscout mailinglist.

Software that uses libosmscout

  • OSMScout (see entry on uappexplorer.com and its github-repository) is an app for Ubuntu Touch devices that offers offline map display, navigation etc.
  • OSMScout for Sailfish OS (github project) - offline maps for Sailfish OS from Jolla.
  • Some people on the list are working on "their project", but do not yet have public releases.

Components

Import

This tool grabs some osm.osm/.pbf XML file and converts it to a special binary format containing the geometries.

DumpData

Allows to dump objects with all their attributes from the database for debugging purposes.

libosmscout

This library can be used by application programmers to access the data in the aforementioned binary file, created by the importer.

libosmscout-import

This library holds the code to import *.osm and *.osm.pbf files. It is currently only used by the Import application.

libosmscout-map

libosmscout-map does all the map drawing using libosmscout as basis. libosmscout just defines an interface for the database that libosmscout-map uses, so in priciple even the local file database would be exchangeable. It does not contain any actual backend, the individual backends have their own libraries.

libosmscout-map-cairo

Cairo map drawing backend. This is the reference backend.

libosmscout-map-qt

Qt map drawing backend. Feature complete.

libosmscout-client-qt

Support library for Qt clients. Contains widgets, models and other Qt specific helper code.

libosmscout-map-agg

Agg map drawing backend. Misses code for drawing external images, patterns, plate labels and symbols.

libosmscout-map-svg

SVG map drawing backend. Misses code for drawing external images, patterns, plate labels and symbols. No text support.

libosmscout-map-iOSX

Map drawing backend for iOS and OS X.

libosmscout-map-opengl

Map drawing backend for (modern) OpenGL.

OSMScout2

A simple map application using the Qt toolkit by Trolltech/Nokia

Demos

Some example code showcasing the usage of libosmscout. These are:

  • DrawMapCairo, DrawMapQt, DrawMapAgg, DrawMapSVG: Simple console applications to draw a map using the named backend.
  • LocationLookup: Demos to lookup of addresses.
  • Routing: Simple console application to show how to do routing.
  • Tiler: Shows how to render tiles (fast).
  • LookupPOI: Shows how to lookup POIs of certains types in the local region.

DrawMapQt

An example how to use Qt to render a small area to a .png image. Common usage:

DrawMapQt <map directory> <style-file> <width> <height> <lon> <lat> <zoom> <output>

Example usage:

src/DrawMapQt ../maps/nordrhein-westfalen ../stylesheets/standard.oss 640 480 7.13 50.69 10000 test.png

Installation and initial setup

There are extensive documentation and tutorials at libosmscout.sourceforge.net/documentation/

Postings

Blog posts

OSM routing, 2010-03-14

Hello!

I'm still looking for people interested in helping me with further development libosmscout (libosmscout.sf.net). The library steadily improves, but more people could simply get more work done faster ;-)

libosmscout is a C++ library, that implements offline map drawing and routing based on OSM data. It does this by import an existing *.osm file and generating a binary, plattform independent file based database and offering an high level API on top of this database.

The main target group of the library are people that are interested in developing applications based on OSM and that do not want to directly access available data using existing online APIs. Such applications of course also include offline navigation software but of course other, more specialized applications are possible.

Recent discussions with interested people however have shown that libosmscout has a much broader target group. Since the library consists of separate components for import, dataaccess, routing and map drawing, other usage scenarios are also possible and I'm also looking for people that want to improve libosmscout in that direction:

  • Generating stylable (paper) maps
  • Using it as a small desktop local caching tile server with very light infrastructure requirements.
  • Using it to tests and compare different routing alogrithm (that can share pre- and postprocessing and thus safe the developer the hassle to fiddle around with *.osm file format and generating a good textual routing description).
  • Use the internal data structures and map drawing for online-data API based map drawing
  • Statistical analysis and data test suite

libosmscout currently depends on libxml and libcairo (, but even that could be abstracted ;-)) and thus should work on various platforms.

If you are interested take a look at libosmscout.sf.net for further details (and a video) or simply contact me.