Frameworks

From OpenStreetMap Wiki
(Redirected from Develop/Frameworks)
Jump to: navigation, search

Libraries, also known as frameworks, components, modules, or software development kits (SDKs), contain reusable code that helps developers integrate OpenStreetMap into their websites or software applications without reinventing the wheel. Developers have written libraries for accessing and analyzing data, rendering maps, geocoding, and routing. These libraries are compatible with the Web and a wide variety of desktop and mobile platforms.

A library is primarily included in a larger application, rather than being run as a standalone tool. However, some of the libraries listed here also provide command-line tools to facilitate development. A standalone tool may be just as convenient as a library in some environments, particularly on the command line; see Software for a full listing.

The libraries listed here are actively maintained or are considered to be mature and complete. Libraries of historical interest can be found at Category:Discontinued software.

Accessing raw OpenStreetMap data

Main article: Databases and data access APIs

OpenStreetMap has APIs for accessing raw, unprocessed map data. These low-level libraries are primarily used by OpenStreetMap editors, tile servers, and other infrastructure. If you’re developing a website or end-user application, most likely you’ll want to use a higher-level framework, such as an interactive map library.

Library Platforms Target languages API XAPI Overpass License Notes
osm-common Android, Java Java Yes No Yes Apache 2 Overpass, changeset servers
osmapi Android, Java Java Yes No No LGPLv3 Complete implementation of the API 0.6, including map data, traces, notes, changesets, user infos etc.
osmapi Cross-platform Python Yes No No GPLv3
osmaR Cross-platform R Yes No No GPLv2
OSMLib Cross-platform Ruby Yes No No Public domain
Rosemary Cross-platform Ruby Yes No No MIT
Services_OpenStreetMap Cross-platform PHP Yes No No BSD Also allows access to user details. Went through PEAR PePr process

Processing OpenStreetMap data

Main article: Converting map data between formats Main article: :Category:File Converters

These libraries parse or convert raw OpenStreetMap data into other file formats or import the data into databases.

Library Platforms Target languages License Notes
BasicOSMParser Cross-platform Java GPLv3 A XML data parser to manipulate OSM objects in Java, also able to do CSV exports
Geow Cross-platform Scala Apache 2 Lightweight framework for processing OSM data
Gosmparse Cross-platform Go MIT Parsing OpenStreetMap PBF files at speed
imposm.parser Cross-platform Python Apache 2 Process PBF and OSM XML files
LibOsm Cross-platform C++ GPLv3 Store/update OSM datas in SQLlite database
LibOSM Cross-platform Java GPL
libosmscout Cross-platform C++, Java LGPL raw data parsing and preprocessing, database functionality
osm-common Android, Java Java Apache 2 osm.xml and osc.xml parsing and processing
Osm.ml Cross-platform OCaml WTFPL Parses the basic objects of a .osm file
osm-read Node.js, Web JavaScript LGPLv3 OpenStreetMap XML and PBF data parser for node.js and the browser
OSM2Hive Cross-platform Hive Apache 2 OSM data importer for Hive / Hadoop clusters
osm4j Cross-platform Java LGPL
OSMemory Cross-platform Java LGPLv3 Library for validators with o5m fast reader. It loads data to memory that allow to use osm data without PostgreSQL
Osmium Cross-platform C++ GPLv3 toolkit and framework for working with OSM data
OSMLib Cross-platform Ruby Public domain osm to shapefile conversion
OSMonaut Cross-platform Java MIT Parser for binary OSM files that always returns complete entities
Osmosis Java, Android Java LGPLv3
osmpbf Cross-platform C++ LGPLv3 based on iterator concept
osmpbf Cross-platform Go MIT PBF file format parser
Osmread Cross-platform Python MIT Simple library for reading XML and PBF data files
pbf2osm Cross-platform C GPLv3 converts pbf files back to osm based XML files
Smrender Cross-platform C GPLv3 modular OSM data processing

Generating map images

Main article: Rendering

Most client-side static and interactive map libraries display static map images or raster tiles generated on the server side. These server-side libraries are used by tile servers that need to generate those raster tiles:

Library Platforms Target languages License Notes
Kartograph Cross-platform Python LGPL Kartograph is a simple and lightweight framework for building interactive map applications without any other mapping service. It was created with the needs of designers and data journalists in mind.
Mapnik Windows, macOS, Linux Python, JavaScript, C++ LGPL The most popular server-side 2D map renderer. Requires PostgreSQL and various C++ libraries. Designed to be fast and is suitable for tile generation on high-end servers but it isn't particularly easy to set up.
MapSurfer.NET Windows, Linux C# MIT Framework for map styling and publishing (rendering, caching) geospatial data to the Web.
node-mapbox-gl-native Node.js JavaScript BSD Renders Mapbox Vector Tiles using OpenGL; supports overlays, GeoJSON, and Mapbox GL styles
pgmapcss Cross-platform PostgreSQL AGPLv3 a library for PostgreSQL/PostGIS which works between an osm2pgsql-based database and Mapnik (and maybe other renderers)
Smrender Cross-platform C GPLv3 Offline paper chart rendering
TileMan Linux Lua GPLv3 Framework for serving OSM based tiles

