UNPKG

@terrestris/ol-util

Version:

A set of helper classes for working with openLayers

421 lines (397 loc) 10.7 kB
export const boxCoords = [ [ [10, 10], [40, 10], [40, 40], [10, 40], [10, 10] ] ]; export const lineStringCoords = [ [25, 50], [25, 0] ]; export const splitBoxCoords1 = [[ [25, 40], [10, 40], [10, 10], [25, 10], [25, 40] ]]; export const splitBoxCoords2 = [[ [25, 10], [40, 10], [40, 40], [25, 40], [25, 10] ]]; export const lineStringLFormedCoords = [ [25, 50], [25, 25], [50, 25] ]; export const splitBoxLFormedCoords1 = [[ [25, 40], [10, 40], [10, 10], [40, 10], [40, 25], [25, 25], [25, 40] ]]; export const splitBoxLFormedCoords2 = [[ [40, 25], [40, 40], [25, 40], [25, 25], [40, 25] ]]; export const uFormedPolygonCoords = [[ [10, 40], [20, 40], [20, 30], [30, 30], [30, 40], [40, 40], [40, 10], [10, 10], [10, 40] ]]; export const lineStringCoords2 = [ [0, 35], [50, 35] ]; export const splitUFormerdCoords1 = [[[10,35],[10,10],[40,10],[40,35],[30,35],[30,30],[20,30],[20,35],[10,35]]]; export const splitUFormerdCoords2 = [[[40,35],[40,40],[30,40],[30,35],[40,35]]]; export const splitUFormerdCoords3 = [[[20,35],[20,40],[10,40],[10,35],[20,35]]]; export const pointCoords = [13, 37]; export const bufferedPointCoords = [ [ [ 13.002252142190631, 36.999999978725924 ], [ 13.002208878103968, 37.00035087693419 ], [ 13.002080726910485, 37.00068829184835 ], [ 13.001872612405041, 37.000999256540105 ], [ 13.001592531654072, 37.00127182041798 ], [ 13.001251247772899, 37.001495508541694 ], [ 13.000861876340403, 37.00166172423881 ], [ 13.000439381339582, 37.001764079540486 ], [ 13, 37.00179864072744 ], [ 12.99956061866042, 37.001764079540486 ], [ 12.999138123659597, 37.00166172423881 ], [ 12.998748752227103, 37.001495508541694 ], [ 12.99840746834593, 37.00127182041798 ], [ 12.99812738759496, 37.000999256540105 ], [ 12.997919273089517, 37.00068829184835 ], [ 12.997791121896034, 37.00035087693419 ], [ 12.99774785780937, 36.999999978725924 ], [ 12.997791142283894, 36.99964908213706 ], [ 12.997919310761372, 36.99931167183453 ], [ 12.998127436815611, 36.999000714044584 ], [ 12.998407521621978, 36.99872815830795 ], [ 12.998748801447755, 36.998504478325465 ], [ 12.999138161331453, 36.99833826953016 ], [ 12.999560639048282, 36.998235918840116 ], [ 13, 36.99820135927255 ], [ 13.00043936095172, 36.998235918840116 ], [ 13.000861838668548, 36.99833826953016 ], [ 13.001251198552247, 36.998504478325465 ], [ 13.001592478378024, 36.99872815830795 ], [ 13.00187256318439, 36.999000714044584 ], [ 13.00208068923863, 36.99931167183453 ], [ 13.002208857716107, 36.99964908213706 ], [ 13.002252142190631, 36.999999978725924 ] ] ]; export const bufferedBoxCoords = [ [ [ 9.998197119361716, 10.000035594367398 ], [ 9.99821453655676, 9.999704123129588 ], [ 9.998294090970681, 9.999382949253315 ], [ 9.998433013738687, 9.999083250078769 ], [ 9.998626469949038, 9.998815455547884 ], [ 9.998867726923994, 9.998588885248463 ], [ 9.999148388531879, 9.998411424101933 ], [ 9.999458687375643, 9.998289247977606 ], [ 9.999787824690936, 9.998226608779039 ], [ 10.000124346128455, 9.998225686479298 ], [ 39.99987565387154, 9.998225686479302 ], [ 40.00021217530906, 9.998226608779037 ], [ 40.00054131262436, 9.998289247977606 ], [ 40.000851611468114, 9.998411424101933 ], [ 40.001132273076, 9.998588885248463 ], [ 40.001373530050955, 9.998815455547888 ], [ 40.00156698626131, 9.999083250078773 ], [ 40.00170590902931, 9.999382949253315 ], [ 40.001785463443234, 9.999704123129588 ], [ 40.00180288063829, 10.000035594367398 ], [ 40.00232295733205, 39.99996064861952 ], [ 40.00229262751348, 40.00033037149533 ], [ 40.00216290080641, 40.00068577204011 ], [ 40.0019394001595, 40.00101144181533 ], [ 40.00163181443618, 40.00129326116642 ], [ 40.00125347851804, 40.00151901143438 ], [ 40.00082079524447, 40.00167890477209 ], [ 40.00035252423828, 40.00176600858138 ], [ 9.999647475761709, 40.00176600858138 ], [ 9.999179204755523, 40.00167890477209 ], [ 9.99874652148196, 40.00151901143438 ], [ 9.998368185563816, 40.00129326116642 ], [ 9.99806059984049, 40.00101144181533 ], [ 9.997837099193585, 40.00068577204011 ], [ 9.99770737248652, 40.00033037149533 ], [ 9.997677042667942, 39.99996064861952 ], [ 9.998197119361716, 10.000035594367398 ] ] ]; export const bufferedLineStringCoords = [ [ [ 24.998257891072754, -7.9051605219184e-9 ], [ 24.99829136674891, -0.00035090500294483723 ], [ 24.998390504067196, -0.0006883167545465821 ], [ 24.99855149308735, -0.0009992767131199265 ], [ 24.998768146992248, -0.0012718350077722566 ], [ 24.999032139858944, -0.0014955175482351789 ], [ 24.999333326624537, -0.0016617285120711141 ], [ 24.999660132949916, -0.0017640806510699132 ], [ 25, -0.0017986407274450057 ], [ 25.000339867050084, -0.0017640806510699132 ], [ 25.000666673375463, -0.0016617285120711141 ], [ 25.000967860141056, -0.0014955175482351789 ], [ 25.001231853007756, -0.0012718350077722566 ], [ 25.00144850691265, -0.0009992767131199265 ], [ 25.001609495932804, -0.0006883167545465821 ], [ 25.00170863325109, -0.00035090500294483723 ], [ 25.001742108927246, -7.9051605219184e-9 ], [ 25.002710240366365, 49.99999997634171 ], [ 25.00265818086059, 50.00035087464064 ], [ 25.00250396702027, 50.00068828981316 ], [ 25.002253523556142, 50.00099925489165 ], [ 25.00191647377371, 50.00127181922573 ], [ 25.00150576992199, 50.00149550780569 ], [ 25.00103719550449, 50.0016617238896 ], [ 25.00052875866947, 50.00176407944973 ], [ 25, 50.00179864072744 ], [ 24.99947124133053, 50.00176407944973 ], [ 24.99896280449551, 50.0016617238896 ], [ 24.998494230078013, 50.00149550780569 ], [ 24.99808352622629, 50.00127181922573 ], [ 24.997746476443858, 50.00099925489165 ], [ 24.99749603297973, 50.00068828981316 ], [ 24.99734181913941, 50.00035087464064 ], [ 24.997289759633635, 49.99999997634171 ], [ 24.998257891072754, -7.9051605219184e-9 ] ] ]; export const boxCoords2 = [ [ [15, 35], [35, 35], [35, 15], [15, 15], [15, 35] ] ]; export const holeCoords = [ boxCoords[0], boxCoords2[0] ]; export const bufferedHoleCoords = [ [ [ 9.998197119361716, 10.000035594367398 ], [ 9.99821453655676, 9.999704123129588 ], [ 9.998294090970681, 9.999382949253315 ], [ 9.998433013738687, 9.999083250078769 ], [ 9.998626469949038, 9.998815455547884 ], [ 9.998867726923994, 9.998588885248463 ], [ 9.999148388531879, 9.998411424101933 ], [ 9.999458687375643, 9.998289247977606 ], [ 9.999787824690936, 9.998226608779039 ], [ 10.000124346128455, 9.998225686479298 ], [ 39.99987565387154, 9.998225686479302 ], [ 40.00021217530906, 9.998226608779037 ], [ 40.00054131262436, 9.998289247977606 ], [ 40.000851611468114, 9.998411424101933 ], [ 40.001132273076, 9.998588885248463 ], [ 40.001373530050955, 9.998815455547888 ], [ 40.00156698626131, 9.999083250078773 ], [ 40.00170590902931, 9.999382949253315 ], [ 40.001785463443234, 9.999704123129588 ], [ 40.00180288063829, 10.000035594367398 ], [ 40.00232295733205, 39.99996064861952 ], [ 40.00229262751348, 40.00033037149533 ], [ 40.00216290080641, 40.00068577204011 ], [ 40.0019394001595, 40.00101144181533 ], [ 40.00163181443618, 40.00129326116642 ], [ 40.00125347851804, 40.00151901143438 ], [ 40.00082079524447, 40.00167890477209 ], [ 40.00035252423828, 40.00176600858138 ], [ 9.999647475761709, 40.00176600858138 ], [ 9.999179204755523, 40.00167890477209 ], [ 9.99874652148196, 40.00151901143438 ], [ 9.998368185563816, 40.00129326116642 ], [ 9.99806059984049, 40.00101144181533 ], [ 9.997837099193585, 40.00068577204011 ], [ 9.99770737248652, 40.00033037149533 ], [ 9.997677042667942, 39.99996064861952 ], [ 9.998197119361716, 10.000035594367398 ] ], [ [ 15.002222569100889, 34.99835355408961 ], [ 34.997777430899106, 34.99835355408962 ], [ 34.998111299821126, 15.001912217796027 ], [ 15.00188870017887, 15.001912217796027 ], [ 15.002222569100889, 34.99835355408961 ] ] ]; export const pointCoords2 = [37, 13]; export const pointCoords3 = [47, 11]; export const pointCoords4 = [11, 47]; export const mergedPointCoordinates = [ [13, 37], [37, 13] ]; export const mergedPointCoordinates2 = [ [13, 37], [37, 13], [47, 11], [11, 47] ]; export const boxCoords3 = [[ [0, 20], [20, 20], [20, 0], [0, 0], [0, 20] ]]; export const mergedBoxCoords = [ boxCoords, boxCoords3 ]; export const mergedLineStringCoordinates = [ lineStringCoords, lineStringCoords2 ]; export const unionedBoxCoordinates = [[ [ 10, 10 ], [ 40, 10 ], [ 40, 40 ], [ 10, 40 ], [ 10, 10 ] ]]; export const differenceBoxCoords = [ [ [ 10, 10 ], [ 40, 10 ], [ 40, 40 ], [ 10, 40 ], [ 10, 10 ] ],[ [ 15, 15 ], [ 15, 35 ], [ 35, 35 ], [ 35, 15 ], [ 15, 15 ] ] ]; export const intersectionCoords = [ [ [ 10, 10 ], [ 20, 10 ], [ 20, 20 ], [ 10, 20 ], [ 10, 10 ] ] ]; export const boxCoords4 = [[ [0, 5], [5, 5], [5, 0], [0, 0], [0, 5] ]]; export const expectedMultiPolygon = [ [ [ [10, 10], [40, 10], [40, 40], [10, 40], [10, 10] ] ], [ [ [15, 35], [35, 35], [35, 15], [15, 15], [15, 35] ] ], [ [ [0, 20], [20, 20], [20, 0], [0, 0], [0, 20] ] ], [ [ [0, 5], [5, 5], [5, 0], [0, 0], [0, 5] ] ] ]; export const holeCoords2 = [ [ [10,40], [40,40], [40,10], [-7,10], [-7,40], [10,15], [10,40] ], [ [15,15], [35,15], [35,35], [15,35], [15,15] ] ]; export const holeCoords2CutLine = [ [ -20, 25 ], [ 50, 25 ] ]; export const holeCoords2ExpPoly1 = [ [ [ -7, 25 ], [ -7, 10 ], [ 40, 10 ], [ 40, 25 ], [ 35, 25 ], [ 35, 15 ], [ 15, 15 ], [ 15, 25 ], [ 10, 25 ], [ 10, 15 ], [ 3.1999999999999993, 25 ], [ -7, 25 ] ] ]; export const holeCoords2ExpPoly2 = [ [ [ 40, 25 ], [ 40, 40 ], [ 10, 40 ], [ 10, 25 ], [ 15, 25 ], [ 15, 35 ], [ 35, 35 ], [ 35, 25 ], [ 40, 25 ] ]]; export const holeCoords2ExpPoly3 = [ [ [ 3.1999999999999993, 25 ], [ -7, 40 ], [ -7, 25 ], [ 3.1999999999999993, 25 ] ] ];