node-mapnik icon indicating copy to clipboard operation
node-mapnik copied to clipboard

More friendly test warnings if plugins are not available

Open springmeyer opened this issue 8 years ago • 4 comments

If the gdal.input or ogr.input are not available then various tests fail: https://gist.github.com/springmeyer/4cbaaf6218d0b76d8da1d705cf7115ff.

We should modify the tests to print a BIG CLEAR warning that gdal.input is missing rather than let these tests fail.

This will happen when building node-mapnik against the default homebrew mapnik package brew install mapnik because by default homebrew does not build mapnik against GDAL. That would require brew install mapnik --with-gdal.

springmeyer avatar Sep 09 '16 17:09 springmeyer

How can I check the list of available plugins (and recognized? There is no API.

Arsakes avatar Oct 08 '16 12:10 Arsakes

How can I check the list of available plugins (and recognized)?

var mapnik = require('mapnik');

mapnik.register_default_input_plugins();
console.log(mapnik.datasources());

Output on my system:

[ 'csv',
  'gdal',
  'geojson',
  'ogr',
  'pgraster',
  'postgis',
  'raster',
  'shape',
  'sqlite',
  'topojson' ]

talaj avatar Oct 08 '16 18:10 talaj

@Arsakes I'll work on getting the plugins documented on mapnik.org later today. Apologies!

mapsam avatar Oct 10 '16 18:10 mapsam

Semi-related: mapnik docs have been updated to include a section about plugins right at the top. The available methods have been added to the main mapnik constructor http://mapnik.org/documentation/node-mapnik/3.5/#mapnik.registerDatasource

mapsam avatar Oct 12 '16 18:10 mapsam