Skip to content

jaredbrookswhite/node-pgtiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgtiles

Simple alteration to node-mbtiles allowing for storing mbtiles in a postgres database, gutted for readability. you must use https://github.com/jaredbrookswhite/tilelive-vector for compatibility with tilelive-vector based mapbox builds.

Build Status Build status

Installation

npm install mbtiles

Use

// call connection once and store in global variable
// connection info can be found with the npm pg package
new pgtiles({
        connection: {
          "user": "username",
          "password": "yourpassword",
          "database": "yourdb",
          "port": 5432,
          "host": "path/to/host",
          "ssl": true
        },
        query: { batch: 1 }
    }, function(err, pgtiles) {
        if (err) return err;
        tm.pgtiles = pgtiles;
    });

//storage schema is simplified, use gettile and puttile as such,
//m stands for map name and stores all records on a single table...
//optimal for speed, no, but great for simplicity.
pgtiles.gettile(m,z,x,y,callback);
pgtiles.puttile(m,z,x,y,callback);

About

postgres-tiles renderer and storage backend for tilelive

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.8%
  • PLpgSQL 4.2%