Matico-Platform / pmtiles-utils

A command line tool to convert any GDAL support geospatial data file to the PMTiles, a low-cost cloud-optimized tile format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PMTiles Utils

Some helpful utils :)

Convert

Install

From the repo root, in your terminal:

pip install -r convert/requirements.txt

External requirements:

Run

After install python dependencies and making sure you have Tippecanoe and Gdal (ogr2ogr) available in your CLI environment, you can run python convert from the repo root in your terminal: Prompt based Alternatively, you can pass the arguments as flags directly in one line. Run python convert --help for more info. Flag based

Config

Change config in tiles_config.yaml or create a new version and pass that in to the CLI.

Viewer

Install

From the repo root, in your terminal:

cd viewer && npm install
# or yarn install

External requirements:

Run

From the repo root, in your terminal:

cd viewer && npm run dev
# or yarn dev

Config and Files

  1. Copy your PMTiles file to viewer/public
  2. Change the path in viewer/src/config.ts
    • In Config, you can set the following options:
      • filePath: the path to your file from the public folder (eg. "/output.pmtiles")
      • minZoom: the lowest available zoom level (most zoomed out)
      • maxzoom: the max available zoom level (most zoomed in) - if this is greater than your tileset's avaiable data, the map will keep looking for data, and may result in a blank map
      • colorScale: named color scheme from d3's color scales like "turbo" or "blues" or "RdBu"
      • colorDomain: a min and max value for the range of colors (eg. [0, 5000])
      • property: data property to access to color (eg. "population")
    • You can change any config values except filePath and the changes will be reflected in your browser immediately. filePath changes will automatically reload your window.

About

A command line tool to convert any GDAL support geospatial data file to the PMTiles, a low-cost cloud-optimized tile format.


Languages

Language:TypeScript 54.4%Language:Python 43.4%Language:HTML 2.2%