Clip MBTiles with BoundingBox

Table of Content

Clip MBTiles with BoundingBox

Ví dụ

Tình hình là mình muốn cắt Mbtiles theo mask cơ, cơ mà tìm không ra, chỉ tìm được cắt theo bbox thôi. Tạm thời note lại vậy.

tilelive-copy \
    --minzoom=0 --maxzoom=14 \
    --bounds="5.9559,45.818,10.4921,47.8084" \
    planet.mbtiles my-extract-for-switzerland.mbtiles

Tham khảo


  1. Download the planet file
  2. Install tilelive and MBTiles support.
npm install -g @mapbox/tilelive @mapbox/mbtiles

Choose your Bounding Box8

  1. Visit and drag a rectangle around your desired area.
  2. Copy the bounding box in CSV format

Choose Bounding Box

Create Extract8

To create an extract, use the tilelive-copy utility. It takes a bounding box and a MBTiles file as input and creates an extract clipped to the bounding box.

Replace the bounding box in the following command with your bounding box.

    --minzoom=0 --maxzoom=14\
    planet.mbtiles my-extract-for-switzerland.mbtiles

It was ultimately a version problem. With NodeJS V 9.11.1 64 bit everything was possible without problems.


  • Install NodeJS V 9.11.1 64 Bit
  • install npm
  • npm install -g @mapbox/tilelive @mapbox/mbtiles

and its works:

tilelive-copy --bounds="5.9559,45.818,10.4921,47.8084" 18.mbtiles switzerland_18.mbtiles



Leave a Reply

Your email address will not be published. Required fields are marked *