Skip to content
PostGIS provider for Koop.js
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config initial commit Oct 29, 2017
.dockerignore initial commit Oct 29, 2017
.gitignore initial commit Oct 29, 2017
.nvmrc initial commit Oct 29, 2017
.travis.yml initial commit Oct 29, 2017
Dockerfile initial commit Oct 29, 2017
LICENSE initial commit Oct 29, 2017
README.md update readme to show URL structure Oct 29, 2017
controller.js initial commit Oct 29, 2017
index.js initial commit Oct 29, 2017
model.js initial commit Oct 29, 2017
package.json initial commit Oct 29, 2017
routes.js initial commit Oct 29, 2017
server.js initial commit Oct 29, 2017

README.md

koop-provider-postgis

A PostGIS provider for Koop.js. Serve ESRI GeoServices from a PostGIS database!

Installation

npm install brambow/koop-provider-postgis 

Configuration

After install you need to set the PostGIS connection string in config/default.json, where you set username, password, server, port, and database values.

{
  "db": {
    "postgis": "postgres://username:password@server:port/database"
  }
}

Example:

{
  "db": {
    "postgis": "postgres://postgres:postgres@localhost:5432/test-database"
  }
}

Usage

This provider comes with a built-in server for testing purposes. Simply run npm start

The structure of the URLs is like this (for now, expect changes in the future)

http://{yourserver}/postgis/FeatureServer/0/query?table={schema.tablename}&columns={columns}

However, this is designed to be used as a provider within a Koop application. See koopjs/koop-sample-app for examples.

To Do

  • implement tests
  • remove squel dependency (maybe)
  • add routes/controllers for expanded API (e.g. run a buffer or intersection query)
  • refactor for better connection initialization (i.e. set at app runtime)
  • refactor URLs (e.g. make schema=host & table=id, or similar)
You can’t perform that action at this time.