Displaying static map images

Main article: Rendering

These client-side libraries fetch individual static map images from a tile server without adding an interactive UI around the images. In websites and applications, static map images are sometimes more appropriate than full map widgets, either due to performance concerns or because the map simply doesn’t need to be interactive.

Library Platforms Target languages License Notes
Mapbox Android Services Android, Java Java MIT Connects to Mapbox’s Static API
Mapbox Python SDK Cross-platform Python MIT Connects to Mapbox’s classic Static API
MapboxStatic.swift iOS, macOS, tvOS, watchOS Swift, Objective-C BSD Connects to Mapbox’s classic Static API

Displaying interactive maps

Main article: Rendering Main article: Deploying your own Slippy Map

Interactive maps, also known as slippy maps on the Web, are the most common way of integrating OpenStreetMap into a website or application. These client-side libraries can display OpenStreetMap-based maps directly. Most of them display raster or vector tiles generated by a tile server, while some render raw OpenStreetMap data fetched directly from an API. A number of server-side libraries make it easier to insert client-side map widgets in webpages.

Library Platforms Target languages Raster Vector License Notes
BruTile Cross-platform Silverlight, C# Yes No LGPL
Cartagen Web JavaScript No Yes MIT HTML5 Canvas/JavaScript-based renderer
CartoType Windows, iOS, Android, macOS, Unix C++, .NET, Java, Objective-C++ No Yes Proprietary
COSMCtrl Windows C++ Yes No Freeware MFC control
Halcyon Flash ActionScript Yes Yes WTFPL Rendering library developed by Richard Fairhurst and used within Potlatch 2
JMapViewer Java SE Java Yes No GPLv2
JXMapViewer2 Java SE Java Yes No LGPLv3 Swing control
Kartograph Web JavaScript Yes No LGPL Kartograph is a simple and lightweight framework for building interactive map applications without any other mapping service. It was created with the needs of designers and data journalists in mind.
Kothic JS Web JavaScript No Yes BSD Full-featured JavaScript map rendering engine using HTML5 Canvas. It was initially developed as a JavaScript port of Kothic.
Leaflet Web JavaScript Yes No BSD
libchamplain Linux C, Perl, Python Yes No LGPLv2.1+ Gnome/Gtk+ widget
libosmscout Cross-platform C++, Java Yes Yes LGPL offline vector map drawing (based on preprocessed data)
LocationMapViewer Android Java Yes No GPLv3+ Android-Intent; "geo:"-Uri; gpx and kml file/url
map::slippy Cross-platform Tcl Yes No BSD-style Tcl/Tk widget
Mapbox Android SDK Android Java Yes Yes BSD Displays Mapbox Vector Tiles in an interactive map using OpenGL ES
Mapbox Cordova Plugin iOS, Android JavaScript Yes Yes MIT Cordova plugin wrapping the Mapbox iOS SDK and Mapbox Android SDK
Mapbox GL JS Web JavaScript Yes Yes BSD Displays Mapbox Vector Tiles in a slippy map using WebGL
Mapbox iOS SDK iOS Objective-C, Swift, Interface Builder Yes Yes BSD Displays Mapbox Vector Tiles in an interactive map using OpenGL ES
Mapbox macOS SDK macOS Objective-C, Swift, Interface Builder, AppleScript Yes Yes BSD Displays Mapbox Vector Tiles in an interactive map using OpenGL
Mapbox Qt SDK Linux C++, QML Yes Yes BSD Displays Mapbox Vector Tiles in an interactive map using OpenGL and Qt
Mapbox SDK for Xamarin Android, iOS C# Yes Yes BSD Xamarin component wrapping the Mapbox Android SDK and Mapbox iOS SDK
mapsforge Android, Java Java Unknown Yes LGPLv3 OSM based replacement for Android's MapView class for offline tile sources and overlays. Java ME and Java SE.
Marble Windows, macOS, Linux C++, Python, QML Yes Yes LGPL Qt widget
Modest Maps Web JavaScript, ActionScript Yes No BSD
NativeScript Mapbox iOS, Android JavaScript Yes Yes MIT NativeScript plugin wrapping the Mapbox iOS SDK and Mapbox Android SDK
Nutiteq Maps SDK Android, iOS, Windows Phone Java, Objective-C++, Swift, C# Yes Yes Proprietary
OpenLayers Web JavaScript Yes No BSD-style
OpenScales Web, iOS, Android ActionScript Yes No LGPL Flex framework
osm-gps-map Cross-platform C, Python, JavaScript Yes No GPLv2 Gtk+ mapping widget drawing a GPS track, and points of interest on a moving map
osm2x3d Web JavaScript No Yes LGPLv3 OSM 3D converter using native WebGL rendering (x3dom JS library)
OSMBonusPack Android Java Yes No LGPL with exceptions Addon for osmdroid: Markers, Bubbles, Routes, Directions, KML and more...
osmdroid Android Java Yes No Apache 2 OSM based replacement for Android's MapView (v1 API) class. Supports online and offline tile sources and overlays for plotting icons, tracking location, drawing shapes.
OsmSharp iOS, Android, Windows Phone C# No Yes GPLv2 or commercial Offline vector map rendering
Polymaps Web JavaScript Yes Yes BSD Webmaps with Data overlays
QMapControl Cross-platform C++ Yes No LGPL Qt control
Qt Mobility Geoservices Extras Cross-platform C++, QML Yes No LGPLv2.1
QuartzMaps iOS Objective-C Yes Yes Proprietary Slippy Map and Vector Map rendering engine for iOS
React Native Mapbox GL iOS, Android JSX Yes Yes BSD React Native component wrapping the Mapbox iOS SDK and Mapbox Android SDK
SKMap Bindings iOS C# Unknown Yes MIT Xamarin bindings for the Skobbler iOS SDK
Skobbler Android SDK Android Java Unknown Yes Proprietary
Skobbler iOS SDK iOS Objective-C, Swift Unknown Yes Proprietary
skobbler.js Web JavaScript Yes No MIT
Tangram Web JavaScript No Yes MIT 2D and 3D map renderer using WebGL
Tangram ES Android, iOS, Linux, macOS C++ No Yes MIT 2D and 3D map renderer using OpenGL ES
WhirlyGlobe-Maply iOS, Android Objective-C, Swift, Java Yes Yes Apache 2 Geospatial display kit for iOS and Android based on OpenGL ES. Implements a 2D map and a 3D globe and can handle image base maps and tiled vector maps based on OSM data.
Xamarin.Android.Skobbler Android C# Unknown Yes MIT Xamarin bindings for the Skobbler Android SDK

