npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mbtiles-terrain-server

v0.0.4

Published

Import terrain tiles from a folder, and serve them either as TMS or slippy maps.

Downloads

8

Readme

Introduction

Import Cesium v1 terrain tiles from a folder into an mbtiles (sqlite3) database, or serve the tiles in an mbtiles database either as TMS or slippy maps.

It was developed to import a folder with 14 million very small terrain tiles (generated by ctb-builder in Cesium v1 height format) into an mbtiles (sqlite3) database, and to serve those terrain tiles from there. In that way, we can also serve the tiles unzipped, which is useful for our HoloLens application, WorldExplorer. However, you could also use it to import other terrain tiles.

BTW a clean and simple SQLite database manager is SQLite Studio.

Installation

To install it globally, use:

npm i -g mbtiles-terrain-server

Build from source

Get the source

git pull https://github.com/TNOCS/mbtiles-terrain-server
cd mbtiles-terrain-server

You can either use yarn or npm to build it:

yarn
yarn build

or

npm install
npm run build

Help

MBtiles-terrain-server

  Import Cesium v1 terrain tiles from a folder into an mbtiles (sqlite3)
  database, or serve the tiles in an mbtiles database either as TMS or
  slippy maps.

  It was developed to import a folder with 14 million very small terrain
  tiles (in Cesium v1 height format) into an mbtiles (sqlite3) database,
  and to serve those terrain tiles from there. In that way, we can also
  serve the tiles unzipped, which is useful for our HoloLens application,
  WorldExplorer. However, you could also use it to import other terrain tiles.

  For example, after running example 3 below, you can get the raw (zipped)
  tiles at "host:port/tms/z/x/y.tile" or "host:port/z/x/y.tile" in TMS or
  slippy maps format, respectively. Alternatively, at
  "host:port/tms/z/x/y.terrain" or "host:port/z/x/y.terrain", you can retreive
  the unzipped data.

  When importing many files, you may have to run node using the
  --max-old-space-size option e.g.
  "node --max-old-space-size=4096 dist/cli.js -v -f tms -i c:/tmp/tiles
  tiles.sqlite3"

Options

  -f, --format String     Expected input format, either 'tms' or 'slippy'
                          (default).
  -p, --port Number       Port you wish to use. Default is port 8080.
  -i, --input String      Input folder you wish to import.
  -s, --src File name     MBtiles file to write or read.
  -h, --help Boolean      Show this usage instructions.
  -c, --cors Boolean      Use CORS (default true).
  -v, --verbose Boolean   Output is verbose.

Examples

  01. Create a new SQLite data by        $ mbtiles-terrain-server -i ./tiles
  importing a folder with terrain        ./data/terrain.sqlite3
  tiles in slippy map format.
  02. Create a new SQLite data by        $ mbtiles-terrain-server -f tms -i
  importing a folder with terrain        ./tiles ./data/terrain.sqlite3
  tiles in TMS format.
  03. Serve the terrain tiles using      $ mbtiles-terrain-server -p 8321
  CORS on port 8321.                     ./data/terrain.sqlite3