Node.js REST API for PostGres Spatial Entities. AKA: SpatialServer
JavaScript HTML CSS
Latest commit bceb48d Mar 25, 2016 @jharpster jharpster Merge pull request #131 from gitter-badger/gitter-badge
Add a Gitter chat badge to

PGRestAPI (a.k.a. Chubbs Spatial Server)

Join the chat at

alt text


Node.js REST API for PostgreSQL Spatial Tables.

A few key uses for PGRestAPI:

  • Create Mapbox Vector Tiles on the fly from PostGIS or shapefiles. more...
  • Serve pre-created Vector Tiles .mbtiles files
  • Serve pre-created PNG .mbtiles files (like TileStream)
  • REST API for querying Postgres tables - Supports spatial intersection, tabular queries and aggregation queries
  • REST API returns GeoJSON, CSV, Shapefile or esriJSON
  • Templates for creating custom web service endpoints - (Execute custom SQL functions, for example)
  • Rasters in PostGIS offer basic intersect operations and zonal stats. Find sum of raster values that intersect a polygon, for example.


  • WKT Previewer
  • Server side proxy - support requests to servers that don't support CORS

Under development:

  • Better caching for different endpoints

  • Raster map services (Drop a .tif into data/rasters)

  • Authentication with passport/MongoDB/Mongoose (Disabled for now)

More To-Dos:

  • Update Express and other libraries to current versions
  • More tests
  • Major refactoring of endpoints folder
  • Break up endpoint functionality into modules
  • Persistent caching
  • Administrative Panel
  • Editing

Soon will drop:

  • PNG image creation from PostGIS Tables
  • CartoCSS to Mapnik XML parser (Carto module) (this actually works, but is not used by our team)



  • PostgreSQL 9.1 + w/ PostGIS 2.0 +
  • Mapnik


Table/View List:

alt text

Table Details:

alt text

Query Endpoint:

alt text

Query Endpoint Results:

alt text

Dynamic Map Tile Service Endpoint:

alt text

Dynamic Vector Tile Endpoint:

alt text

Geoprocessing Operations:

alt text

Geoprocessing Operation:

alt text

Utililties - WKT Preview endpoint:

alt text

Raster Operations List:

alt text

Raster Operations - Zonal Statistics:

alt text

Tile Rendering Stats (/admin):

alt text