Additionally, some client-side libraries can be used with OpenStreetMap tiles, even if they’re primarily intended for other uses:

Forward and reverse geocoding

Main article: Search engines

This table includes both server-side libraries and client-side libraries:

Library Platforms Target languages Forward Reverse License Notes
Gisgraphy Cross-platform Java Yes Yes LGPLv3 Geocoding/reverse geocoding, fulltextsearch, find nearby
mapsforge Android, Java Java Yes Yes LGPLv3 POI indexing and search. Java ME and Java SE.
osm-common Android, Java Java Yes Yes Apache 2 Nominatim
Services_OpenStreetMap Cross-platform PHP Yes Yes BSD Includes partial support for querying Nominatim servers. Went through PEAR PePr process

Navigation

Main article: Routing

This table includes both server-side libraries and client-side libraries:

Library Platforms Target languages License Notes
CartoType Windows, iOS, Android, macOS, Unix C++, .NET, Java, Objective-C++ Proprietary
GraphHopper Cross-platform Java, Objective-C, Swift Apache 2 Routing engine for car, bike and more. Can be used as web service, android library, iOS library or Java library.
libosmscout Cross-platform C++, Java LGPL offline routing (based on preprocessed data)
Mapbox Android Services Android, Java Java MIT Connects to Mapbox’s Directions API for route data
Mapbox GL Directions Web JavaScript MIT Plugin for Mapbox GL JS that connects to Mapbox’s Directions API for route data
Mapbox JavaScript SDK Web, Node.js JavaScript MIT Connects to Mapbox’s Directions API for route data
Mapbox Python SDK Cross-platform Python MIT Connects to version 4 of Mapbox’s Directions API for route data
Mapbox Ruby SDK Cross-platform Ruby MIT Connects to Mapbox’s Directions API for route data
MapboxDirections.swift iOS, macOS, tvOS, watchOS Swift, Objective-C ISC Connects to Mapbox’s Directions API for route data
mapsforge Android, Java Java LGPLv3 Route planning and navigation. Java ME and Java SE.
OSMNavigation Cross-platform Java GPL
Open Source Routing Machine Linux, macOS, FreeBSD, Node.js C++, JavaScript BSD Routing
OsmSharp iOS, Android, Windows Phone C# GPLv2 or commercial Offline routing
pyroutelib2 Cross-platform Python GPLv3+ Routing with custom vehicles and displaying the result
Routino Linux, macOS, Windows C AGPLv3 Flexible router with web interface and routing data analyser
Skobbler Android SDK Android Java Proprietary
Skobbler iOS SDK iOS Objective-C, Swift Proprietary

Code snippets

The following links provide source code that’s too small for a library but nevertheless useful:

See also:

Other developer tools

Main article: GIS software

General-purpose GIS libraries are often used in conjunction with OpenStreetMap-specific libraries to work with geographic data:

  • PROJ.4 - Geo Projection Conversion lib with multiple bindings
  • GDAL - Geo Raster image formats lib
  • OGR - Geo Vector data formats lib
  • PostGIS - The leading Geo enabled Database
  • spatialite - sqlite extension, fully fledged spatial db
  • Mapbender - Another more GIS focused web map lib
  • Geotools -Java GIS Toolkit
  • GIS-Python lab - Python GIS Toolkit

External links