Giter Site home page Giter Site logo

dburnsii / mbtiles-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deniscarriere/mbtiles-server

0.0 0.0 0.0 4.06 MB

Provides a compatible WMTS Tile Server from MBTiles.

License: Other

JavaScript 92.69% TypeScript 1.12% Dockerfile 6.19%

mbtiles-server's Introduction

MBTiles Server

Build Status Coverage Status npm version MIT licensed

Standard - JavaScript Style Guide

Provides a compatible WMTS Tile Server from MBTiles.

Install

$ npm install -g mbtiles-server

Quickstart

$ mbtiles-server --cache /Users/mac/mbtiles --verbose --port 3000
MBTiles Server Service

  cache:         /Users/mac/mbtiles
  protocol:      http
  port:          3000
  domain:        localhost
  verbose:       true

Benchmark

  • 1 Active User => 400 requests/min
  • 1 Passive User => 50 requests/min
Requests Response Time
1 33.460ms
10 45.223ms
100 374.217ms
1K 2.698s
10K 25.457s

Total 24,000 requests / min

Using mbtiles-server you could easily sustain 60 active users and up to 480 passive users. These tests were done on the server locally, network traffic and switches could slow down these results significantly.

CLI Help

For any additional help using the CLI, use the --help flag.

  Provides a compatible WMTS Tile Server from MBTiles.

  Usage
    $ mbtiles-server

  Options
    --cache           [~/mbtiles] Cache
    --protocol        [http] Protocol
    --port            [5000] Port
    --domain          [localhost] Domain
    --verbose         [false] Verbose output
    --sslkey          [~/mbtiles/server.key] Path to the file certification (.key). For https protocol only  
    --sslcert         [~/mbtiles/server.cert] Path to the file certification (.cert). For https protocol only
  
  Examples
    $ mbtiles-server --cache /Users/mac/mbtiles --port 5000 --verbose

Environment Variables

Environment variables can be defined instead of entering your options via the CLI.

  • MBTILES_SERVER_CACHE
  • MBTILES_SERVER_PROTOCOL
  • MBTILES_SERVER_PORT
  • MBTILES_SERVER_DOMAIN
  • MBTILES_SERVER_VERBOSE
  • MBTILES_SERVER_SSL_KEY
  • MBTILES_SERVER_SSL_CERT

Docker

A Dockerfile is provided for easy Docker deployment

$ docker build -t mbtiles-server .
$ docker run --rm -it \
  -p 5000:5000 \
  -v ~/mbtiles/:/root/mbtiles \
  mbtiles-server

Start containers automatically

https://docs.docker.com/engine/admin/host_integration/

$ docker run -d \
  --name mbtiles-server \
  -p 5000:5000 \
  -v ~/mbtiles/:/root/mbtiles \
  mbtiles-server

WMTS

The goal of providing a WMTS enabled service is to be performance oriented and scalable. Therefore, servers must be able to return tiles quickly. A good way to achieve that is to use locally stored pre-rendered tiles that will not require any image manipulation or geo-processing.

API

Server

Parameters

  • options [string] Server Options
    • options.cache [string] CACHE file path (optional, default ~/mbtiles)
    • options.domain [string] URL Domain (optional, default 'localhost')
    • options.port [string] URL Port (optional, default 5000)

Examples

server({cache: '/Users/mac/mbtiles', port: 5000, verbose: true})

mbtiles-server's People

Contributors

cespejo93 avatar dburnsii avatar deniscarriere avatar dependabot[bot] avatar endast avatar miklergm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.