Fix WKT geometry type lookup and tests

This commit is contained in:
ahocevar
2018-07-18 15:40:39 +02:00
parent 4adab51768
commit 95533bef66
2 changed files with 28 additions and 13 deletions

View File

@@ -710,8 +710,14 @@ describe('ol.format.WKT', function() {
});
it('Empty geometries read / written correctly', function() {
const wkt = 'POINT EMPTY';
const geom = format.readGeometry(wkt);
const coordinates = geom.getCoordinates();
expect(coordinates.length).to.be(2);
expect(isNaN(coordinates[0])).to.be(true);
expect(isNaN(coordinates[1])).to.be(true);
const wkts = [
'POINT', 'LINESTRING', 'POLYGON', 'MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON'
'LINESTRING', 'POLYGON', 'MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON'
];
for (let i = 0, ii = wkts.length; i < ii; ++i) {
const wkt = wkts[i] + ' EMPTY';