simple, fast nodejs + dynamic postgis tile server
JavaScript Shell
Latest commit c4bdcf2 Mar 23, 2011 Dane Springmeyer use relative url and encode sql queries
Permalink
Failed to load latest commit information.
public use relative url and encode sql queries Mar 22, 2011
server use relative url and encode sql queries Mar 22, 2011
.gitignore add app Feb 15, 2011
README.md add readme Feb 15, 2011
app.js add app Feb 15, 2011
run.sh add app Feb 15, 2011

README.md

Coalition

An illustrative web server that combines nodejs, mapnik, and postgis.

Depends

NodeJS > 0.2.4

Mapnik (latest trunk >r2397)

Node-mapnik

Npm / Spark

Installation

Install node:

$ wget http://nodejs.org/dist/node-v0.4.0.tar.gz
$ tar xvf node-v0.4.0.tar.gz
$ ./configure
$ make
$ make install

Install node-mapnik:

$ git clone git://github.com/mapnik/node-mapnik.git
$ cd node-mapnik
$ ./configure
$ make
$ make install

Install npm (node package manager)

$ curl http://npmjs.org/install.sh | sh

Install spark via npm:

$ npm install spark

Configuration

Edit the postgis settings in 'server/settings.js' to match your system.

Also, fixup the few hardcoded sample queries in 'public/index.html' to match your postgis tables.

Usage

Start the server by typing:

$ ./run.sh

Or:

$ spark

Then visit http://localhost:3000/. Choose a style type and a postgis subquery.

A note on styles

Mapnik supports applying arbitrary styles to layers, but for the results to be reasonable you have to apply reasonable styles. For example a PointSymbolizer will work against either point geometries or polygon geometries, but a PolygonSymbolizer will not render anything if applied to point geometries.