Zh-hans:Frameworks

,有时也被称为框架组件模块软件开发包(SDK),包含了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.

访问原始OSM数据

主条目:Databases and data access APIs

OpenStreetMap有用于访问原始的未处理的数据的API。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.

平台目标语言APIXAPIOverpass协议注释
osm-commonAndroid,JavaJava是没有是Apache 2Overpass,变更集服务器
osmapiAndroid,JavaJava是没有没有LGPLv3Complete implementation of the API 0.6,包含地图数据,轨迹,注解,变更集,用户信息等
osmapi跨平台Python是没有没有GPLv3
OsmApiClient 跨平台 C# .Net Standard 2.0 是 没有 没有 MIT 完全支持API v0.6的所有被列出的特性
osmaR跨平台R是没有没有GPLv2
Rosemary跨平台Ruby是没有没有MIT
Services_OpenStreetMap跨平台PHP是没有没有BSD也支持访问用户信息。Went through PEAR PePr process

处理OSM数据

主条目:Converting map data between formats
主条目::Category:File Converters

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

LibraryPlatformsTarget languagesLicenseNotes
AtlasCross-platformJava, PythonBSD 3-ClauseA tool to represent network-navigable OSM data in memory and to run data integrity checks at scale using Spark
BasicOSMParserCross-platformJavaGPLv3A XML data parser to manipulate OSM objects in Java, also able to do CSV exports
GeowCross-platformScalaApache 2Lightweight framework for processing OSM data
gOSMonautCross-platformGoMITPBF file parser that delivers nested entities
GosmparseCross-platformGoMITParsing OpenStreetMap PBF files at speed
imposm.parserCross-platformPythonApache 2Process PBF and OSM XML files. Python <= 2.7 only, no longer updated.
LibOsmCross-platformC++GPLv3Store/update OSM data in an SQLite database
LibOSMCross-platformJavaGPL
libosmscoutCross-platformC++, JavaLGPLRaw data parsing and preprocessing, database functionality
osm-commonAndroid, JavaJavaApache 2osm.xml and osc.xml parsing and processing
Osm.mlCross-platformOCamlWTFPLParses the basic objects of a .osm file
osm-readNode.js, WebJavaScriptLGPLv3OpenStreetMap XML and PBF data parser for Node.js and the browser
OSM2HiveCross-platformHiveApache 2OSM data importer for Hive / Hadoop clusters
osm4jCross-platformJavaLGPL
osm4scalaCross-platformScalaMITLightweight and high performance Scala library focus in parse PBF2 OSM files as iterators.
OSMemoryCross-platformJavaLGPLv3Library for validators with o5m fast reader. It loads data to memory that allow to use osm data without PostgreSQL
libosmiumCross-platformC++BSL-1.0Toolkit and framework for working with OSM data
OSMJSON.Net Cross-platform C# .Net Apache 2 OSMJSON.Net is a library containing the necessary types for serializing and de-serializing of OSM JSON
OSMKitiOS, macOSObjective-CMITParses and stores OSM data in a spatialite database.
OSMLibCross-platformRubyPublic domainosm to shapefile conversion
OSMonautCross-platformJavaMITParser for binary OSM files that always returns complete entities
OsmosisJava, AndroidJavaLGPLv3
Osm-parquetizer Cross-platform Java Apache 2 Converts PBF files to Parquet, making the OSM data BigData friendly (Hadoop/Spark)
osmpbfCross-platformC++LGPLv3Based on iterator concept
osmpbfCross-platformGoMITPBF file format parser
OsmreadCross-platformPythonMITSimple library for reading XML and PBF data files
osmtogeojson Cross-platform JavaScript MIT OSM XML to GeoJSON converter
OsmTagsTranslator Windows C# .Net MIT Use SQLite queries to translate element tags (string manipulation or joining with look-up tables)
osm2geojson Cross-platform Python MIT OSM XML (and Overpass XML/JSON) to GeoJSON converter
parallelpbf Cross-platform Java GPLv3 PBF format multithreaded reader written in Java
pbf2osmCross-platformCGPLv3Converts pbf files back to osm based XML files
PyOsmium Cross-platform Python BSD 2-Clause Process PBF and OSM XML files. Toolkit and framework for working with OSM data.
SmrenderCross-platformCGPLv3Modular OSM data processing
spark-osm-datasource Cross-platform Scala GPLv3 PBF format datasource for Apache Spark

