-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathapi_linearring.test.js
More file actions
28 lines (26 loc) · 828 Bytes
/
api_linearring.test.js
File metadata and controls
28 lines (26 loc) · 828 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
const assert = require('chai').assert
const gdal = require('../lib/gdal.js')
describe('gdal.LinearRing', () => {
afterEach(gc)
it('should be instantiable', () => {
new gdal.LinearRing()
})
it('should inherit from LineString', () => {
assert.instanceOf(new gdal.LinearRing(), gdal.LinearRing)
assert.instanceOf(new gdal.LinearRing(), gdal.LineString)
assert.instanceOf(new gdal.LinearRing(), gdal.Geometry)
})
describe('instance', () => {
describe('getArea()', () => {
it('should return area', () => {
const 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)
})
})
})
})