Class Layer
java.lang.Object
org.openstreetmap.josm.data.imagery.vectortile.mapbox.Layer
- All Implemented Interfaces:
Destroyable
A Mapbox Vector Tile Layer
- Since:
- 17862
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intThe default extent for a vector tileprivate static final byteprivate final intThe extent of the tile, typically 4096.private static final byteprivate static final byteThe actual features of this layer in this tileprivate static final byteA list of unique keys.static final byteThe field value for a layer (inProtobufRecord.getField())private final StringA unique name for the layer.private static final byteprivate static final byteA list of unique values.private final byteThis is technically an integer, but there are currently only two major versions (1, 2).private static final byte -
Constructor Summary
ConstructorsConstructorDescriptionLayer(byte[] bytes) Create a new layerLayer(Collection<ProtobufRecord> records) Create a layer from a collection of records -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Called when the object has been destroyed.booleanprivate static Collection<ProtobufRecord>getAllRecords(byte[] bytes) Get all the records from a array of bytesintGet the extent of the tileGet the feature on this layerGet the geometry for this layergetKey(int index) Get a specified keygetName()Get the name of the layergetValue(int index) Get a specified valuebyteGet the Mapbox Vector Tile version specification for this layerinthashCode()private voidparseValueRecord(ByteArrayOutputStream byteArrayOutputStream, ProtobufRecord protobufRecord)
-
Field Details
-
LAYER_FIELD
The field value for a layer (inProtobufRecord.getField())- See Also:
-
VERSION_FIELD
- See Also:
-
NAME_FIELD
- See Also:
-
FEATURE_FIELD
- See Also:
-
KEY_FIELD
- See Also:
-
VALUE_FIELD
- See Also:
-
EXTENT_FIELD
- See Also:
-
DEFAULT_EXTENT
The default extent for a vector tile- See Also:
-
DEFAULT_VERSION
- See Also:
-
version
This is technically an integer, but there are currently only two major versions (1, 2). Required. -
name
A unique name for the layer. This must be unique on a per-tile basis. Required. -
extent
The extent of the tile, typically 4096. Required. -
keyList
A list of unique keys. Order is important. Optional. -
valueList
A list of unique values. Order is important. Optional. -
featureCollection
The actual features of this layer in this tile
-
-
Constructor Details
-
Layer
Create a layer from a collection of records- Parameters:
records- The records to convert to a layer- Throws:
IOException- - if an IO error occurs
-
Layer
Create a new layer- Parameters:
bytes- The bytes that the layer comes from- Throws:
IOException- - if an IO error occurs
-
-
Method Details
-
parseValueRecord
private void parseValueRecord(ByteArrayOutputStream byteArrayOutputStream, ProtobufRecord protobufRecord) throws IOException - Throws:
IOException
-
getAllRecords
Get all the records from a array of bytes- Parameters:
bytes- The byte information- Returns:
- All the protobuf records
- Throws:
IOException- If there was an error reading the bytes (unlikely)
-
getExtent
Get the extent of the tile- Returns:
- The layer extent
-
getFeatures
Get the feature on this layer- Returns:
- the features
-
getGeometry
Get the geometry for this layer- Returns:
- The geometry
-
getKey
Get a specified key- Parameters:
index- The index in the key list- Returns:
- The actual key
-
getName
Get the name of the layer- Returns:
- The layer name
-
getValue
Get a specified value -
getVersion
Get the Mapbox Vector Tile version specification for this layer- Returns:
- The version of the Mapbox Vector Tile specification
-
destroy
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable
-
equals
-
hashCode
-