forked from mapnik/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 2
/
geotiff-load.test.js
28 lines (24 loc) · 1.06 KB
/
geotiff-load.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"use strict";
var test = require('tape');
var mapnik = require('../');
var path = require('path');
// puts unnatural, odd, and intentionally racey load on opening geotiff
test('should be able to open geotiff various ways without crashing', (assert) => {
mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'gdal.input'));
var vtile = new mapnik.VectorTile(0, 0, 0);
var map = new mapnik.Map(256, 256);
map.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); });
map.render(vtile,{},function(err,vtile) {
if (err) throw err;
assert.ok(vtile);
});
var map2 = new mapnik.Map(256, 256);
map2.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); });
var map3 = new mapnik.Map(256, 256);
map3.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); });
map3.render(vtile,{},function(err,vtile) {
if (err) throw err;
assert.ok(vtile);
assert.end();
});
});