创建地图图像

主条目: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:

LibraryPlatformsTarget languagesLicenseNotes
KartographCross-platformPythonLGPLKartograph 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.
MapnikWindows, macOS, LinuxPython, JavaScript, C++LGPLThe 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.NETWindows, LinuxC#MITFramework for map styling and publishing (rendering, caching) geospatial data to the Web.
node-mapbox-gl-nativeNode.jsJavaScriptBSDRenders Mapbox Vector Tiles using OpenGL; supports overlays, GeoJSON, and Mapbox GL styles
pgmapcssCross-platformPostgreSQLAGPLv3A library for PostgreSQL/PostGIS which works between an osm2pgsql-based database and Mapnik (and maybe other renderers)
SmrenderCross-platformCGPLv3Offline paper chart rendering
TileManLinuxLuaGPLv3Framework for serving OSM based tiles

显示静止的地图图像

主条目: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.

LibraryPlatformsTarget languagesLicenseNotes
Mapbox Android ServicesAndroid, JavaJavaMITConnects to Mapbox’s Static API
Mapbox Python SDKCross-platformPythonMITConnects to Mapbox’s classic Static API
MapboxStatic.swiftiOS, macOS, tvOS, watchOSSwift, Objective-CBSDConnects to Mapbox’s Static API
A-FrameWebBrowserJavaScriptMITPlaces Maps (Bit/Vector) into a 3D environment

显示可互动的地图

主条目:Rendering
主条目: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.

