Publication Date: 2019-02-15
Approval Date: 2019-01-22
Submission Date: 2018-11-08
Reference number of this document: OGC 18-074
Reference URL for this document: http://www.opengis.net/doc/PER/vtp-VTPD005
Category: Public Engineering Report
Editor: Jeff Yutzler
Title: OGC Vector Tiles Pilot: GeoPackage 1.2 Vector Tiles Extensions Engineering Report
COPYRIGHT
Copyright © 2019 Open Geospatial Consortium. To obtain additional rights of use, visit http://www.opengeospatial.org/
WARNING
This document is not an OGC Standard. This document is an OGC Public Engineering Report created as a deliverable in an OGC Interoperability Initiative and is not an official position of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard. Further, any OGC Engineering Report should not be referenced as required or mandatory technology in procurements. However, the discussions in this document could very well lead to the definition of an OGC Standard.
LICENSE AGREEMENT
Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement.
If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.
THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD. THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.
This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.
Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications.
This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.
None of the Intellectual Property or underlying information or technology may be downloaded or otherwise exported or reexported in violation of U.S. export laws and regulations. In addition, you are responsible for complying with any local laws in your jurisdiction which may impact your right to import, export or use the Intellectual Property, and you represent that you have complied with any regulations or registration procedures required by applicable law to make this license enforceable.
- 1. Summary
- 2. References
- 3. Terms and definitions
- 4. Overview
- 5. Pilot Results
- 6. Vector Tiles Extensions (Informative)
- 7. Requirements (Normative)
- 8. Discussion
- Appendix A: Revision History
- Appendix B: Bibliography
1. Summary
Tiled feature data, colloquially referred to as 'vector tiles', can be used to optimize the delivery of vector data over the web. This data may subsequently be used to support visualization (particularly through maps) as well as limited analysis activities. One goal of the OGC Vector Tiles Pilot was to define candidate extensions to existing OGC standards as a way to advance the use of vector tiles technology as part of the OGC baseline. This Engineering Report (ER) describes a set of possible extensions to GeoPackage 1.2 that documents the mechanism to store and retrieve vector tiles in a GeoPackage. These extensions work together to enable a GeoPackage to act as a container format that can support visualization and analysis activities, even in a Denied, Degraded, Intermittent, or Limited Bandwidth (DDIL) environment.
The GeoPackage Vector Tiles extensions define the rules and requirements for encoding vector tiles in a GeoPackage data store. There are five draft extensions:
-
The Vector Tiles Extension provides vector tiles support through the GeoPackage
tiles
option. -
The Mapbox Vector Tiles Extension allows the content of a tile Binary Large OBject (BLOB) to be a Mapbox Vector Tile as per version 2.1 of the Mapbox Vector Tile (MVT) specification [1].
-
The GeoJSON Vector Tiles Extension allows the content of each tile BLOB to be a GeoJSON file.
-
The OGC Web Services (OWS) Context Extension provides a way to store information describing a list of geospatial resources, including but not limited to maps, their layers, and the styles of those layers.
-
The Vector Tiles Attributes Extension allows attribute information for each feature to be stored in relational tables for more convenient querying.
To support vector tiles, a minimum of at least two extensions is required. The first extension enables vector tiles support. However, to be usable, an encoding format must be declared via either the second or third extension. The other extensions are purely optional.
These extensions, like all GeoPackage extensions, are intended to be transparent and to not interfere with GeoPackage-compliant, but non-supporting, software packages.
1.1. Requirements & Research Motivation
The research presented in this ER has been motivated by the increasing adoption of vector tiling within the geospatial industry.
The ER addresses deliverable D005 of the Vector Tiles Pilot. The Vector Tiles Pilot Call for Participation (CFP) outlines the deliverable as follows:
D005: GeoPackage 1.2 Vector Tiles Extension Engineering Report – An extension to GeoPackage 1.2 written as a draft OGC standard that describes the mechanism to store and retrieve vector tiles in GeoPackage.
1.2. Prior-After Comparison
Before the work performed in this Pilot, there was no interoperable mechanism for sharing vector tiles information in a portable container suitable for use in a DDIL environment. There were three specifications that were inputs to the work in this ER.
-
MBTiles is a format for storing tilesets, including but not limited to vector tiles. MBTiles is an open specification, but is fully controlled by Mapbox Inc. MBTiles was an influence on defining the OGC’s GeoPackage Encoding Standard.
-
Image Matters produced a community extension for GeoPackage, but this extension had not been proven through working code.
-
The GeoPackage Standards Working Group (SWG), in collaboration with participants from the GeoPackage Related Tables Interoperability Experiment, has developed the GeoPackage Related Tables Extension. This extension allows for a many-to-many relationship between base data and related data, though the working draft does not address vector tiles.
1.3. Recommendations for Future Work
-
When this project was initiated, the term "vector tiles" was used throughout. However, as the project progressed, the participants agreed that the term "tiled feature data" was more appropriate, particularly as a data type for GeoPackage. This is consistent with the term "tiled gridded coverage data" which is in OGC 17-066, a recently adopted OGC GeoPackage Extension. In the future, it would be appropriate to migrate references to "vector tiles" should be migrated to "tiled feature data". The exception is Mapbox Vector Tiles which is a specific technology solution.
-
There are a number of possibilities for future work pertaining to attributes. This Pilot did not take a close look at the potential for using the available attribute information to support analysis operations. It is not clear at this time what is possible given the way that geometry and feature information is spread across multiple tiles. There is currently no agreed upon way to associate the different layers embedded within a single MVT tile set with their own individual attributes table.
-
GeoPackage does not currently have an interoperable mechanism for styling. This was looked at during the Pilot, but a consensus was not reached. Future work to address this gap would allow styling rules to be shared and maps to display consistently in different GeoPackage clients.
1.4. Document contributor contact points
All questions regarding this document should be directed to the editor or the contributors:
Contacts
Name | Organization |
---|---|
Jeff Yutzler |
Image Matters LLC |
Gobe Hobona |
OGC |
Carl Reed |
Carl Reed and Associates |
Alia Robinson |
Image Matters LLC |
Adam Parsons |
Compusult Ltd. |
1.5. Foreword
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The Open Geospatial Consortium shall not be held responsible for identifying any or all such patent rights.
Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.
2. References
The following normative documents are referenced in this document.
3. Terms and definitions
For the purposes of this report, the definitions specified in Clause 4 of the OWS Common Implementation Standard OGC 06-121r9 shall apply. In addition, the following terms and definitions apply.
-
Extended GeoPackage
a GeoPackage that contains any additional data elements (tables or columns) or SQL constructs (data types, indexes, constraints or triggers) that are not specified in this encoding standard.
-
GeoPackage file
a platform-independent SQLite database file that contains GeoPackage data and metadata tables with specified definitions, integrity assertions, format limitations and content constraints.
-
tile
a rectangular pictorial representation of geographic data, often part of a set of such elements, covering a spatially contiguous extent and sharing similar information content and graphical styling, which can be uniquely defined by a pair of indices for the column and row along with an identifier for the tile matrix.
4. Overview
This Engineering Report contains the following sections that describe the way in which Vector Tiles support in GeoPackage can be implemented through a set of extensions:
-
Section 5 presents a summary of the GeoPackage-related accomplishments during this Pilot, including any relevant Technology Integration Experiments (TIEs).
-
Section 6 presents an informative specification for the proposed Vector Tiles Extensions.
-
Section 6a presents the Vector Tiles Extension. This extension provides vector tiles support through the GeoPackage
tiles
option. Instead of PNG or JPG files, each tile BLOB is a Vector Tile. -
Section 6b presents the Mapbox Vector Tiles Extension. This extension allows the content of a tile BLOB to be a Mapbox Vector Tile as per the Mapbox Vector Tiles (MVT) specification version 2.1.
-
Section 6c presents the GeoJSON Vector Tiles Extension. This extension allows the content of a tile BLOB to be a GeoJSON file.
-
Section 6d presents the OWS Context Extension. This extension provides a way to store information describing a list of geospatial resources, including but not limited to maps, their layers, and the styles of those layers.
-
Section 6e presents the Vector Tiles Attributes Extension. This extension allows attribute information for each feature to be stored in relational tables for more convenient querying. It uses the GeoPackage
attributes
option in conjunction with the emerging GeoPackage Related Tables Extension.
-
-
Section 7 presents the extensions in Section 6 as normative requirements that could be the basis for an OGC standard.
-
Section 8 describes discussion topics, critical topics that came up during the Pilot, that the GeoPackage Standards Working Group would want to consider before adopting these extensions as a standard.
-
Annex A presents the revision history of this document.
-
Annex B contains a Bibliography.
5. Pilot Results
5.1. Pilot Architecture
The Pilot is designed to be delivered within a short timescale in a phased approach, Phase 1 consists of delivery of draft components and ERs and Phase 2 requires delivery of final components and ERs. The overall goal of the Pilot is to integrate Vector Tiles into existing OGC standards to enable their usage through OGC compliant architectures. This is done through profiling and providing extensions to existing standards. This section contains a short description of each of the delivered components, ERs and an overall architecture.
The architecture of the pilot is designed to cover the three main server client relationships that are common in OGC use cases as illustrated in Figure 1:
-
Desktop Client → Web Feature Service (WFS) 3.0
-
Web Client → Web Map Tile Service (WMTS) 1.0
-
Mobile Client → GeoPackage 1.2
This architecture attempts to address vector tiles in each of the client server relationships to simultaneously enable vector tiles across the relevant suite of OGC standards. This approach provides implementers with guidance for vector tiles no matter their OGC use case.
5.2. Providers
During this Pilot, three GeoPackage Vector Tiles providers were produced.
5.2.1. Compusult
The Compusult GeoPackage Producer runs as a web-browser based application, as well as being accessible via an OGC Web Processing Service (WPS) instance. The GeoPackage Producer supports producing Mapbox Vector Tile and GeoJSON tile based GeoPackages in a user selected projection system and an uploaded vector source(Shapefile(s),GeoDatabase,SqliteDB etc..). The producer has the ability to convert all feature types into a single Mapbox Vector Tile or produce a single Vector Tile layer for each feature type. Furthermore, the producer also has the ability to embed feature attributes into the Mapbox Vector Tile or to use a GeoPackage Related Tables Extension to produce attributes tables and appropriate mappings for optimal storage. Processed features are converted to Mapbox Vector Tiles (MVT) specification version 2.1 by using the open-source Java library Mapbox Vector Tile Java. Feature types of Polygon and Point geometries have their bounds clipped using a buffer to ensure clients can render freely without having to worry about artificial line segments from tile bounds. Automatic layer order for drawing purposes is detected by examining feature type size, bounds and type. The result of the Vector Tile Extension is a GeoPackage that is compliant to specifications of the National System for Geospatial Intelligence (NSG).
5.2.2. CubeWerx
The CubeWerx GeoPackage producer is integrated into the tile-management system for the CubeWerx implementation of the OGC WMTS standard and can generate tiles in different projections and formats from source data of many different formats registered with the CubeSTOR database. The Vector Tiles Pilot added the ability for the underlying tiling system to manage MapBox and GeoJSON vector tiles for the WMTS interface and to write them out into GeoPackages according to the draft Vector Tile Extension Specification. Deflate compression for the vector-tile blobs is also supported and can make the individual tiles a fraction of their uncompressed size.
As recommended by the MVT specification, the CubeWerx-provided MVT tiles clip lines and polygons to the edge of a buffer zone around each tile. By default, we use a buffer zone of 2% of the linear vector-tile size (so a 1024x1024 vector tile would have a buffer zone that’s 20 vector-tile pixels thick), but that percentage is configurable.
5.2.3. Ecere
Functionality to produce GeoPackages was added to Ecere’s GNOSIS Cartographer GIS desktop application. Multiple data layers can be selected to export into a GeoPackage. The option of tiling vector data using the new vector tiles extensions is provided. A number of options are available, such as whether to embed attributes information within the individual tiles themselves, or store them within an attributes table in the GeoPackage, which is normally done for storing non-tiled vector data. The advantage of the attributes table approach is to avoid repeating the same information for features which occur in many different tiles. This approach also provides the ability to perform SQL queries, potentially together with the R-tree extension for spatial indexing. A choice of tiling schemes is available, including the following:
-
tiling schemes based on WMTS Well Known Scale Sets, such as Google Maps Compatible
-
the GNOSIS Global Grid which has the benefit of featuring fewer tiles closer to the pole than at the equator [1]
A selection of supported encodings is provided, including MVT, GeoJSON, GeoECON, GML, and GNOSIS Map Tiles. The user can select whether multiple layers should be encoded as a single MVT set (with multiple layers in each encoded tile), or as a separate tile set per layer. The ability to define and include styles within the GeoPackage, which can be based in part on the attributes associated with the data, was also implemented. Multiple style encodings can be included (GeoPackages produced have also contained Mapbox GL styles, GNOSIS Cascading Map Style Sheets, SLD/SE and GeoCSS).
5.3. Clients
During this Pilot, four client applications were produced.
5.3.1. Compusult
The Compusult GeoPackage client runs as a web-browser based application, as well as a desktop/android based application. The GeoPackage client supports both Mapbox Vector Tile and GeoJSON tile formats. The client application allows users to select and enable/disable specific WMTS layers as well as overlay any specified base map for visualization. Styles are randomly generated for each layer. The screenshots below show the GeoPackage client rendering different GeoPackage providers. The client also allows for native GetFeatureInfo requests to be sent to a supporting server. GetFeatureInfo is one of the operations offered by Web Map Service (WMS) and WMTS compliant services. Web-browser based applications used a GeoPackage to produce internal WMS/WMTS services that were then rendered by the browser.
Minor Issues Noted
-
GeoPackage web-based services displayed with all feature types as individual layers resulted in slow rendering times on a web-based client due to the number of requests and browser request limitations.
-
Services with MVT tiles that have polygons that are not buffered will result in displaying intermittent tile boundaries when trying to render polygon strokes. The same issue occurs when rendering points with images that cross tile boundaries.
-
GeoPackages with multiple layers did not specify the correct drawing order to properly layer all feature types with no stylesheet provided.
Recommendations
-
Specification of a media-type (formerly known as a MIME-type) is required in the data-model to ensure clients do not have to inspect tile data to determine the encoding type of the content provided.
-
Clients should not have to depend on sibling tiles to perform proper rendering operations.
5.3.2. Image Matters Client #1 - GeoPackage.js
GeoPackage.js is an in-browser GeoPackage client published by the National Geospatial-intelligence Agency (NGA). This client is capable of displaying tile tables with image data and feature tables with vector data from a GeoPackage. Image Matters has extended this client to add support for vector tiles encoded using the Mapbox Vector Tile Specification. This extension uses the Leaflet VectorGrid library to render these tiles. This implementation extends VectorGrid.Protobuf from this library to retrieve Protobufs from a GeoPackage rather than from the web. When a user imports a GeoPackage, the user tables are listed in the right pane and may be individually toggled on and off in the displayed map on the left. Expanding the “details” of a table allows a user to view the table metadata, tile bounds, feature attributes, and layers within a vector tile table.
5.3.3. Image Matters Client #2 - Mobile Client
The Vector Tile mobile client creates a tile provider that returns a rendered tile image given a column, row, and zoom level. The client first searches the specified Vector Tiles table in the GeoPackage for a Vector Tile blob at that column, row, and zoom level. The client then parses the BLOB, then looks for styling information. Styling information is included in the GeoPackage as a JSON file. The client then renders the features using that styling information, and saves an image to a tile cache. Layers are saved individually, so that they may be enabled and disabled separately. The map engine can simply display these images at the correct coordinates, which is handled automatically by the tile provider. This version of the client does not have well-specified styling rules. This is something that should be looked at in the future.