Class TLcdMBTilesModelDecoder

java.lang.Object
com.luciad.format.mbtiles.TLcdMBTilesModelDecoder
All Implemented Interfaces:
ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdMBTilesModelDecoder extends Object implements ILcdModelDecoder
A model decoder for MBTiles files and services with either image or vector data.

Input

  • An instance of TLcdMBTilesDataSource.
  • A String referring to a TileJSON endpoint of an MBTiles service.
  • A String referring to an *.mbtiles file.

Supported files and services

This model decoder supports MBTiles files and services with image tiles (tile data formats jpg or png) and vector tiles. WebP image tiles are not supported, nor are files that use an IETF media type to describe their content.

Supported transfer protocols

  • All transfer protocols that are supported by java.io.File.
  • http
  • https

Model structure

  • This model decoder creates a model per MBTiles file or service.

Model descriptor

Model reference

  • All models returned by this model decoder have a Web Mercator reference, aligned with the MBTiles specification.

Model elements

Image tiles

The decoded model contains a single implementation of ALcdImage and ILcdEarthTileSet. The tiling structure of this tile set has world bounds defined in Web Mercator and a tile size of 256 by 256 pixels.

Vector tiles

The decoded model contains a single ILcdBounded object which represents the root node of the tile pyramid. No other information can be retrieved from this object: it is not possible to query the model for specific vector tile features or to select features using the API.

Instead, the features contained in a tile are only accessible through the layer on which they are visualized, either when they are passed to a styler or via ILcdSelection when the user selects them using the mouse. Features which are thus obtained will have the following properties:

  • Each feature is represented by an ILcdDataObject. You can retrieve its data type to learn which data properties the feature has.
  • The data object additionally has a property which contains the feature's geometry. This property is annotated with TLcdHasGeometryAnnotation. Hence, the geometry of a feature can be retrieved by passing the data object to ALcdShape#fromDomainObject().
  • The geometry is always a shape list with one or more elements. The elements can be either points, polylines, polygons or complex polygons. Furthermore, within a given shape list, all shapes will be of the same type.

Finally, note that vector tile features should be considered temporary objects. Due to the dynamic loading of tiles and switching between detail levels, API users are strongly advised not to retain strong references to features obtained from a vector tile model.

Thread safety

  • The decoded models are thread-safe for read access if you take a read lock.
  • The contents of the models are not meant to be edited.

Supported versions

  • MBTiles, compliant with version 1.1, 1.2 or 1.3.
  • TileJSON, compliant with version 3.0.

Further reading

The tutorial Working with MBTiles data provides more information and code examples of how to use MBTiles image and vector data in your applications. See TLspMBTilesVectorLayerBuilder for more details on how to visualize vector tiles in a Lightspeed view.
Since:
2023.1