LibraryPlatformsTarget languagesRasterVectorLicenseNotes
BruTileCross-platformSilverlight, C#是没有LGPL
CartagenWebJavaScript没有是MITHTML5 Canvas/JavaScript-based renderer
Carto Mobile SDKAndroid, iOS, WindowsJava, Objective-C++, Swift, C#是是BSD
CartoTypeiOS, Android, Windows, Mac OS, Unix, QtC++, .NET, Java, Objective C, Swift, C#没有是Proprietary Offline or online map rendering using Open GL ES or CPU rendering; can use OSM and other data sources including ESRI shapefiles; provides routing, turn by turn navigation, geocoding, address search and full-text search.
COSMCtrlWindowsC++是没有FreewareMFC control
GLMapiOS, AndroidObjective-C, Swift, Java是是ProprietaryOffline or online vector map rendered on device using OpenGL ES
Fleaflet Flutter Dart是没有 BSD 3-Clause A Flutter map widget inspired by Leaflet
HalcyonFlashActionScript是是WTFPLRendering library developed by Richard Fairhurst and used within Potlatch 2
JMapViewerJava SEJava是没有GPLv2
JXMapViewer2Java SEJava是没有LGPLv3Swing control
KartographWebJavaScript是没有LGPLKartograph 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 JSWebJavaScript没有是BSDFull-featured JavaScript map rendering engine using HTML5 Canvas. It was initially developed as a JavaScript port of Kothic.
LeafletWebJavaScript是没有BSD
libchamplainLinuxC, Perl, Python是没有LGPLv2.1+GNOME/GTK widget
libosmscoutCross-platformC++, Java是是LGPLOffline vector map drawing (based on preprocessed data)
LocationMapViewerAndroidJava是没有GPLv3+Android-Intent; "geo:"-Uri; gpx and kml file/URL
map::slippyCross-platformTcl是没有BSD-styleTcl/Tk widget
Mapbox Android SDKAndroidJava, Kotlin是是BSDDisplays Mapbox Vector Tiles in an interactive map using OpenGL ES
Mapbox Cordova PluginiOS, AndroidJavaScript是是MITCordova plugin wrapping the Mapbox iOS SDK and Mapbox Android SDK
Mapbox GL JSWebJavaScript是是Proprietary (starting with v2), BSD (until v1.13)Displays Mapbox Vector Tiles in a slippy map using WebGL
MapLibre GL Web JavaScript是是 BSD Community led fork derived from Mapbox GL JS v1.13 prior to their switch to a non-OSS license
Mapbox iOS SDKiOSObjective-C, Swift, Interface Builder是是BSDDisplays Mapbox Vector Tiles in an interactive map using OpenGL ES
Mapbox macOS SDKmacOSObjective-C, Swift, Interface Builder, AppleScript是是BSDDisplays Mapbox Vector Tiles in an interactive map using OpenGL
Mapbox Qt SDKCross-platformC++, QML是是BSDDisplays Mapbox Vector Tiles in an interactive map using OpenGL and Qt
Mapbox SceneKit SDKiOSObjective-C, Swift是是ISCProvides data for generating custom 3D scenes in SceneKit
Mapbox SDK for XamarinAndroid, iOSC#是是BSDXamarin component wrapping the Mapbox Android SDK and Mapbox iOS SDK
Mapbox Unity SDKCross-platformC#是是ApacheProvides data for generating custom 3D scenes in Unity
mapsforgeAndroid, JavaJavaUnknown是LGPLv3OSM based replacement for Android's MapView class for offline tile sources and overlays. Java ME and Java SE.
MarbleWindows, macOS, LinuxC++, Python, QML是是LGPLQt widget
Modest MapsWebJavaScript, ActionScript是没有BSD
NativeScript MapboxiOS, AndroidXML, JavaScript是是MITNativeScript plugin wrapping the Mapbox iOS SDK and Mapbox Android SDK
Navmii Mobile SDKiOS, AndroidUnknownUnknown是ProprietaryUnclear what is offered; documentation is unavailable without an account
OpenLayersWebJavaScript是没有BSD-style
OpenScalesWeb, iOS, AndroidActionScript是没有LGPLFlex framework
osm-gps-mapCross-platformC, Python, JavaScript是没有GPLv2GTK mapping widget drawing a GPS track, and points of interest on a moving map
osm2x3dWebJavaScript没有是LGPLv3OSM 3D converter using native WebGL rendering (x3dom JavaScript library)
OSMBonusPackAndroidJava是没有LGPL with exceptionsAddon for osmdroid: Markers, Bubbles, Routes, Directions, KML and more...
osmdroidAndroidJava是没有Apache 2OSM based replacement for Android's MapView (v1 API) class. Supports online and offline tile sources and overlays for plotting icons, tracking location, drawing shapes.
OsmSharpiOS, Android, Windows PhoneC#没有是GPLv2 or commercialOffline vector map rendering
PolymapsWebJavaScript是是BSDWebmaps with Data overlays
QMapControlCross-platformC++是没有LGPLQt control
QtLocationCross-platformC++, QML是是LGPLv3 or commercialQt module for mapping, navigation, geocoding and places of interest with pluggable architecture to provide geoservices. Supersedes QtMobility.Location. OSM services for mapping, geocoding, routing and places now included by default.
Qt Mobility Geoservices ExtrasCross-platformC++, QML是没有LGPLv2.1
QuartzMapsiOSObjective-C是是ProprietarySlippy Map and Vector Map rendering engine for iOS
React Native Mapbox GLiOS, AndroidJSX是是BSDReact Native component wrapping the Mapbox iOS SDK and Mapbox Android SDK
SKMap BindingsiOSC#Unknown是MITXamarin bindings for the Skobbler iOS SDK
Skobbler Android SDKAndroidJavaUnknown是Proprietary
Skobbler iOS SDKiOSObjective-C, SwiftUnknown是Proprietary
skobbler.jsWebJavaScript是没有MIT
TangramWebJavaScript没有是MIT2D and 3D map renderer using WebGL
Tangram ESAndroid, iOS, Linux, macOSC++没有是MIT2D and 3D map renderer using OpenGL ES
WhirlyGlobe-MaplyiOS, AndroidObjective-C, Swift, Java是是Apache 2Geospatial 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.SkobblerAndroidC#Unknown是MITXamarin 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

主条目:Search engines

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

