start_mvt_server: Start an mvt_server in the current session

View source: R/server.R

start_mvt_serverR Documentation

Start an mvt_server in the current session

Description

Starts a web server serving vector tiles from a supplied .mbtiles file.

Usage

start_mvt_server(
  tiles_path,
  host = "0.0.0.0",
  port = NULL,
  .serve_mode = "in-memory"
)

Arguments

tiles_path

The path to an .mbtiles file.

host

the host to serve tiles on

port

the port to serve tiles on

.serve_mode

The way in which the server handles the vector tiles database. "in-memory" is the default and it will read the entire tile database into R as a tibble. "disk" will read tiles from the .mbtiles file as an SQLite database from disk. The default is more performant. Use "disk" only if you have a large vector tileset that would consume too much memory to hold in RAM at once.

Details

serve_mvt() is likely more convenient. Only use this if if you want more control of the host and port on which your tiles are served on.

Where serve_mvt() verifies the server is actually up and responding, this funciton does not. So that's up to you to take on.

Note: This server has been built minimising code written, not ' maximising performance. It is intended for local development work, and will likely not be performant enough for any production use-case.


MilesMcBain/mvtview documentation built on April 9, 2022, 5:15 p.m.