forked from naturalatlas/node-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_linearring.test.js
More file actions
28 lines (26 loc) · 819 Bytes
/
Copy pathapi_linearring.test.js
File metadata and controls
28 lines (26 loc) · 819 Bytes
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
var assert = require('chai').assert;
var gdal = require('../lib/gdal.js');
describe('gdal.LinearRing', function() {
afterEach(gc);
it('should be instantiable', function() {
new gdal.LinearRing();
});
it('should inherit from LineString', function() {
assert.instanceOf(new gdal.LinearRing(), gdal.LinearRing);
assert.instanceOf(new gdal.LinearRing(), gdal.LineString);
assert.instanceOf(new gdal.LinearRing(), gdal.Geometry);
});
describe('instance', function() {
describe('getArea()', function() {
it('should return area', function() {
var ring = new gdal.LinearRing();
ring.points.add(0, 0, 0);
ring.points.add(10, 0, 0);
ring.points.add(10, 10, 0);
ring.points.add(0, 10, 0);
ring.points.add(0, 0, 0);
assert.closeTo(ring.getArea(), 100, 0.001);
});
});
});
});