LibraryPlatformsTarget languagesForwardReverseLicenseNotes
GisgraphyCross-platformJava是是LGPLv3Geocoding/reverse geocoding, fulltextsearch, find nearby
mapsforgeAndroid, JavaJava是是LGPLv3POI indexing and search. Java ME and Java SE.
osm-commonAndroid, JavaJava是是Apache 2Nominatim
Pelias Android SDKAndroidJava是是ApacheConnects to Mapzen’s Pelias Geocoder instance
Pelias iOS SDKiOS, macOSSwift是是Apache 2Connects to Mapzen’s Pelias Geocoder instance
Services_OpenStreetMapCross-platformPHP是是BSDIncludes partial support for querying Nominatim servers. Went through PEAR PePr process
osm-reverse-geocoderCross-platformPL/pgSQL没有是MITSimple address reverse geocoding
Nominatim.API Windows,Cross-platform C#是是 MIT Library for utilizing geocoding (forward and reverse), in addition to address lookups, with the Nominatim HTTP API. Targets .NET Standard 2.0. Available on NuGet: Nominatim.API

导航

主条目:Routing

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

LibraryPlatformsTarget languagesLicenseNotes
openrouteservice Cross-plattform, Web Java, R, Python, Javascript .. LPGL routing/directions, isochrones, geocoding, maps, time-distance matrix, accessibility etc. many traffic profiles
CartoTypeWindows, iOS, Android, macOS, UnixC++, .NET, Java, Objective-C, Swift, C#Proprietary offline routing for drivers, cyclists, walkers; configurable routing profiles; can export routes and instructions
GraphHopperCross-platformJava, Objective-C, SwiftApache 2Routing engine for car, bike and more. Can be used as web service, android library, iOS library or Java library.
libosmscoutCross-platformC++, JavaLGPLoffline routing (based on preprocessed data)
Mapbox Android ServicesAndroid, JavaJavaMITConnects to Mapbox’s Directions API for route data
Mapbox Directions for SwiftiOS, macOS, tvOS, watchOSSwiftISCConnects to Mapbox’s Directions API for route data
Mapbox GL DirectionsWebJavaScriptMITPlugin for Mapbox GL JS that connects to Mapbox’s Directions API for route data
Mapbox JavaScript SDKWeb, Node.jsJavaScriptMITConnects to Mapbox’s Directions API for route data
Mapbox Navigation SDK for AndroidAndroidJava, KotlinMITEmbeds a turn-by-turn navigation UI with voice guidance into an Android application
Mapbox Navigation SDK for iOSiOSSwiftISCEmbeds a turn-by-turn navigation UI with voice guidance into an iOS application
Mapbox Python SDKCross-platformPythonMITConnects to version 4 of Mapbox’s Directions API for route data
Mapbox Ruby SDKCross-platformRubyMITConnects to Mapbox’s Directions API for route data
Mapbox Unity SDKCross-platformC#ApacheConnects to Mapbox’s Directions API for route data
mapsforgeAndroid, JavaJavaLGPLv3Route planning and navigation. Java ME and Java SE.
Mapzen iOS SDKiOSSwift, Objective-CApacheConnects to Mapzen Turn-by-Turn (powered by Valhalla) via OnTheRoad for iOS
Navmii Mobile SDKiOS, AndroidUnknownProprietary
On The RoadAndroidJavaApacheConnects to Mapzen Turn-by-Turn (powered by Valhalla)
Open Source Routing MachineLinux, macOS, FreeBSD, Node.jsC++, JavaScriptBSDRouting
OpenTripPlanner Web Java GPL Multimodal routing for public transit, bicycle, pedestrian, and car.
OSMNavigationCross-platformJavaGPL
OsmSharpiOS, Android, Windows PhoneC#GPLv2 or commercialOffline routing
pyroutelib2Cross-platformPythonGPLv3+Routing with custom vehicles and displaying the result
RoutinoLinux, macOS, WindowsCAGPLv3Flexible router with web interface and routing data analyser
Skobbler Android SDKAndroidJavaProprietary
Skobbler iOS SDKiOSObjective-C, SwiftProprietary

Code snippets

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

See also:

  • Category:Unix command examples
  • Category:Python,Category:Perl, Category:Java

其他开发者工具

主条目: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
  • k3b-geoHelper - java lib to parse gpx and kml files and en/decode geo-uris. Works with Android, too
  • Pic4Carto.js - JavaScript library for open-licensed street pictures retrieval (which can be used for photo mapping, tutorial)

By language

外部链接

This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.