Skip to content

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

Notifications You must be signed in to change notification settings

Matico-Platform/pmtiles-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published