MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / linkedList

Function linkedList

libs/mapv/mapv.js:1652–1671  ·  view source on GitHub ↗
(data, start, end, dim, clockwise)

Source from the content-addressed store, hash-verified

1650
1651// create a circular doubly linked list from polygon points in the specified winding order
1652function linkedList(data, start, end, dim, clockwise) {
1653 var i, last;
1654
1655 if (clockwise === signedArea(data, start, end, dim) > 0) {
1656 for (i = start; i < end; i += dim) {
1657 last = insertNode(i, data[i], data[i + 1], last);
1658 }
1659 } else {
1660 for (i = end - dim; i >= start; i -= dim) {
1661 last = insertNode(i, data[i], data[i + 1], last);
1662 }
1663 }
1664
1665 if (last && equals(last, last.next)) {
1666 removeNode(last);
1667 last = last.next;
1668 }
1669
1670 return last;
1671}
1672
1673// eliminate colinear or duplicate points
1674function filterPoints(start, end) {

Callers 2

earcutFunction · 0.85
eliminateHolesFunction · 0.85

Calls 4

signedAreaFunction · 0.85
insertNodeFunction · 0.85
equalsFunction · 0.85
removeNodeFunction · 0.85

Tested by

no test coverage detected