Fix offset passed from linearRingssAreOriented to linearRingsAreOriented

The offset needs to be set to the end of the previous Polygon,
see `offset = orientLinearRings(...)` in function orientLinearRingsArray

Fixes #9189
This commit is contained in:
Roman Zoller
2019-02-05 17:44:46 +01:00
parent 2c859b1196
commit ee57b197e5

View File

@@ -77,10 +77,14 @@ export function linearRingsAreOriented(flatCoordinates, offset, ends, stride, op
*/
export function linearRingssAreOriented(flatCoordinates, offset, endss, stride, opt_right) {
for (let i = 0, ii = endss.length; i < ii; ++i) {
const ends = endss[i];
if (!linearRingsAreOriented(
flatCoordinates, offset, endss[i], stride, opt_right)) {
flatCoordinates, offset, ends, stride, opt_right)) {
return false;
}
if (ends.length) {
offset = ends[ends.length - 1];
}
}
return true;
}