### tilebase

`1.5.0`
Need help reading this?

### TileBase

new TileBase(url: string, opts: Object)
Parameters
url `(string)` URL location of TileBase
opts `(Object)` Options Object
Properties
config `(Config)` : Read Config Options
config_length `(number)` : Length of Config in Bytes
start_index `(number)` : Byte Index to start of Tile Addresses
start_tile `(number)` : Byte Index to start of Tile Data
version `(number)` : TileBase Version
isopen `(boolean)` : Is the TileBase file open
handle `((FileHandle | MemHandle))` : TileBase read options
Static Members
▸ to_tb(input, output)

Convert an MBtiles file to TileBase

to_tb(input: string, output: string): any
Parameters
input `(string)` Location to input MBTiles
output `(string)` Location to output TileBase
Returns
`any`: TileBase
Instance Members
▸ open()

Open a TileBase file for reading

open()
▸ close()

Close a TileBase file from reading

close()
▸ tilejson()

Return a partial TileJSON Object for the TileBase File Note: TileBase file will not populate the URL fields

tilejson(): Object
Returns
`Object`: TileJSON Object
▸ tile(z, x, y, unzip)

Return a single tile from a TileBase file

tile(z: number, x: number, y: number, unzip: boolean): any
Parameters
z `(number)` Z Coordinate
x `(number)` X Coordinate
y `(number)` Y Coordinate
unzip `(boolean = `false`)` Auto unzip tiles
Returns
`any`: Buffer Tile

### TBError

new TBError(status: number, message: string)

Extends Error

Parameters
status `(number)` Suggested HTTP Status
message `(string)` Error Message

### Config

new Config(tb: any)
Parameters
tb `(any)`
Properties
tb `(TileBase)` : TileBase Object
config `(Object)`

- `config.min` number

  Min Zoom

- `config.max` number

  Maz Zoom

- `config.ranges` Object

  BBOX Ranges per zoom level

Static Members
▸ write(output, config)

Write the header & config option to a given file location

write(output: string, config: Object)
Parameters
output `(string)` TileBase file to output to
config `(Object)` Config JSON Object
Instance Members
▸ read()

Read a config file from the TileBase file

read()
▸ verify()

Verify the current config file against the schema

verify()
▸ range()

Read the config portion of a TileBase file Note: usually called by the constructor

range(): number
Returns
`number`: Bytes of Config Data

### TileBaseFile

new TileBaseFile(url: string)
Parameters
url `(string)` Location of TileBase file
Properties
url `(string)` : Location of TileBase File
Instance Members
▸ read(position, size)

Return a buffer containing the requested bytes

read(position: BigInt, size: BigInt): Buffer
Parameters
position `(BigInt)` Byte to start reading
size `(BigInt)` Number of bytes to read
Returns
`Buffer`:

### TileBaseS3

new TileBaseS3(url: string)
Parameters
url `(string)` S3 Location of TileBase file
Properties
url `(string)` : S3 Location of TileBase File
Instance Members
▸ read(position, size)

Return a buffer containing the requested bytes

read(position: BigInt, size: BigInt): Buffer
Parameters
position `(BigInt)` Byte to start reading
size `(BigInt)` Number of bytes to read
Returns
`Buffer`:

### TileBaseHTTP

new TileBaseHTTP(url: string)
Parameters
url `(string)` HTTP Location of TileBase file
Properties
url `(string)` : HTTP Location of TileBase File
Instance Members
▸ read(position, size)

Return a buffer containing the requested bytes

read(position: BigInt, size: BigInt): Buffer
Parameters
position `(BigInt)` Byte to start reading
size `(BigInt)` Number of bytes to read
Returns
`Buffer`: