# pgtiles

> Create postgresql schema to for vector tiles

Latest version **0.0.3** (published 2015-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install pgtiles
pnpm add pgtiles
yarn add pgtiles
bun add pgtiles
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-03-29 |
| First published | 2015-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.x |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | apburnes |
| Maintainers | apburnes |
| Keywords | vector, tiles, map, postgis, pg, postgreql |

## Links

- npm: https://www.npmjs.com/package/pgtiles
- Repository: https://github.com/apburnes/node-pgtiles
- Issues: https://github.com/apburnes/node-pgtiles/issues
- npm.io page: https://npm.io/package/pgtiles

## Dependencies (3)

- [pg.js](https://npm.io/package/pg.js.md) ^4.1.1
- [lodash](https://npm.io/package/lodash.md) ^3.5.0
- [postgis-vt-util](https://npm.io/package/postgis-vt-util.md) ^0.2.0

## Recent versions

- 0.0.3 (latest) — 2015-03-29
- 0.0.2 — 2015-03-26
- 0.0.1 — 2015-03-25

## README

node-pgtiles
============
PostgreSQL schema for vector tiles. Modeled from Mapbox [mbtiles](https://github.com/mapbox/node-mbtiles) and CartoDB [postgresql extensions](https://github.com/CartoDB/cartodb-postgresql/tree/9114d4e463c8664c1fb31e3bc538ce96c0dd0771)

## Dependencies

- [PostgreSQL](http://www.postgresql.org/)
- [Node.js](https://nodejs.org/)
- [NPM](https://npmjs.com)

## Install

`$ npm install pgtiles`

## Use

```js
var pgtiles = require('pgtiles');
var connectionString = 'postgres://username:password@host:dbname/5432';

var tileSchema = pgtiles(connectionString);

// Add the table schema and functions to the designated PostgreSQL database
tileSchema.create(function(err, result) {
  if (err) {
   // handle error
  }

  console.log(result);
  // Result show the tables and functions created
});

// Remove the tables and functions to rollback the database
tileSchema.rollback(function(err, result) {
  if (err) {
    // handle error
  }

  console.log(result);
  // Result show the tables and functions dropped
});
```


Andy B

---
_Source: https://npm.io/package/pgtiles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
