-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathopen_mitab.test.js
More file actions
25 lines (22 loc) · 737 Bytes
/
open_mitab.test.js
File metadata and controls
25 lines (22 loc) · 737 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
const gdal = require('../lib/gdal.js')
const path = require('path')
const assert = require('chai').assert
describe('Open', () => {
afterEach(gc)
describe('MapInfo', () => {
let filename, ds
it('should not throw', () => {
filename = path.join(__dirname, 'data/mitab/EXTRACT_POLYGON.mif')
ds = gdal.open(filename)
})
it('should be able to read layer count', () => {
assert.equal(ds.layers.count(), 1)
})
it('should be able to read features', () => {
const layer = ds.layers.get(0)
const featureCount = layer.features.count()
assert.equal(featureCount, 1, 'layer.features.count()')
assert.instanceOf(layer.features.first().getGeometry(), gdal.Polygon)
})
})
})