(x, y, minX, minY, size)
| 2037 | |
| 2038 | // z-order of a point given coords and size of the data bounding box |
| 2039 | function zOrder(x, y, minX, minY, size) { |
| 2040 | // coords are transformed into non-negative 15-bit integer range |
| 2041 | x = 32767 * (x - minX) / size; |
| 2042 | y = 32767 * (y - minY) / size; |
| 2043 | |
| 2044 | x = (x | x << 8) & 0x00FF00FF; |
| 2045 | x = (x | x << 4) & 0x0F0F0F0F; |
| 2046 | x = (x | x << 2) & 0x33333333; |
| 2047 | x = (x | x << 1) & 0x55555555; |
| 2048 | |
| 2049 | y = (y | y << 8) & 0x00FF00FF; |
| 2050 | y = (y | y << 4) & 0x0F0F0F0F; |
| 2051 | y = (y | y << 2) & 0x33333333; |
| 2052 | y = (y | y << 1) & 0x55555555; |
| 2053 | |
| 2054 | return x | y << 1; |
| 2055 | } |
| 2056 | |
| 2057 | // find the leftmost node of a polygon ring |
| 2058 | function getLeftmost(start) { |
no outgoing calls
no test coverage detected