Add ol.geom.flat.linearRingArea

This commit is contained in:
Tom Payne
2013-12-02 12:05:04 +01:00
parent c3378d0bd5
commit f80cad531b
2 changed files with 36 additions and 0 deletions

View File

@@ -127,6 +127,20 @@ describe('ol.geom.flat', function() {
});
describe('ol.geom.flat.linearRingArea', function() {
it('calcaultes the area of a triangle', function() {
var area = ol.geom.flat.linearRingArea([0, 0, 0.5, 1, 1, 0], 0, 6, 2);
expect(area).to.be(0.5);
});
it('calculates the area of a unit square', function() {
var area = ol.geom.flat.linearRingArea([0, 0, 0, 1, 1, 1, 1, 0], 0, 8, 2);
expect(area).to.be(1);
});
});
describe('ol.geom.flat.linearRingIsClockwise', function() {
it('identifies clockwise rings', function() {