A Node.js map tile library for PostGIS and torque.js, with CartoCSS styling.
- Can render arbitrary SQL queries
- Generates image and UTFGrid interactivity tiles
- Accepts, stores, serves, and applies map styles written in CartoCSS
- Supports re-projections
Being a dynamic map renderer, windshaft commits some map server 'sins' in its raw form. The idea is that you the developer will want to graft your own auth/metrics/caching/scaling on top of decent core components. Same old story: high cohesion, low coupling makes us happy. See Windshaft-cartodb.
Windshaft is a library used by CARTO, a location intelligence and data visualization tool.
More examples built on top of Windshaft can be found in CARTO's gallery.
- Node.js 10.x
- npm 6.x
- PostgreSQL >= 10.0
- PostGIS >= 2.4
- Redis >= 4
- libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support
- In Linux, the Mapnik prebuilt module requires GLIBCXX_3.4.21 (GCC 5.1.0 / libstdc++-5 or higher). In OSX, the minimum requirement is 10.9. On the other hand, a C++11 compiler is required to build from sources.
Dependencies installation example:
sudo add-apt-repository -y ppa:cartodb/cairo
sudo apt-get update
sudo apt-get install -y build-essential checkinstall pkg-config libcairo2-dev libjpeg8-dev libgif-dev
npm ci
To build the node modules dependencies (mapnik, gdal, etc) from source use install
instead of ci
with the following flags:
NODE_MAPNIK_BUILD=release_base npm install --build-from-source --shared_gdal
npm install [windshaft]
An example http service is implemented in examples/http/server.js, examples/readme_server.js extends its behaviour.
Probably one of the more advanced uses of Windshaft library can be found at Windshaft-cartodb project.
Latest node-mapnik versions comes compiled for some platforms and architectures, in case you need it you can always compile, package and install it manually. The recommended option is to use mapnik-packaging. You can also use other alternatives:
- Source: https://github.com/mapnik/mapnik
- OSX: https://github.com/mapnik/mapnik/wiki/MacInstallation_Homebrew
- Linux: https://github.com/mapnik/mapnik/wiki/LinuxInstallation
Windshaft has a unit and acceptance test suite.
To execute them, run npm test
.
You'll need to be sure your PGUSER (or your libpq default) is set to a "superuser" PostgreSQL account, for example:
PGUSER=postgres npm test
You need to install fonts at system level to be able to use them. If you face an issue like Invalid value for text-face-name, the type font is expected. DejaVu Sans Book (of type string) was given.
probably you don't have the
required fonts, try to install DejaVu fonts or any other font needed.
See CONTRIBUTING.md.
-- Thanks to the Mapnik and Mapbox team for making such flexible tools