ubuntudigital-oceanmapnik

Tilestrata error on Digital Ocean Ubuntu 16.04


I am trying to run a web map tile server on my Digital Ocean droplet running Ubuntu 16.04 using Tilestrata. The problem I keep running into, after everything is set up, is this error:

carl@Senegal:~/tileserver$ node server.js
/home/carl/node_modules/tilestrata/lib/TileServer.js:502
    var callback = function(err) { if (err) throw err; };
                                            ^

Error: Unable to initialize "basemap" layer: "expected < at line 1"
    at /home/carl/node_modules/tilestrata/lib/TileServer.js:106:19
    at /home/carl/node_modules/tilestrata/node_modules/async/lib/async.js:52:16
    at done (/home/carl/node_modules/tilestrata/node_modules/async/lib/async.js:243:17)
    at /home/carl/node_modules/tilestrata/node_modules/async/lib/async.js:44:16
    at Immediate._onImmediate (/home/carl/node_modules/tilestrata/lib/TileRequestHandler.js:125:4)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

My configuration should be good. It is exactly the same as what is already working on an Amazon AWS instance (I want to switch to DO because they have a better pricing scheme). I can't figure out why the node server script won't read the mapnik xml file (project.xml). It is the same XML that works fine on the AWS Ubuntu EC2 instance. Here is the full script of server.js:

var tilestrata = require('tilestrata');
var disk = require('tilestrata-disk');
var mapnik = require('tilestrata-mapnik');
var dependency = require('tilestrata-dependency');
var strata = tilestrata();

// define layers
strata.layer('basemap')
    .route('tile.png')
        .use(disk.cache({dir: '/home/carl/tileserver/tiles/basemap/'}))
        .use(mapnik({
            xml: '/home/carl/tileserver/project/project.xml',
            tileSize: 256,
            scale: 1
        }));

// start accepting requests
strata.listen(8080);

I know the script is doing something, because it successfully creates the tiles/basemap directory. But the Mapnik plugin chokes as if there's no project.xml file, which there most definitely is, or the path is wrong, which it's not. Any ideas?


Solution

  • The xml option needs to be changed to pathname. This changed in 0.4.0