@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdMBTilesModelDecoder extends Object implements ILcdModelDecoder
File | Required | Entry point | Description |
---|---|---|---|
*.mbtiles | X | X | The database file |
This model decoder supports MBTiles files with image tiles (tile data formats jpg
or
png
) and vector tiles. WebP images are not supported, nor are files that
use an IETF media type to describe their content.
ILcdDataSourceModelDescriptor
containing a TLcdMBTilesDataSource
. The getDataType()
method of the data source allows you to distinguish between image and vector tiles.
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.
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:
ILcdDataObject
.
You can retrieve its data type to learn which data properties the feature has.TLcdHasGeometryAnnotation
.
Hence, the geometry of a feature can be retrieved by passing the data object to
ALcdShape#fromDomainObject()
.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.
read lock
.TLspMBTilesVectorLayerBuilder
for more details on how to visualize vector tiles in a Lightspeed view.Modifier and Type | Field and Description |
---|---|
static String |
TYPE_NAME
A general and human-readable type name for the MBTiles data format
|
Constructor and Description |
---|
TLcdMBTilesModelDecoder()
Creates a new MBTiles model decoder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(ILcdDataSource aDataSource)
Checks whether the given data source can be decoded with this model decoder.
|
boolean |
canDecodeSource(String aSource)
Checks whether the given source can be decoded with this model decoder.
|
ILcdModel |
decode(String aSource)
Decodes the single dataset in an MBTiles file.
|
ILcdModel |
decodeSource(ILcdDataSource aDataSource)
Creates a model for the given data source.
|
List<TLcdMBTilesDataSource> |
discoverDataSources(String aPath)
Returns the single data source in the given MBTiles file.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decodeModelMetadata, decodeModelMetadata
public static final String TYPE_NAME
public TLcdMBTilesModelDecoder()
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(ILcdDataSource aDataSource)
This model decoder handles TLcdMBTilesDataSource
data sources and TLcdDataSource
data sources.
The latter case delegates the source to the canDecodeSource(String)
method.
canDecodeSource
in interface ILcdModelDecoder
aDataSource
- the dataset to be decoded.true
if the data source is a TLcdMBTilesDataSource
or a TLcdDataSource
, false
otherwise.decodeSource(com.luciad.model.ILcdDataSource)
public ILcdModel decodeSource(ILcdDataSource aDataSource) throws IOException
The data source must be a TLcdMBTilesDataSource
, which represents one data set
in the MBTiles file.
decodeSource
in interface ILcdModelDecoder
aDataSource
- the dataset to be decoded.class javadoc
.IOException
- if the dataset cannot be loaded.canDecodeSource(com.luciad.model.ILcdDataSource)
public boolean canDecodeSource(String aSource)
This model decoder handles only .mbtiles
files.
canDecodeSource
in interface ILcdModelDecoder
aSource
- the data source to be verified; typically a file name or a URL.true
if the source has .mbtiles
extension.decode(String)
public ILcdModel decode(String aSource) throws IOException
decode
in interface ILcdModelDecoder
aSource
- the MBTiles file to be decoded.IOException
- if the file cannot be loaded.canDecodeSource(String)
public List<TLcdMBTilesDataSource> discoverDataSources(String aPath) throws IOException
decodeSource(com.luciad.model.ILcdDataSource)
to create a model for an individual data source.discoverDataSources
in interface ILcdModelDecoder
aPath
- A path to the data source to be decoded; typically a file name or a URL.IOException
- if the file cannot be read