{"id":13784474,"url":"https://github.com/tumic0/QtPBFImagePlugin","last_synced_at":"2025-05-11T19:33:12.432Z","repository":{"id":92283823,"uuid":"155124614","full_name":"tumic0/QtPBFImagePlugin","owner":"tumic0","description":"Qt image plugin for displaying Mapbox vector tiles","archived":false,"fork":false,"pushed_at":"2024-06-15T04:02:25.000Z","size":24411,"stargazers_count":46,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-03T19:08:47.869Z","etag":null,"topics":["mapbox","mbtiles","mvt","openmaptiles","pbf","qt","vector-tiles"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tumic0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"tumic0"}},"created_at":"2018-10-28T23:07:56.000Z","updated_at":"2024-07-19T01:02:52.000Z","dependencies_parsed_at":"2023-09-22T21:08:50.168Z","dependency_job_id":"fca16767-83b9-487a-8a68-a493ccd56f16","html_url":"https://github.com/tumic0/QtPBFImagePlugin","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tumic0%2FQtPBFImagePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tumic0%2FQtPBFImagePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tumic0%2FQtPBFImagePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tumic0%2FQtPBFImagePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tumic0","download_url":"https://codeload.github.com/tumic0/QtPBFImagePlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225086628,"owners_count":17418767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mapbox","mbtiles","mvt","openmaptiles","pbf","qt","vector-tiles"],"created_at":"2024-08-03T19:00:45.134Z","updated_at":"2025-05-11T19:33:12.406Z","avatar_url":"https://github.com/tumic0.png","language":"C++","funding_links":["https://github.com/sponsors/tumic0"],"categories":["Clients"],"sub_categories":[],"readme":"# QtPBFImagePlugin\nQt image plugin for displaying Mapbox vector tiles\n\n## Description\nQtPBFImagePlugin is a Qt image plugin that enables applications capable of\ndisplaying raster MBTiles maps or raster XYZ online maps to also display\nPBF(MVT) vector tiles without (almost, see usage) any application modifications.\n\nStandard Mapbox GL Styles are used for styling the maps. Most relevant style\nfeatures used by [Maputnik](https://maputnik.github.io/editor) are supported.\nA default fallback style (OSM-Liberty) for OpenMapTiles is part of the plugin.\n\n\"Plain\" PBF files as well as gzip compressed files (as used in MBTiles) are\nsupported by the plugin. The tile size is (since version 2.0 of the plugin) 512px\nto fit the styles and available data (OpenMapTiles, Mapbox tiles).\n\n## Usage\nDue to a major design flaw in the Mapbox vector tiles specification - the zoom\nis not part of the PBF data - the plugin can not be used \"as is\", but passing\nthe zoom level is necessary. This is done by exploiting the optional *format*\nparameter of the QImage constructor or the *QImage::loadFromData()* or\n*QPixmap::loadFromData()* functions. The zoom number is passed as ASCII string\nto the functions:\n```cpp\nQImage img;\nimg.loadFromData(data, QByteArray::number(zoom));\n```\n\nFor a complete code sample see the [pbf2png](https://github.com/tumic0/pbf2png)\nconversion utility.\n\n### HiDPI\nThe plugin supports vector scaling using QImageReader's *setScaledSize()* method,\nso when used like in the following example:\n```cpp\nQImage img;\nQImageReader reader(file, QByteArray::number(zoom));\nreader.setScaledSize(QSize(1024, 1024));\nreader.read(\u0026img);\n```\nyou will get 1024x1024px tiles with a pixel ratio of 2 (= HiDPI tiles).\n\n### Overzoom\nSince version 3 of the plugin tile overzoom is supported. If you set *format*\nto `$zoom;$overzoom`:\n```cpp\nQImage img;\nQByteArray fmt(QByteArray::number(zoom) + ';' + QByteArray::number(overzoom));\nimg.loadFromData(data, fmt);\n```\nyou will get (512\u003c\u003coverzoom)x(512\u003c\u003coverzoom)px tiles with a pixel ratio of 1.\nWhen overzoom is combined with setScaledSize(), the base size is the overzoomed\ntile size.\n\n## Styles\nThe map style is loaded from the\n[$AppDataLocation](http://doc.qt.io/qt-5/qstandardpaths.html)/style/style.json\nfile on plugin load. If the style uses a sprite, the sprite JSON file must\nbe named `sprite.json` and the sprite image `sprite.png` and both files must be\nplaced in the same directory as the style itself. *A style compatible with the\ntiles data schema (Mapbox, OpenMapTiles, Tilezen, Ordnance Survey, Esri, ...)\nmust be used.*\n\nFor a list of \"ready to use\" styles see the\n[QtPBFImagePlugin-styles](https://github.com/tumic0/QtPBFImagePlugin-styles)\nrepository.\n\n## Build\n### Requirements\n* Qt5 \u003e= 5.15 or Qt6\n* Zlib\n\n### Build steps\n#### Linux, OS X and Android\n```shell\nqmake pbfplugin.pro\nmake\n```\n#### Windows\n```shell\nqmake ZLIB=path/to/zlib pbfplugin.pro\nnmake\n```\n\n## Install\nCopy the plugin to the system Qt image plugins path to make it work. You may\nalso set the QT_PLUGIN_PATH system variable before starting the application.\nFor Linux, there are RPM and DEB [packages](https://build.opensuse.org/project/show/home:tumic:QtPBFImagePlugin)\nfor most common distros available on OBS.\n\n## Limitations\n* Only data that is part of the PBF file is displayed. External layers defined\nin the style are ignored.\n* Text PBF features must have a unique id (OpenMapTiles \u003e= v3.7) for the text\nlayout algorithm to work properly. Additionally, the tile buffer must be large\nenough to contain all neighboring text features overlapping to the tile bounds\n(only data from the tile itself can be drawn to the resulting image).\n* Expressions are not supported in the styles, only property functions are\nimplemented.\n\n## Changelog\n[Changelog](https://build.opensuse.org/projects/home:tumic:QtPBFImagePlugin/packages/QtPBFImagePlugin/files/qt6-qtpbfimageformat.changes)\n\n## Status\nA picture is worth a thousand words.\n#### OpenMapTiles\n\n* Data: [MapTiler](https://github.com/tumic0/GPXSee-maps/blob/master/World/MapTiler-OpenMapTiles.tpl)\n* Style: [OSM-liberty](https://github.com/tumic0/QtPBFImagePlugin-styles/blob/master/OpenMapTiles/osm-liberty/style.json)\n\n![osm-liberty 5](https://tumic0.github.io/QtPBFImagePlugin/images/osm-liberty-5.png)\n![osm-liberty 8](https://tumic0.github.io/QtPBFImagePlugin/images/osm-liberty-8.png)\n![osm-liberty 12](https://tumic0.github.io/QtPBFImagePlugin/images/osm-liberty-12.png)\n![osm-liberty 14](https://tumic0.github.io/QtPBFImagePlugin/images/osm-liberty-14.png)\n![osm-liberty 15](https://tumic0.github.io/QtPBFImagePlugin/images/osm-liberty-15.png)\n\n#### Mapbox\n\n* Data: [Mapbox](https://github.com/tumic0/GPXSee-maps/blob/master/World/Mapbox.tpl)\n* Style: [Bright](https://github.com/tumic0/QtPBFImagePlugin-styles/blob/master/Mapbox/bright/style.json)\n\n![bright 4](https://tumic0.github.io/QtPBFImagePlugin/images/bright-4.png)\n![bright 6](https://tumic0.github.io/QtPBFImagePlugin/images/bright-6.png)\n![bright 13](https://tumic0.github.io/QtPBFImagePlugin/images/bright-13.png)\n![bright 15](https://tumic0.github.io/QtPBFImagePlugin/images/bright-15.png)\n![bright 17](https://tumic0.github.io/QtPBFImagePlugin/images/bright-17.png)\n\n#### Tilezen\n\n* Data: [HERE](https://github.com/tumic0/GPXSee-maps/blob/master/World/here-vector.tpl)\n* Style: [Apollo-Bright](https://github.com/tumic0/QtPBFImagePlugin-styles/blob/master/Tilezen/apollo-bright/style.json)\n\n![apollo-bright 4](https://tumic0.github.io/QtPBFImagePlugin/images/apollo-bright-4.png)\n![apollo-bright 6](https://tumic0.github.io/QtPBFImagePlugin/images/apollo-bright-6.png)\n![apollo-bright 12](https://tumic0.github.io/QtPBFImagePlugin/images/apollo-bright-12.png)\n![apollo-bright 15](https://tumic0.github.io/QtPBFImagePlugin/images/apollo-bright-15.png)\n![apollo-bright 16](https://tumic0.github.io/QtPBFImagePlugin/images/apollo-bright-16.png)\n\n## Applications using QtPBFImagePlugin\n* [GPXSee](https://www.gpxsee.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftumic0%2FQtPBFImagePlugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftumic0%2FQtPBFImagePlugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftumic0%2FQtPBFImagePlugin/lists"}