Skip to content

Commit 5d4b017

Browse files
author
Dane Springmeyer
committed
only run test with >= gdal 2.x - refs naturalatlas#181 (comment)
1 parent 796f68c commit 5d4b017

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

test/api_warp.test.js

+25-12
Original file line numberDiff line numberDiff line change
@@ -455,18 +455,31 @@ describe('gdal', function() {
455455

456456
assert.equal(value, 123);
457457
});
458-
it('should throw error if GDAL can\'t create transformer', function() {
459-
src = gdal.open(__dirname + '/data/unsupported-srs.tif');
460458

461-
var options = {
462-
src: src,
463-
s_srs: src.srs,
464-
t_srs: gdal.SpatialReference.fromEPSG(3857)
465-
};
466-
467-
assert.throws(function() {
468-
gdal.suggestedWarpOutput(options);
469-
}, 'Mercator_1SP with scale != 1.0 and latitude of origin != 0, not supported by PROJ.4.');
470-
});
459+
function greaterThan2(version) {
460+
var parts = version.split('.').map(function(part) { return +part; } );
461+
if (parts[0] >= 2) {
462+
return true;
463+
}
464+
return false;
465+
}
466+
467+
if (greaterThan2(gdal.version)) {
468+
it('should throw error if GDAL can\'t create transformer', function() {
469+
src = gdal.open(__dirname + '/data/unsupported-srs.tif');
470+
471+
var options = {
472+
src: src,
473+
s_srs: src.srs,
474+
t_srs: gdal.SpatialReference.fromEPSG(3857)
475+
};
476+
477+
assert.throws(function() {
478+
gdal.suggestedWarpOutput(options);
479+
}, 'Mercator_1SP with scale != 1.0 and latitude of origin != 0, not supported by PROJ.4.');
480+
});
481+
} else {
482+
it.skip('should throw error if GDAL can\'t create transformer', function() {});
483+
}
471484
});
472485
});

0 commit comments

Comments
 (0)