Remove lint
This commit is contained in:
@@ -126,22 +126,8 @@ describe('ol/array.js', function () {
|
||||
|
||||
describe('default comparison on array of Number(s)', function () {
|
||||
const d = [
|
||||
-897123.9,
|
||||
-321434.58758,
|
||||
-1321.3124,
|
||||
-324,
|
||||
-9,
|
||||
-3,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0.31255,
|
||||
5,
|
||||
142.88888708,
|
||||
334,
|
||||
342,
|
||||
453,
|
||||
54254,
|
||||
-897123.9, -321434.58758, -1321.3124, -324, -9, -3, 0, 0, 0, 0.31255, 5,
|
||||
142.88888708, 334, 342, 453, 54254,
|
||||
];
|
||||
it('should find -897123.9 at index 0', function () {
|
||||
expect(binarySearch(d, -897123.9)).to.be(0);
|
||||
@@ -187,22 +173,8 @@ describe('ol/array.js', function () {
|
||||
|
||||
describe('custom comparison function, which reverse orders numbers', function () {
|
||||
const e = [
|
||||
54254,
|
||||
453,
|
||||
342,
|
||||
334,
|
||||
142.88888708,
|
||||
5,
|
||||
0.31255,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
-3,
|
||||
-9,
|
||||
-324,
|
||||
-1321.3124,
|
||||
-321434.58758,
|
||||
-897123.9,
|
||||
54254, 453, 342, 334, 142.88888708, 5, 0.31255, 0, 0, 0, -3, -9, -324,
|
||||
-1321.3124, -321434.58758, -897123.9,
|
||||
];
|
||||
it('should find 54254 at index 0', function () {
|
||||
const pos = binarySearch(e, 54254, revNumCompare);
|
||||
|
||||
@@ -519,10 +519,12 @@ describe('ol/extent.js', function () {
|
||||
});
|
||||
|
||||
it('works for rotation', function () {
|
||||
const extent = _ol_extent_.getForViewAndSize([0, 0], 1, Math.PI / 4, [
|
||||
const extent = _ol_extent_.getForViewAndSize(
|
||||
[0, 0],
|
||||
1,
|
||||
1,
|
||||
]);
|
||||
Math.PI / 4,
|
||||
[1, 1]
|
||||
);
|
||||
expect(extent[0]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[2]).to.roughlyEqual(Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[1]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
@@ -889,85 +891,55 @@ describe('ol/extent.js', function () {
|
||||
|
||||
it('leaves real world extent untouched', function () {
|
||||
expect(_ol_extent_.wrapX([16, 48, 18, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves left world extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([-344, 48, -342, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves right world extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([376, 48, 378, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves far off left extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([-1064, 48, -1062, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves far off right extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([1096, 48, 1098, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('leaves -180 crossing extent with real world center untouched', function () {
|
||||
expect(_ol_extent_.wrapX([-184, 48, 16, 49], projection)).to.eql([
|
||||
-184,
|
||||
48,
|
||||
16,
|
||||
49,
|
||||
-184, 48, 16, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves +180 crossing extent with off-world center to the real world', function () {
|
||||
expect(_ol_extent_.wrapX([300, 48, 376, 49], projection)).to.eql([
|
||||
-60,
|
||||
48,
|
||||
16,
|
||||
49,
|
||||
-60, 48, 16, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('produces the same real world extent for shifted extents with center at +/-180', function () {
|
||||
expect(_ol_extent_.wrapX([360, -90, 720, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
expect(_ol_extent_.wrapX([0, -90, 360, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
expect(_ol_extent_.wrapX([-360, -90, 0, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -391,12 +391,13 @@ describe('ol/format/EsriJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(firstGeom.getExtent(), [
|
||||
-10585772.743554419,
|
||||
4712365.161160459,
|
||||
-10579560.16462974,
|
||||
4716567.373073828,
|
||||
])
|
||||
equals(
|
||||
firstGeom.getExtent(),
|
||||
[
|
||||
-10585772.743554419, 4712365.161160459, -10579560.16462974,
|
||||
4716567.373073828,
|
||||
]
|
||||
)
|
||||
).to.be(true);
|
||||
|
||||
const last = result[8];
|
||||
@@ -406,12 +407,13 @@ describe('ol/format/EsriJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(lastGeom.getExtent(), [
|
||||
-10555714.026858449,
|
||||
4576511.565880965,
|
||||
-10553671.199322715,
|
||||
4578554.9934867555,
|
||||
])
|
||||
equals(
|
||||
lastGeom.getExtent(),
|
||||
[
|
||||
-10555714.026858449, 4576511.565880965, -10553671.199322715,
|
||||
4578554.9934867555,
|
||||
]
|
||||
)
|
||||
).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -358,12 +358,10 @@ describe('ol/format/GeoJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(firstGeom.getExtent(), [
|
||||
60.52843,
|
||||
29.318572,
|
||||
75.158028,
|
||||
38.486282,
|
||||
])
|
||||
equals(
|
||||
firstGeom.getExtent(),
|
||||
[60.52843, 29.318572, 75.158028, 38.486282]
|
||||
)
|
||||
).to.be(true);
|
||||
|
||||
const last = result[178];
|
||||
@@ -373,12 +371,10 @@ describe('ol/format/GeoJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(lastGeom.getExtent(), [
|
||||
25.264226,
|
||||
-22.271612,
|
||||
32.849861,
|
||||
-15.507787,
|
||||
])
|
||||
equals(
|
||||
lastGeom.getExtent(),
|
||||
[25.264226, -22.271612, 32.849861, -15.507787]
|
||||
)
|
||||
).to.be(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -93,9 +93,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
expect(feature.get('prop0')).to.be('value0');
|
||||
|
||||
expect(geometry.getExtent()).to.eql([
|
||||
-70.08100810081008,
|
||||
12.417091709170947,
|
||||
-69.9009900990099,
|
||||
-70.08100810081008, 12.417091709170947, -69.9009900990099,
|
||||
12.608069195591469,
|
||||
]);
|
||||
});
|
||||
@@ -138,29 +136,13 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const line = features[1].getGeometry();
|
||||
expect(line.getType()).to.be('LineString');
|
||||
expect(line.getFlatCoordinates()).to.eql([
|
||||
102,
|
||||
0,
|
||||
103,
|
||||
1,
|
||||
104,
|
||||
0,
|
||||
105,
|
||||
1,
|
||||
102, 0, 103, 1, 104, 0, 105, 1,
|
||||
]);
|
||||
|
||||
const polygon = features[2].getGeometry();
|
||||
expect(polygon.getType()).to.be('Polygon');
|
||||
expect(polygon.getFlatCoordinates()).to.eql([
|
||||
100,
|
||||
0,
|
||||
100,
|
||||
1,
|
||||
101,
|
||||
1,
|
||||
101,
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
100, 0, 100, 1, 101, 1, 101, 0, 100, 0,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -216,10 +198,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(MultiPolygon);
|
||||
expect(firstGeom.getExtent()).to.eql([
|
||||
-180,
|
||||
-85.60903777459777,
|
||||
180,
|
||||
83.64513000000002,
|
||||
-180, -85.60903777459777, 180, 83.64513000000002,
|
||||
]);
|
||||
|
||||
const last = features[177];
|
||||
@@ -227,9 +206,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(lastGeom.getExtent()).to.eql([
|
||||
25.26325263252633,
|
||||
-22.271802279310577,
|
||||
32.848528485284874,
|
||||
25.26325263252633, -22.271802279310577, 32.848528485284874,
|
||||
-15.50833810039586,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -979,27 +979,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('returns the default projection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x40,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
]);
|
||||
const projection = format.readProjection(wkb);
|
||||
expect(projection).to.be(undefined);
|
||||
@@ -1008,30 +989,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('returns an embed projection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// SRID=4326;POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x20,
|
||||
0xe6,
|
||||
0x10,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40,
|
||||
]);
|
||||
const projection = format.readProjection(wkb);
|
||||
@@ -1066,27 +1025,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('transforms with dataProjection and featureProjection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x40,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
]);
|
||||
const geom = format.readGeometry(wkb, {
|
||||
dataProjection: 'EPSG:4326',
|
||||
@@ -1100,30 +1040,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('transforms with auto detection of dataProjection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// SRID=4326;POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x20,
|
||||
0xe6,
|
||||
0x10,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40,
|
||||
]);
|
||||
const geom = format.readGeometry(wkb, {
|
||||
|
||||
@@ -106,14 +106,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1, 2, 3, 4, 5, 6, 7, 8,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -176,18 +169,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -237,18 +219,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -277,49 +248,31 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
describe('with extrapolation and interpolation', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, true, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
1, 2, 0,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(3, true, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, true, true)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, true, true)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, true, true)).to.eql([
|
||||
5.5,
|
||||
6.5,
|
||||
7.5,
|
||||
5.5, 6.5, 7.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(9, true, true)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, true, true)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, true, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, true, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
15,
|
||||
10, 11, 15,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -327,47 +280,31 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
describe('with extrapolation and no interpolation', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, true, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
1, 2, 0,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(3, true, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, true, false)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, true, false)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, true, false)).to.be(
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(9, true, false)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, true, false)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, true, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, true, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
15,
|
||||
10, 11, 15,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -376,39 +313,25 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, false, true)).to.eql(null);
|
||||
expect(multiLineString.getCoordinateAtM(3, false, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, false, true)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, false, true)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, false, true)).to.eql([
|
||||
5.5,
|
||||
6.5,
|
||||
7.5,
|
||||
5.5, 6.5, 7.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(9, false, true)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, false, true)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, false, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, false, true)).to.eql(
|
||||
null
|
||||
@@ -422,37 +345,25 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(3, false, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, false, false)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, false, false)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, false, false)).to.eql(
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(9, false, false)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, false, false)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, false, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, false, false)).to.eql(
|
||||
null
|
||||
@@ -500,22 +411,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -613,14 +509,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
]);
|
||||
const multiLineString = new MultiLineString([lineString1, lineString2]);
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1, 2, 3, 4, 5, 6, 7, 8,
|
||||
]);
|
||||
expect(multiLineString.getEnds()).to.eql([4, 8]);
|
||||
const coordinates = multiLineString.getCoordinates();
|
||||
|
||||
@@ -438,46 +438,8 @@ describe('ol/geom/Polygon.js', function () {
|
||||
];
|
||||
polygon = new Polygon([outerRing, innerRing1, innerRing2]);
|
||||
flatCoordinates = [
|
||||
0,
|
||||
6,
|
||||
1,
|
||||
2,
|
||||
6,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
0,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
4,
|
||||
7,
|
||||
8,
|
||||
4,
|
||||
4,
|
||||
9,
|
||||
10,
|
||||
4,
|
||||
5,
|
||||
11,
|
||||
12,
|
||||
2,
|
||||
5,
|
||||
13,
|
||||
14,
|
||||
3,
|
||||
2,
|
||||
15,
|
||||
16,
|
||||
4,
|
||||
3,
|
||||
17,
|
||||
18,
|
||||
2,
|
||||
3,
|
||||
19,
|
||||
20,
|
||||
0, 6, 1, 2, 6, 6, 3, 4, 3, 0, 5, 6, 2, 4, 7, 8, 4, 4, 9, 10, 4, 5, 11,
|
||||
12, 2, 5, 13, 14, 3, 2, 15, 16, 4, 3, 17, 18, 2, 3, 19, 20,
|
||||
];
|
||||
outsideOuter = [1, 1];
|
||||
inside = [3, 1];
|
||||
|
||||
@@ -89,206 +89,29 @@ describe('ol/geom/flat/closest.js', function () {
|
||||
|
||||
describe('with real data', function () {
|
||||
const flatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
391.28,
|
||||
139.39,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
489.2,
|
||||
109.45,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
703.12,
|
||||
214.36,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
829.89,
|
||||
239.89,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
864.68,
|
||||
302.71,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
860.08,
|
||||
314.35,
|
||||
858.29,
|
||||
314.94,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
841.52,
|
||||
383.67,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82,
|
||||
139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75,
|
||||
489.2, 109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63,
|
||||
120.89, 524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24,
|
||||
567.69, 148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74,
|
||||
159.86, 622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81,
|
||||
651.77, 204.56, 671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64,
|
||||
217.98, 703.12, 214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36,
|
||||
729.98, 208.73, 735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6,
|
||||
216.87, 784.2, 218.16, 800.24, 214.62, 810.53, 219.73, 817.19, 226.82,
|
||||
820.77, 236.17, 827.23, 236.16, 829.89, 239.89, 851.0, 248.94, 859.88,
|
||||
255.49, 865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66,
|
||||
864.68, 302.71, 867.79, 306.17, 859.87, 311.37, 860.08, 314.35, 858.29,
|
||||
314.94, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43, 350.15,
|
||||
851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38, 844.09,
|
||||
371.89, 844.75, 380.44, 841.52, 383.67, 839.57, 390.4, 845.59, 399.05,
|
||||
848.4, 407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33,
|
||||
441.04, 847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15,
|
||||
866.36, 480.77,
|
||||
];
|
||||
|
||||
describe('maxSquaredDelta', function () {
|
||||
|
||||
@@ -5,26 +5,7 @@ describe('ol/geom/flat/contains.js', function () {
|
||||
describe('with simple data', function () {
|
||||
const flatCoordinatesSimple = [0, 0, 1, 0, 1, 1, 0, 1];
|
||||
const flatCoordinatesNonSimple = [
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
4,
|
||||
3,
|
||||
1,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
4,
|
||||
0,
|
||||
4,
|
||||
0, 0, 4, 0, 4, 3, 1, 3, 1, 2, 3, 2, 3, 1, 2, 1, 2, 4, 0, 4,
|
||||
];
|
||||
|
||||
describe('linearRingContainsXY', function () {
|
||||
|
||||
@@ -144,32 +144,8 @@ describe('ol/geom/flat/intersectsextent.js', function () {
|
||||
let ends;
|
||||
beforeEach(function () {
|
||||
flatCoordinates = [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
/*hole*/ 2,
|
||||
2,
|
||||
8,
|
||||
2,
|
||||
8,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
8,
|
||||
6,
|
||||
8,
|
||||
8,
|
||||
2,
|
||||
8,
|
||||
2,
|
||||
2,
|
||||
0, 0, 0, 10, 10, 10, 10, 0, 0, 0, /*hole*/ 2, 2, 8, 2, 8, 4, 5, 5, 8, 6,
|
||||
8, 8, 2, 8, 2, 2,
|
||||
];
|
||||
ends = [10, flatCoordinates.length];
|
||||
});
|
||||
|
||||
@@ -91,49 +91,13 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const oriented = linearRingsAreOriented;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [10, 20];
|
||||
@@ -153,89 +117,15 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const oriented = linearRingssAreOriented;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90,
|
||||
-180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90,
|
||||
-180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [
|
||||
@@ -258,49 +148,13 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const orient = orientLinearRings;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [10, 20];
|
||||
@@ -330,89 +184,15 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const orient = orientLinearRingsArray;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90,
|
||||
-180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90,
|
||||
-180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [
|
||||
|
||||
@@ -94,41 +94,11 @@ describe('ol/geom/flat/reverse.js', function () {
|
||||
|
||||
it('can reverse four flat coordinates', function () {
|
||||
const flatCoordinates = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
];
|
||||
reverseCoordinates(flatCoordinates, 0, flatCoordinates.length, 4);
|
||||
expect(flatCoordinates).to.eql([
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
13, 14, 15, 16, 9, 10, 11, 12, 5, 6, 7, 8, 1, 2, 3, 4,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,529 +8,74 @@ import {
|
||||
|
||||
describe('ol/geom/flat/simplify.js', function () {
|
||||
const flatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
391.28,
|
||||
139.39,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
489.2,
|
||||
109.45,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
703.12,
|
||||
214.36,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
829.89,
|
||||
239.89,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
864.68,
|
||||
302.71,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
860.08,
|
||||
314.35,
|
||||
858.29,
|
||||
314.94,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
841.52,
|
||||
383.67,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82,
|
||||
139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 489.2,
|
||||
109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63, 120.89,
|
||||
524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24, 567.69,
|
||||
148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74, 159.86,
|
||||
622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56,
|
||||
671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 703.12,
|
||||
214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36, 729.98, 208.73,
|
||||
735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6, 216.87, 784.2, 218.16,
|
||||
800.24, 214.62, 810.53, 219.73, 817.19, 226.82, 820.77, 236.17, 827.23,
|
||||
236.16, 829.89, 239.89, 851.0, 248.94, 859.88, 255.49, 865.21, 268.53,
|
||||
857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 864.68, 302.71, 867.79,
|
||||
306.17, 859.87, 311.37, 860.08, 314.35, 858.29, 314.94, 858.1, 327.6,
|
||||
854.54, 335.4, 860.92, 343.0, 856.43, 350.15, 851.42, 352.96, 849.84,
|
||||
359.59, 854.56, 365.53, 849.74, 370.38, 844.09, 371.89, 844.75, 380.44,
|
||||
841.52, 383.67, 839.57, 390.4, 845.59, 399.05, 848.4, 407.55, 843.71, 411.3,
|
||||
844.09, 419.88, 839.51, 432.76, 841.33, 441.04, 847.62, 449.22, 847.16,
|
||||
458.44, 851.38, 462.79, 853.97, 471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
const simplifiedRadiallyFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 409.52, 141.14, 414.82, 139.75, 427.72,
|
||||
127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 493.79, 108.63,
|
||||
504.74, 119.66, 512.96, 122.35, 518.63, 120.89, 524.09, 126.88, 529.57,
|
||||
127.86, 534.21, 140.93, 539.27, 147.24, 567.69, 148.91, 575.25, 157.26,
|
||||
580.62, 158.15, 601.53, 156.85, 617.74, 159.86, 622.0, 167.04, 629.55,
|
||||
194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56, 671.55, 222.55,
|
||||
683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 712.26, 215.87, 721.49,
|
||||
212.81, 727.81, 213.36, 729.98, 208.73, 735.32, 208.2, 739.94, 204.77,
|
||||
769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 810.53, 219.73, 817.19,
|
||||
226.82, 820.77, 236.17, 827.23, 236.16, 851.0, 248.94, 859.88, 255.49,
|
||||
865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 867.79,
|
||||
306.17, 859.87, 311.37, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43,
|
||||
350.15, 851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38,
|
||||
844.09, 371.89, 844.75, 380.44, 839.57, 390.4, 845.59, 399.05, 848.4,
|
||||
407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33, 441.04,
|
||||
847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15, 866.36,
|
||||
480.77,
|
||||
];
|
||||
|
||||
const simplifiedFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
267.76,
|
||||
213.81,
|
||||
296.91,
|
||||
155.64,
|
||||
330.33,
|
||||
137.57,
|
||||
409.52,
|
||||
141.14,
|
||||
439.6,
|
||||
119.74,
|
||||
486.51,
|
||||
106.75,
|
||||
529.57,
|
||||
127.86,
|
||||
539.27,
|
||||
147.24,
|
||||
617.74,
|
||||
159.86,
|
||||
629.55,
|
||||
194.6,
|
||||
671.55,
|
||||
222.55,
|
||||
727.81,
|
||||
213.36,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
800.24,
|
||||
214.62,
|
||||
820.77,
|
||||
236.17,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
844.09,
|
||||
371.89,
|
||||
839.57,
|
||||
390.4,
|
||||
848.4,
|
||||
407.55,
|
||||
839.51,
|
||||
432.76,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52,
|
||||
141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24,
|
||||
617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94,
|
||||
204.77, 769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 820.77, 236.17,
|
||||
859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 859.87,
|
||||
311.37, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53,
|
||||
844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97,
|
||||
471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
const simplifiedHighQualityFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
267.76,
|
||||
213.81,
|
||||
296.91,
|
||||
155.64,
|
||||
330.33,
|
||||
137.57,
|
||||
409.52,
|
||||
141.14,
|
||||
439.6,
|
||||
119.74,
|
||||
486.51,
|
||||
106.75,
|
||||
529.57,
|
||||
127.86,
|
||||
539.27,
|
||||
147.24,
|
||||
617.74,
|
||||
159.86,
|
||||
629.55,
|
||||
194.6,
|
||||
671.55,
|
||||
222.55,
|
||||
727.81,
|
||||
213.36,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
820.77,
|
||||
236.17,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
867.79,
|
||||
306.17,
|
||||
858.29,
|
||||
314.94,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
844.09,
|
||||
371.89,
|
||||
839.57,
|
||||
390.4,
|
||||
848.4,
|
||||
407.55,
|
||||
839.51,
|
||||
432.76,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52,
|
||||
141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24,
|
||||
617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94,
|
||||
204.77, 769.98, 208.42, 784.2, 218.16, 800.24, 214.62, 820.77, 236.17,
|
||||
859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 858.29,
|
||||
314.94, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53,
|
||||
844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97,
|
||||
471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
describe('simplifyLineString', function () {
|
||||
|
||||
@@ -35,24 +35,7 @@ describe('ol/geom/flat/straightchunk.js', function () {
|
||||
|
||||
describe('longer line string', function () {
|
||||
const flatCoords = [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
0,
|
||||
-1,
|
||||
2,
|
||||
-2,
|
||||
4,
|
||||
0, 0, 1, 0, 1, 1, 0, 1, 0, -1, -1, -1, -1, 0, -1, 2, -2, 4,
|
||||
];
|
||||
const stride = 2;
|
||||
|
||||
|
||||
@@ -32,11 +32,7 @@ describe('ol/geom/flat/transform.js', function () {
|
||||
],
|
||||
]).transform('EPSG:4326', 'EPSG:3857');
|
||||
const transform = [
|
||||
0.0004088332670837288,
|
||||
0,
|
||||
0,
|
||||
-0.0004088332670837288,
|
||||
4480.991370439071,
|
||||
0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071,
|
||||
1529.5752568707105,
|
||||
];
|
||||
const pixelCoordinates = transformGeom2D(
|
||||
@@ -112,36 +108,8 @@ describe('ol/geom/flat/transform.js', function () {
|
||||
flatCoordinates
|
||||
);
|
||||
expect(flatCoordinates).to.eql([
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
1, 2, 2, 1, 3, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 4, 3, 3, 5, 3, 4, 5, 3,
|
||||
4, 4, 3, 3, 4, 3,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -673,12 +673,8 @@ describe('ol/proj.js', function () {
|
||||
expect(typeof transform).to.be('function');
|
||||
|
||||
const output = transform([
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
-12000000,
|
||||
5000000,
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
-626172.13571216376, 6887893.4928337997, -12000000, 5000000,
|
||||
-626172.13571216376, 6887893.4928337997,
|
||||
]);
|
||||
|
||||
expect(output[0]).to.roughlyEqual(-5.625, 1e-9);
|
||||
@@ -710,15 +706,8 @@ describe('ol/proj.js', function () {
|
||||
const dimension = 3;
|
||||
const output = transform(
|
||||
[
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
100,
|
||||
-12000000,
|
||||
5000000,
|
||||
200,
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
300,
|
||||
-626172.13571216376, 6887893.4928337997, 100, -12000000, 5000000, 200,
|
||||
-626172.13571216376, 6887893.4928337997, 300,
|
||||
],
|
||||
undefined,
|
||||
dimension
|
||||
|
||||
@@ -328,9 +328,7 @@ describe('ol/tilegrid/TileGrid.js', function () {
|
||||
beforeEach(function () {
|
||||
tileGrid = new TileGrid({
|
||||
extent: [
|
||||
343870.8496458133,
|
||||
5809157.009546259,
|
||||
1905238.0275122682,
|
||||
343870.8496458133, 5809157.009546259, 1905238.0275122682,
|
||||
7515502.7821859205,
|
||||
],
|
||||
sizes: [
|
||||
@@ -340,9 +338,7 @@ describe('ol/tilegrid/TileGrid.js', function () {
|
||||
[11, 16],
|
||||
],
|
||||
resolutions: [
|
||||
4174.778550445067,
|
||||
2087.3892752225333,
|
||||
1043.6946376112667,
|
||||
4174.778550445067, 2087.3892752225333, 1043.6946376112667,
|
||||
521.8473188056333,
|
||||
],
|
||||
tileSizes: [
|
||||
|
||||
@@ -13,22 +13,7 @@ describe('ol/vec/mat4.js', function () {
|
||||
const transform = [1, 2, 3, 4, 5, 6];
|
||||
const result = create();
|
||||
expect(fromTransform(result, transform)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
4,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
5,
|
||||
6,
|
||||
0,
|
||||
1,
|
||||
1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1,
|
||||
]);
|
||||
expect(result).to.eql([1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user