tile38/pkg/geojson/multipolygon_test.go

275 lines
42 KiB
Go

package geojson
import (
"testing"
)
func TestMultiPolygon(t *testing.T) {
testJSON(t, `
{
"type": "MultiPolygon",
"coordinates": [
[
[
[-84.32281494140625,34.9895035675793],
[-84.29122924804688,35.21981940793435],
[-84.24041748046875,35.25459097465022],
[-84.22531127929688,35.266925688950074],
[-84.20745849609375,35.26580442886754],
[-84.19921875,35.24674063355999],
[-84.16213989257812,35.24113278166642],
[-84.12368774414062,35.24898366572645],
[-84.09072875976562,35.24898366572645],
[-84.08798217773438,35.264683153268116],
[-84.04266357421875,35.27701633139884],
[-84.03030395507812,35.291589484566124],
[-84.0234375,35.306160014550784],
[-84.03305053710936,35.32745068492882],
[-84.03579711914062,35.34313496028189],
[-84.03579711914062,35.348735749472546],
[-84.01657104492188,35.35545618392078],
[-84.01107788085938,35.37337460834958],
[-84.00970458984374,35.39128905521763],
[-84.01931762695312,35.41479572901859],
[-84.00283813476562,35.429344044107154],
[-83.93692016601562,35.47409160773029],
[-83.91220092773438,35.47632833265728],
[-83.88885498046875,35.504282143299655],
[-83.88473510742186,35.516578738902936],
[-83.8751220703125,35.52104976129943],
[-83.85314941406249,35.52104976129943],
[-83.82843017578125,35.52104976129943],
[-83.8092041015625,35.53446133418443],
[-83.80233764648438,35.54116627999813],
[-83.76800537109374,35.56239491058853],
[-83.7432861328125,35.56239491058853],
[-83.71994018554688,35.56239491058853],
[-83.67050170898438,35.569097520776054],
[-83.6334228515625,35.570214567965984],
[-83.61007690429688,35.576916524038616],
[-83.59634399414061,35.574682600980914],
[-83.5894775390625,35.55904339525896],
[-83.55239868164062,35.56574628576276],
[-83.49746704101562,35.563512051219696],
[-83.47000122070312,35.586968406786475],
[-83.4466552734375,35.60818490437746],
[-83.37936401367188,35.63609277863135],
[-83.35739135742188,35.65618041632016],
[-83.32305908203124,35.66622234103479],
[-83.3148193359375,35.65394870599763],
[-83.29971313476561,35.660643649881614],
[-83.28598022460938,35.67180064238771],
[-83.26126098632811,35.6907639509368],
[-83.25714111328125,35.69968630125201],
[-83.25576782226562,35.715298012125295],
[-83.23516845703125,35.72310272092263],
[-83.19808959960936,35.72756221127198],
[-83.16238403320312,35.753199435570316],
[-83.15826416015625,35.76322914549896],
[-83.10333251953125,35.76991491635478],
[-83.08685302734375,35.7843988251953],
[-83.0511474609375,35.787740890986576],
[-83.01681518554688,35.78328477203738],
[-83.001708984375,35.77882840327371],
[-82.96737670898438,35.793310688351724],
[-82.94540405273438,35.820040281161],
[-82.9193115234375,35.85121343450061],
[-82.9083251953125,35.86902116501695],
[-82.90557861328125,35.87792352995116],
[-82.91244506835938,35.92353244718235],
[-82.88360595703125,35.94688293218141],
[-82.85614013671875,35.951329861522666],
[-82.8424072265625,35.94243575255426],
[-82.825927734375,35.92464453144099],
[-82.80670166015625,35.927980690382704],
[-82.80532836914062,35.94243575255426],
[-82.77923583984375,35.97356075349624],
[-82.78060913085938,35.99245209055831],
[-82.76138305664062,36.00356252895066],
[-82.69546508789062,36.04465753921525],
[-82.64465332031249,36.060201412392914],
[-82.61306762695312,36.060201412392914],
[-82.60620117187499,36.033552893400376],
[-82.60620117187499,35.991340960635405],
[-82.60620117187499,35.97911749857497],
[-82.5787353515625,35.96133453736691],
[-82.5677490234375,35.951329861522666],
[-82.53067016601562,35.97244935753683],
[-82.46475219726562,36.006895355244666],
[-82.41668701171875,36.070192281208456],
[-82.37960815429686,36.10126686921446],
[-82.35488891601562,36.117908916563685],
[-82.34115600585936,36.113471382052175],
[-82.29583740234375,36.13343831245866],
[-82.26287841796874,36.13565654678543],
[-82.23403930664062,36.13565654678543],
[-82.2216796875,36.154509006695],
[-82.20382690429688,36.15561783381855],
[-82.19009399414062,36.144528857027744],
[-82.15438842773438,36.15007354140755],
[-82.14065551757812,36.134547437460064],
[-82.1337890625,36.116799556445024],
[-82.12142944335938,36.10570509327921],
[-82.08984375,36.10792411128649],
[-82.05276489257811,36.12678323326429],
[-82.03628540039062,36.12900165569652],
[-81.91268920898438,36.29409768373033],
[-81.89071655273438,36.30959215409138],
[-81.86325073242188,36.33504067209607],
[-81.83029174804688,36.34499652561904],
[-81.80145263671875,36.35605709240176],
[-81.77947998046874,36.34610265300638],
[-81.76162719726562,36.33835943134047],
[-81.73690795898438,36.33835943134047],
[-81.71905517578125,36.33835943134047],
[-81.70669555664062,36.33504067209607],
[-81.70669555664062,36.342784223707234],
[-81.72317504882812,36.357163062654365],
[-81.73278808593749,36.379279167407965],
[-81.73690795898438,36.40028364332352],
[-81.73690795898438,36.41354670392876],
[-81.72454833984374,36.423492513472326],
[-81.71768188476562,36.445589751779174],
[-81.69845581054688,36.47541104282962],
[-81.69845581054688,36.51073994146672],
[-81.705322265625,36.53060536411363],
[-81.69158935546875,36.55929085774001],
[-81.68060302734375,36.56480607840351],
[-81.68197631835938,36.58686302344181],
[-81.04202270507812,36.56370306576917],
[-80.74264526367186,36.561496993252575],
[-79.89120483398438,36.54053616262899],
[-78.68408203124999,36.53943280355122],
[-77.88345336914062,36.54053616262899],
[-76.91665649414062,36.54163950596125],
[-76.91665649414062,36.55046568575947],
[-76.31103515625,36.551568887374],
[-75.79605102539062,36.54936246839778],
[-75.6298828125,36.07574221562703],
[-75.4925537109375,35.82226734114509],
[-75.3936767578125,35.639441068973916],
[-75.41015624999999,35.43829554739668],
[-75.43212890625,35.263561862152095],
[-75.487060546875,35.18727767598896],
[-75.5914306640625,35.17380831799959],
[-75.9210205078125,35.04798673426734],
[-76.17919921875,34.867904962568744],
[-76.41540527343749,34.62868797377061],
[-76.4593505859375,34.57442951865274],
[-76.53076171875,34.53371242139567],
[-76.5911865234375,34.551811369170494],
[-76.651611328125,34.615126683462194],
[-76.761474609375,34.63320791137959],
[-77.069091796875,34.59704151614417],
[-77.376708984375,34.45674800347809],
[-77.5909423828125,34.3207552752374],
[-77.8326416015625,33.97980872872457],
[-77.9150390625,33.80197351806589],
[-77.9754638671875,33.73804486328907],
[-78.11279296875,33.8521697014074],
[-78.2830810546875,33.8521697014074],
[-78.4808349609375,33.815666308702774],
[-79.6728515625,34.8047829195724],
[-80.782470703125,34.836349990763864],
[-80.782470703125,34.91746688928252],
[-80.9307861328125,35.092945313732635],
[-81.0516357421875,35.02999636902566],
[-81.0516357421875,35.05248370662468],
[-81.0516357421875,35.137879119634185],
[-82.3150634765625,35.19625600786368],
[-82.3590087890625,35.19625600786368],
[-82.40295410156249,35.22318504970181],
[-82.4688720703125,35.16931803601131],
[-82.6885986328125,35.1154153142536],
[-82.781982421875,35.06147690849717],
[-83.1060791015625,35.003003395276714],
[-83.616943359375,34.99850370014629],
[-84.05639648437499,34.985003130171066],
[-84.22119140625,34.985003130171066],
[-84.32281494140625,34.9895035675793]
],
[
[-75.69030761718749,35.74205383068037],
[-75.5914306640625,35.74205383068037],
[-75.5419921875,35.585851593232356],
[-75.56396484375,35.32633026307483],
[-75.69030761718749,35.285984736065735],
[-75.970458984375,35.16482750605027],
[-76.2066650390625,34.994003757575776],
[-76.300048828125,35.02999636902566],
[-76.409912109375,35.07946034047981],
[-76.5252685546875,35.10642805736423],
[-76.4208984375,35.25907654252574],
[-76.3385009765625,35.294952147406576],
[-76.0858154296875,35.29943548054543],
[-75.948486328125,35.44277092585766],
[-75.8660888671875,35.53669637839501],
[-75.772705078125,35.567980458012094],
[-75.706787109375,35.634976650677295],
[-75.706787109375,35.74205383068037],
[-75.69030761718749,35.74205383068037]
]
],
[
[
[-109.0283203125,36.98500309285596],
[-109.0283203125,40.97989806962013],
[-102.06298828125,40.97989806962013],
[-102.06298828125,37.00255267215955],
[-109.0283203125,36.98500309285596]
]
]
]
}
`)
}
func TestIssue244(t *testing.T) {
json := `{"type":"MultiPolygon","coordinates":[[[[180.0,40.0],[180.0,50.0],[170.0,50.0],[170.0,40.0],[180.0,40.0]]],[[[-170.0,40.0],[-170.0,50.0],[-180.0,50.0],[-180.0,40.0],[-170.0,40.0]]]]}`
g := testJSON(t, json).(MultiPolygon)
if !(SimplePoint{180.0, 40.0}).Within(g) {
t.Fatal("!")
}
if !(SimplePoint{179.0, 45.0}).Within(g) {
t.Fatal("!")
}
if !(SimplePoint{179.0, 45.0}).Within(Polygon{Coordinates: g.Coordinates[0]}) {
t.Fatal("!")
}
if (SimplePoint{179.0, 45.0}).Within(Polygon{Coordinates: g.Coordinates[1]}) {
t.Fatal("!")
}
}
func TestIssue268(t *testing.T) {
// Simplified geojson of Jersey City from https://github.com/tidwall/tile38/issues/268.
var json = `{"type":"MultiPolygon","coordinates":[[[[-74.116904,40.710477],[-74.103844,40.718665],[-74.103774,40.718694],[-74.094018,40.735138],[-74.093956,40.735199],[-74.080262,40.741407],[-74.077047,40.743248],[-74.075202,40.747395],[-74.078686,40.750601],[-74.075259,40.752693],[-74.075229,40.752748],[-74.076518,40.754725],[-74.076522,40.754807],[-74.074893,40.755611],[-74.074865,40.755663],[-74.074799,40.758149],[-74.074768,40.758186],[-74.065019,40.763723],[-74.06493,40.763755],[-74.060077,40.762508],[-74.06002,40.762542],[-74.060007,40.765648],[-74.05998,40.765723],[-74.057029,40.768911],[-74.056969,40.768987],[-74.052873,40.761349],[-74.05262,40.761053],[-74.044837,40.757022],[-74.04365,40.756586],[-74.042444,40.752501],[-74.042373,40.752416],[-74.038769,40.750888],[-74.037784,40.750317],[-74.043674,40.740008],[-74.043781,40.739849],[-74.042816,40.736036],[-74.042821,40.735952],[-74.038596,40.736322],[-74.038572,40.736322],[-74.022888,40.731061],[-74.020405,40.730321],[-74.02597,40.701624],[-74.026284,40.699902],[-74.048937,40.662702],[-74.049594,40.661622],[-74.065826,40.666881],[-74.097399,40.680376],[-74.098129,40.680685],[-74.102849,40.69536],[-74.102851,40.695424],[-74.114231,40.700944],[-74.114559,40.701072],[-74.113338,40.702477],[-74.112787,40.703102],[-74.116904,40.710477]],[[-74.047285,40.690503],[-74.043556,40.689147],[-74.043513,40.689274],[-74.04586,40.691102],[-74.04607,40.691185],[-74.047285,40.690503]],[[-74.04074,40.700131],[-74.038372,40.698669],[-74.038368,40.698687],[-74.04074,40.700131]]]]}`
g := testJSON(t, json).(MultiPolygon)
p := testJSON(t, `{"type":"Point","coordinates":[-74.03466,40.767623]}`).(SimplePoint)
if p.Intersects(g) {
t.Fatal("expected false")
}
if g.Intersects(p) {
t.Fatal("expected false")
}
}
func TestIssue313(t *testing.T) {
seattle := `{"type":"MultiPolygon","coordinates":[[[[-122.459774,47.672418],[-122.459709,47.675379],[-122.4597,47.675788],[-122.459683,47.675916],[-122.458971,47.680926],[-122.458558,47.682498],[-122.458111,47.683765],[-122.458,47.684079],[-122.457614,47.685171],[-122.457488,47.68543],[-122.456968,47.686504],[-122.456092,47.688312],[-122.454756,47.690489],[-122.454429,47.690985],[-122.453318,47.692671],[-122.453026,47.693266],[-122.452737,47.693789],[-122.451562,47.695856],[-122.450629,47.697496],[-122.449862,47.698864],[-122.449309,47.700139],[-122.448927,47.700862],[-122.448835,47.701036],[-122.448531,47.70152],[-122.448055,47.702279],[-122.446925,47.704478],[-122.446429,47.705188],[-122.445657,47.706293],[-122.444914,47.707091],[-122.444314,47.707646],[-122.441601,47.709459],[-122.440025,47.710588],[-122.439289,47.711232],[-122.43746,47.713048],[-122.437052,47.713926],[-122.436881,47.714291],[-122.436612,47.715198],[-122.435789,47.717976],[-122.435323,47.719821],[-122.434396,47.724353],[-122.434061,47.726357],[-122.434002,47.726715],[-122.433464,47.728908],[-122.433291,47.729347],[-122.433205,47.729578],[-122.432673,47.730958],[-122.432216,47.731932],[-122.431994,47.732405],[-122.42992,47.73528],[-122.381268,47.734302],[-122.375049,47.734164],[-122.374886,47.734164],[-122.374681,47.734163],[-122.374618,47.734163],[-122.374476,47.734165],[-122.37432,47.734163],[-122.374302,47.734163],[-122.374241,47.734163],[-122.374196,47.734163],[-122.373467,47.734161],[-122.373354,47.734161],[-122.372448,47.73416],[-122.37216,47.734159],[-122.372085,47.734159],[-122.371754,47.734158],[-122.371669,47.734158],[-122.370363,47.734156],[-122.370249,47.734156],[-122.36903,47.734154],[-122.367154,47.734144],[-122.367055,47.734144],[-122.3663,47.73414],[-122.363917,47.734136],[-122.363853,47.734136],[-122.361959,47.734145],[-122.360931,47.734139],[-122.359169,47.734136],[-122.355572,47.734129],[-122.35426,47.734128],[-122.35304,47.734128],[-122.351774,47.734128],[-122.350507,47.734128],[-122.347803,47.734127],[-122.3463,47.734127],[-122.345211,47.734127],[-122.345098,47.734127],
[-122.344994,47.734127],[-122.344005,47.734128],[-122.343425,47.734128],[-122.342393,47.734129],[-122.341337,47.73413],[-122.341034,47.73413],[-122.340744,47.73413],[-122.339688,47.734131],[-122.338631,47.734132],[-122.338076,47.734132],[-122.336983,47.734133],[-122.335926,47.734134],[-122.335546,47.734134],[-122.335333,47.734134],[-122.334277,47.734135],[-122.333749,47.73413],[-122.33303,47.734125],[-122.331579,47.734114],[-122.330226,47.734103],[-122.328881,47.734093],[-122.326382,47.734074],[-122.326216,47.734073],[-122.325655,47.734069],[-122.32532,47.734062],[-122.325246,47.734065],[-122.324982,47.734063],[-122.324734,47.734061],[-122.324523,47.73406],[-122.324457,47.734059],[-122.323589,47.734052],[-122.322219,47.734039],[-122.320801,47.734026],[-122.318117,47.734001],[-122.31676,47.733988],[-122.315443,47.733975],[-122.31275,47.73395],[-122.310048,47.733919],[-122.308696,47.733904],[-122.308045,47.733896],[-122.307326,47.733889],[-122.306171,47.733876],[-122.305994,47.733874],[-122.304844,47.73386],[-122.304574,47.733856],[-122.303599,47.733846],[-122.301955,47.733828],[-122.300586,47.733817],[-122.29923,47.733806],[-122.297877,47.733795],[-122.29652,47.733784],[-122.295306,47.733774],[-122.295163,47.733773],[-122.294692,47.733769],[-122.29381,47.733762],[-122.292435,47.733751],[-122.291098,47.73374],[-122.289753,47.733732],[-122.288415,47.733729],[-122.28705,47.733721],[-122.286711,47.733724],[-122.286323,47.733729],[-122.285957,47.733732],[-122.285869,47.73372],[-122.284606,47.73365],[-122.284471,47.733648],[-122.283695,47.733605],[-122.28194,47.733583],[-122.276442,47.733515],[-122.274368,47.73349],[-122.273588,47.726928],[-122.273307,47.725913],[-122.271923,47.720434],[-122.271223,47.718857],[-122.269138,47.714124],[-122.267094,47.71093],[-122.265263,47.708068],[-122.262323,47.704308],[-122.260725,47.702264],[-122.255062,47.696866],[-122.25105,47.693615],[-122.246956,47.691202],[-122.243423,47.689524],[-122.242453,47.689064],[-122.241812,47.688797],[-122.236308,47.686224],[-122.233657,47.684762],[-122.232807,47.684085],[-122.232066,47.683353],[-122.231443,47.682572],[-122.230944,47.681752],[-122.230575,47.680901],[-122.23034,47.680029],[-122.23027,47.679561],[-122.229983,47.677172],[-122.229681,47.668681],[-122.229725,47.667777],[-122.229908,47.666881],[-122.230229,47.666003],[-122.230684,47.665152],[-122.230814,47.66495],[-122.231924,47.663757],[-122.23226,47.663395],[-122.233939,47.661951],[-122.235832,47.660633],[-122.237078,47.65993],[-122.237918,47.659456],[-122.240175,47.658433],[-122.24199,47.657767],[-122.245926,47.656132],[-122.249553,47.654244],[-122.25103,47.653346],[-122.251167,47.653243],[-122.253351,47.651413],[-122.255292,47.649384],[-122.256908,47.647229],[-122.258182,47.644971],[-122.2591,47.642636],[-122.25937,47.641524],[-122.259604,47.640454],[-122.259622,47.640374],[-122.260051,47.63699],[-122.260675,47.632007],[-122.261091,47.628694],[-122.262212,47.624885],[-122.262234,47.624812],[-122.262238,47.624776],[-122.262722,47.621146],[-122.263651,47.613115],[-122.265147,47.601321],[-122.265672,47.597061],[-122.266327,47.591805],[-122.266544,47.59005],[-122.266556,47.589953],[-122.266573,47.589794],[-122.26661,47.589473],[-122.266719,47.588843],[-122.266832,47.587369],[-122.266821,47.586371],[-122.266493,47.583781],[-122.266241,47.582742],[-122.265413,47.580486],[-122.264919,47.57948],[-122.264851,47.579372],[-122.264156,47.578503],[-122.26328,47.577637],[-122.262695,47.577172],[-122.262276,47.576838],[-122.261153,47.576115],[-122.259925,47.575475],[-122.258604,47.574925],[-122.257206,47.574472],[-122.255868,47.574148],[-122.255706,47.574107],[-122.253772,47.573614],[-122.251847,47.57296],[-122.25116,47.572682],[-122.251032,47.572612],[-122.249739,47.571901],[-122.247649,47.570537],[-122.24578,47.569033],[-122.244154,47.567405],[-122.242788,47.565671],[-122.241698,47.563849],[-122.240895,47.561961],[-122.240388,47.560026],[-122.240183,47.558065],[-122.240282,47.556101],[-122.240575,47.554038],[-122.241197,47.551954],[-122.242137,47.549925],[-122.243386,47.547974],[-122.244928,47.546122],[-122.245003,47.546051],[-122.246748,47.544389],[-122.248826,47.542795],[-122.251073,47.541396],[-122.251215,47.541298],[-122.252158,47.540468],[-122.253022,47.539516],[-122.253734,47.538509],[-122.254287,47.537457],[-122.254675,47.536371],[-122.254892,47.535264],[-122.254938,47.534147],[-122.254914,47.53377],[-122.254699,47.532185],[-122.254241,47.530623],[-122.253544,47.529103],[-122.252617,47.52764],[-122.251468,47.526251],[-122.251192,47.525962],[-122.251058,47.52586],[-122.248731,47.524144],[-122.246099,47.522571],[-122.243239,47.521192],[-122.243131,47.521146],[-122.240322,47.519865],[-122.235699,47.517769],[-122.227476,47.513624],[-122.219822,47.509801],[-122.224613,47.509758],[-122.235294,47.509513],[-122.236233,47.509521],[-122.237053,47.509524],[-122.238194,47.509519],[-122.23822,47.50953],
[-122.238326,47.509542],[-122.238425,47.509544],[-122.238806,47.509528],[-122.238919,47.509557],[-122.241152,47.509591],[-122.241569,47.509597],[-122.243034,47.509597],[-122.243218,47.509604],[-122.243302,47.509644],[-122.24336,47.509682],[-122.243726,47.509687],[-122.244089,47.509692],[-122.244131,47.509692],[-122.245001,47.509703],[-122.245387,47.509708],[-122.245652,47.509721],[-122.245787,47.509728],[-122.247099,47.509734],[-122.247146,47.509734],[-122.247118,47.509658],[-122.246942,47.509233],[-122.246945,47.50915],[-122.246897,47.509076],[-122.246833,47.509015],[-122.246742,47.508968],[-122.246972,47.508211],[-122.24611,47.507269],[-122.246079,47.507236],[-122.246079,47.507227],[-122.246078,47.507211],[-122.246077,47.507187],[-122.246075,47.507147],[-122.246067,47.50697],[-122.246059,47.506791],[-122.24605,47.506612],[-122.246048,47.506557],[-122.246045,47.506502],[-122.246039,47.506374],[-122.246037,47.50632],[-122.246032,47.506205],[-122.24603,47.506169],[-122.246047,47.506106],[-122.246063,47.506043],[-122.246069,47.506021],[-122.246108,47.505877],[-122.24615,47.505717],[-122.246203,47.505517],[-122.246259,47.505306],[-122.246266,47.505278],[-122.246278,47.505232],[-122.246238,47.505163],[-122.246203,47.505104],[-122.246188,47.505079],[-122.246106,47.50494],[-122.245991,47.504745],[-122.245896,47.504583],[-122.245802,47.504425],[-122.245714,47.504276],[-122.245609,47.504097],[-122.2455,47.503913],[-122.245485,47.503886],[-122.245496,47.503814],[-122.245548,47.503531],[-122.245635,47.503056],[-122.247206,47.503073],[-122.24802,47.503081],[-122.248016,47.503515],[-122.248015,47.503653],[-122.248014,47.503711],[-122.248012,47.50385],[-122.248009,47.504048],[-122.248003,47.50446],[-122.248003,47.504505],[-122.247994,47.505148],[-122.247993,47.505182],[-122.247992,47.505288],[-122.247988,47.505591],[-122.247985,47.505789],[-122.247982,47.505986],[-122.24798,47.506128],[-122.24798,47.506164],[-122.247979,47.506225],[-122.247979,47.506253],[-122.247978,47.506316],[-122.247977,47.506349],[-122.248001,47.506349],[-122.248081,47.50635],[-122.248102,47.506351],[-122.248327,47.506354],[-122.248544,47.506357],[-122.248651,47.506358],[-122.248687,47.506359],[-122.248757,47.50636],[-122.248784,47.506361],[-122.248787,47.506278],[-122.248787,47.506259],[-122.24879,47.506116],[-122.248811,47.504792],[-122.248822,47.504134],[-122.248824,47.504021],[-122.248827,47.503838],[-122.248839,47.503076],[-122.248843,47.502995],[-122.245644,47.502953],[-122.244959,47.502944],[-122.243131,47.502915],[-122.24238,47.502904],[-122.24125,47.502891],[-122.240819,47.502883],[-122.240828,47.502227],[-122.240836,47.501466],[-122.240862,47.499633],[-122.240861,47.499568],[-122.24087,47.499245],[-122.241583,47.49925],[-122.248161,47.49935],[-122.24841,47.499353],[-122.24846,47.499354],[-122.248674,47.499357],[-122.248794,47.499358],[-122.248816,47.499359],[-122.248835,47.499359],[-122.248902,47.49936],[-122.249023,47.499357],[-122.24951,47.499344],[-122.249635,47.499343],[-122.249754,47.499711],[-122.249954,47.500388],[-122.250166,47.501099],[-122.250258,47.5014],[-122.250349,47.501702],[-122.250506,47.502219],[-122.250625,47.502519],[-122.250734,47.502716],[-122.250814,47.502831],[-122.251413,47.502801],[-122.251642,47.502825],[-122.25362,47.502729],[-122.259515,47.502537],[-122.259529,47.501306],[-122.259552,47.500154],[-122.259608,47.497346],[-122.259638,47.495987],[-122.259643,47.495601],[-122.264081,47.495551],[-122.26427,47.495571],[-122.264853,47.495565],[-122.265348,47.495564],[-122.266417,47.495563],[-122.266858,47.495546],[-122.268426,47.495523],[-122.268575,47.495524],[-122.269276,47.495531],[-122.269685,47.495535],[-122.270261,47.495541],[-122.270302,47.495543],[-122.270298,47.496033],[-122.270294,47.496354],[-122.270292,47.496569],[-122.270283,47.497002],[-122.270282,47.497059],[-122.270278,47.497327],[-122.270273,47.49758],[-122.270227,47.500282],[-122.270327,47.500303],[-122.270449,47.500275],[-122.270591,47.500284],[-122.270671,47.500303],[-122.270755,47.500808],[-122.270704,47.500827],[-122.270855,47.501456],[-122.270875,47.501548],[-122.270887,47.501613],[-122.270787,47.501592],[-122.270264,47.501468],[-122.270202,47.502629],[-122.270175,47.503177],[-122.270166,47.504475],[-122.270157,47.504896],[-122.270157,47.505101],[-122.270145,47.50609],[-122.27014,47.506581],[-122.270125,47.507025],[-122.270087,47.508783],[-122.27007,47.509537],[-122.270069,47.509663],[-122.271549,47.509696],[-122.274076,47.509753],[-122.275411,47.509784],[-122.275412,47.509633],[-122.275418,47.50893],[-122.27543,47.507142],[-122.275432,47.506927],[-122.275774,47.507007],[-122.276072,47.507126],[-122.276241,47.507231],[-122.277078,47.507773],[-122.277225,47.507839],[-122.277387,47.507892],[-122.277542,47.507936],[-122.277703,47.507967],[-122.277889,47.507992],[-122.278229,47.507991],[-122.278341,47.507987],[-122.27838,47.508871],
[-122.278534,47.509577],[-122.278544,47.509813],[-122.278547,47.509855],[-122.278645,47.509856],[-122.278721,47.509858],[-122.27985,47.509883],[-122.280761,47.509904],[-122.281278,47.509916],[-122.282464,47.509943],[-122.282557,47.509945],[-122.282967,47.509953],[-122.283365,47.509962],[-122.283686,47.509974],[-122.28387,47.509975],[-122.284424,47.509988],[-122.284673,47.509993],[-122.284798,47.509996],[-122.284885,47.509998],[-122.285645,47.510015],[-122.285757,47.510018],[-122.285928,47.510022],[-122.286147,47.510028],[-122.286235,47.51003],[-122.286518,47.510037],[-122.287504,47.510059],[-122.287646,47.510063],[-122.287825,47.510067],[-122.289847,47.510112],[-122.290052,47.510117],[-122.290168,47.510119],[-122.290257,47.510121],[-122.290795,47.510133],[-122.29134,47.510146],[-122.291339,47.510247],[-122.291338,47.510399],[-122.291336,47.510629],[-122.291334,47.510695],[-122.291334,47.510766],[-122.291334,47.51083],[-122.291334,47.510883],[-122.291325,47.511627],[-122.291312,47.513415],[-122.291306,47.513592],[-122.291305,47.513673],[-122.291305,47.513744],[-122.291303,47.513885],[-122.291287,47.51489],[-122.291282,47.516414],[-122.29128,47.51698],[-122.291281,47.517682],[-122.291281,47.517825],[-122.291282,47.518567],[-122.291283,47.518838],[-122.291283,47.519301],[-122.291283,47.519524],[-122.291284,47.51969],[-122.291284,47.519737],[-122.291284,47.519998],[-122.291285,47.52049],[-122.291285,47.520553],[-122.291285,47.520669],[-122.291286,47.521258],[-122.291286,47.521315],[-122.291287,47.522313],[-122.291287,47.522362],[-122.291288,47.522843],[-122.291288,47.522948],[-122.291289,47.523339],[-122.291289,47.523379],[-122.29129,47.524199],[-122.29129,47.52428],[-122.291293,47.524381],[-122.291296,47.524463],[-122.291372,47.524462],[-122.291801,47.524462],[-122.293357,47.524461],[-122.29365,47.52446],[-122.293887,47.52446],[-122.294029,47.52446],[-122.295486,47.524459],[-122.29986,47.524454],[-122.299966,47.524454],[-122.300481,47.524454],[-122.300501,47.524453],[-122.300374,47.524581],[-122.300302,47.524663],[-122.300235,47.52471],[-122.300212,47.524749],
[-122.300208,47.52478],[-122.300139,47.524907],[-122.300088,47.525001],[-122.299756,47.526019],[-122.299746,47.526257],[-122.299776,47.526614],[-122.299862,47.526967],[-122.29989,47.52709],[-122.300272,47.52798],[-122.300916,47.529034],[-122.301367,47.529248],[-122.301578,47.529347],[-122.303344,47.530249],[-122.305076,47.531051],[-122.305114,47.531303],[-122.305172,47.531678],[-122.307104,47.531709],[-122.307306,47.531712],[-122.30843,47.531733],[-122.308924,47.531741],[-122.309177,47.531745],[-122.313285,47.531774],[-122.31681,47.53177],[-122.317958,47.531767],[-122.31803,47.531765],[-122.318264,47.531766],[-122.318263,47.531643],[-122.318258,47.530963],[-122.318256,47.530464],[-122.318249,47.529776],[-122.318245,47.529455],[-122.318244,47.529438],[-122.31822,47.529438],[-122.318118,47.529438],[-122.318016,47.529437],[-122.317914,47.529437],[-122.317812,47.529437],[-122.31771,47.529436],[-122.317576,47.529436],[-122.317575,47.529413],[-122.317568,47.529169],[-122.317575,47.529026],[-122.31759,47.528825],[-122.317599,47.528549],[-122.317554,47.52821],[-122.317483,47.528171],[-122.314898,47.527369],[-122.314718,47.527316],[-122.312833,47.526819],[-122.312645,47.526777],[-122.311887,47.526583],[-122.311836,47.526557],[-122.311724,47.526485],[-122.311609,47.526363],[-122.311428,47.526182],[-122.311084,47.525758],[-122.310315,47.525051],[-122.310148,47.524907],[-122.309972,47.524754],[-122.309856,47.524584],[-122.309703,47.524299],[-122.309637,47.52412],[-122.309595,47.524004],[-122.309533,47.523704],[-122.309521,47.523466],[-122.309518,47.5234],[-122.309549,47.523097],[-122.309619,47.522756],[-122.309667,47.522187],[-122.309671,47.522145],[-122.309758,47.522145],[-122.310126,47.522145],[-122.310995,47.522146],[-122.313361,47.522133],[-122.313516,47.522154],[-122.313666,47.522183],[-122.314266,47.522183],[-122.314889,47.522191],[-122.314984,47.522197],[-122.315112,47.52221],[-122.31586,47.522206],[-122.316023,47.522218],[-122.317656,47.522222],[-122.317641,47.521828],[-122.317611,47.521011],[-122.317593,47.520549],[-122.317588,47.520393],[-122.317578,47.520107],[-122.317571,47.51995],[-122.317567,47.519832],[-122.317544,47.519205],[-122.31753,47.518832],[-122.317526,47.518725],[-122.318131,47.518727],[-122.318413,47.518724],[-122.318601,47.518722],[-122.320136,47.518714],[-122.320343,47.518714],[-122.321292,47.518716],[-122.321607,47.518714],[-122.323154,47.518686],[-122.32323,47.518684],[-122.323438,47.518685],[-122.323858,47.518686],[-122.324073,47.518686],[-122.324135,47.518686],[-122.32451,47.518687],[-122.3251,47.518674],[-122.325879,47.518691],[-122.325881,47.520232],[-122.325876,47.52092],[-122.327899,47.520921],[-122.329592,47.520913],[-122.330073,47.520906],[-122.330599,47.520902],[-122.330779,47.520901],[-122.330906,47.520902],[-122.33063,47.520513],[-122.329917,47.519564],[-122.329914,47.519549],[-122.329852,47.519245],[-122.329836,47.519168],[-122.32969,47.518457],[-122.329611,47.518302],[-122.329556,47.518195],[-122.329518,47.518122],[-122.329369,47.517833],[-122.329357,47.517809],[-122.329308,47.51753],[-122.329256,47.517381],[-122.329238,47.517329],[-122.329227,47.517281],[-122.329215,47.517225],[-122.329207,47.517184],[-122.3292,47.51717],[-122.329177,47.517126],[-122.328849,47.516755],[-122.328713,47.516593],[-122.328639,47.516505],[-122.327326,47.513997],[-122.328184,47.513994],[-122.328565,47.513999],[-122.330079,47.513997],[-122.330273,47.513999],[-122.330289,47.514029],[-122.330586,47.514539],[-122.33097,47.514944],[-122.331153,47.515121],[-122.331182,47.515149],[-122.331385,47.515132],[-122.331405,47.515098],[-122.332616,47.514882],[-122.333497,47.514725],[-122.333555,47.514742],[-122.333512,47.514531],[-122.334036,47.514522],[-122.334357,47.514523],[-122.334353,47.514499],[-122.334252,47.513897],[-122.335707,47.513923],[-122.336507,47.513914],[-122.336645,47.513907],[-122.33704,47.513893],[-122.337124,47.515023],[-122.337275,47.515858],[-122.33739,47.516502],[-122.337408,47.516602],[-122.337469,47.516944],[-122.33748,47.517005],[-122.337492,47.517073],[-122.337521,47.517257],[-122.337537,47.517256],[-122.33793,47.517258],[-122.339915,47.517269],[-122.340134,47.517277],[-122.340448,47.51724],[-122.34075,47.51722],[-122.341437,47.517276],[-122.34161,47.517281],[-122.342878,47.517287],[-122.343873,47.517293],[-122.344151,47.517294],[-122.344639,47.517299],[-122.345426,47.517302],[-122.346699,47.517309],[-122.347972,47.517317],[-122.348017,47.517317],[-122.349246,47.517324],[-122.350655,47.517332],[-122.351735,47.517339],[-122.351778,47.517339],[-122.352909,47.517361],[-122.353404,47.51737],[-122.354037,47.517374],[-122.355167,47.51738],[-122.356112,47.517386],[-122.356513,47.517382],[-122.357859,47.51736],[-122.358228,47.517353],[-122.358557,47.517347],[-122.358564,47.515528],[-122.359181,47.515528],[-122.360495,47.515528],[-122.360536,47.51682],[-122.360542,47.51736],
[-122.361127,47.517362],[-122.361851,47.517361],[-122.36262,47.517361],[-122.363226,47.517362],[-122.36457,47.517362],[-122.365915,47.517361],[-122.36728,47.517377],[-122.367695,47.517381],[-122.368662,47.517393],[-122.3714,47.517424],[-122.371316,47.516653],[-122.371272,47.516076],[-122.371274,47.516024],[-122.371263,47.515745],[-122.371152,47.514459],[-122.371104,47.513705],[-122.37108,47.513335],[-122.37102,47.512548],[-122.371,47.51229],[-122.370984,47.512047],[-122.370888,47.510038],[-122.37086,47.509458],[-122.370877,47.508199],[-122.370862,47.508017],[-122.370714,47.507259],[-122.37053,47.506664],[-122.370465,47.506409],[-122.370464,47.506398],[-122.370394,47.505821],[-122.370404,47.505686],[-122.370449,47.505503],[-122.370474,47.505402],[-122.37054,47.505135],[-122.37055,47.50452],[-122.370561,47.503866],[-122.370596,47.503683],[-122.370694,47.503511],[-122.370919,47.503241],[-122.371413,47.502778],[-122.372051,47.502182],[-122.372257,47.502014],[-122.373121,47.501378],[-122.3738,47.500834],[-122.373923,47.500697],[-122.373972,47.500581],[-122.374059,47.499917],[-122.374133,47.499617],[-122.374278,47.499221],[-122.37485,47.497659],[-122.37492,47.497497],[-122.375024,47.49732],[-122.375068,47.497248],[-122.375208,47.497032],[-122.375312,47.496869],[-122.375652,47.496434],[-122.380128,47.493203],[-122.38181,47.491912],[-122.399237,47.48522],[-122.407658,47.48215],[-122.409315,47.485945],[-122.409341,47.485999],[-122.409371,47.486053],[-122.415446,47.497105],[-122.416946,47.499846],[-122.418072,47.501568],[-122.423326,47.508282],[-122.42629,47.512069],[-122.430797,47.516605],[-122.436093,47.521938],[-122.436484,47.522337],[-122.439282,47.525625],[-122.441558,47.529092],[-122.442968,47.532037],[-122.443244,47.53264],[-122.443323,47.532812],[-122.444449,47.536414],[-122.445032,47.540187],[-122.445031,47.541851],[-122.445031,47.54253],[-122.444867,47.542661],[-122.444636,47.543295],[-122.444778,47.544416],[-122.444372,47.54783],[-122.443864,47.551798],[-122.443888,47.553717],[-122.444013,47.554485],[-122.444297,47.555565],[-122.444622,47.55646],[-122.444772,47.556877],
[-122.445159,47.557759],[-122.445723,47.558828],[-122.447001,47.560745],[-122.44849,47.562978],[-122.450247,47.565615],[-122.450834,47.566373],[-122.451683,47.567468],[-122.452447,47.568371],[-122.453062,47.569097],[-122.453249,47.569399],[-122.453374,47.569604],[-122.453994,47.57091],[-122.454134,47.571318],[-122.45448,47.572328],[-122.454766,47.573685],[-122.454787,47.57397],[-122.454847,47.574757],[-122.454781,47.576186],[-122.454746,47.576391],[-122.454726,47.576591],[-122.454627,47.577209],[-122.4541,47.579662],[-122.453582,47.581237],[-122.453158,47.582208],[-122.451696,47.585085],[-122.451383,47.585702],[-122.450513,47.587416],[-122.449692,47.588963],[-122.448332,47.591253],[-122.447883,47.592297],[-122.447569,47.593313],[-122.447305,47.594455],[-122.447157,47.595574],[-122.446984,47.597612],[-122.446947,47.5981],[-122.446859,47.599162],[-122.446558,47.602772],[-122.446203,47.607035],[-122.446063,47.607998],[-122.446503,47.611494],[-122.446853,47.61242],[-122.447298,47.613069],[-122.447711,47.614209],[-122.447908,47.614741],[-122.448321,47.615696],[-122.448615,47.616382],[-122.448642,47.616446],[-122.44867,47.61651],[-122.449203,47.617523],[-122.449543,47.618171],[-122.45005,47.619022],[-122.451403,47.620957],[-122.453006,47.622876],[-122.453763,47.623782],[-122.454252,47.624636],[-122.454908,47.626561],[-122.454985,47.627192],[-122.45491,47.627647],[-122.454567,47.629007],[-122.454372,47.629669],[-122.454199,47.630258],[-122.454069,47.630696],[-122.453871,47.631371],[-122.453682,47.632013],[-122.453522,47.632556],[-122.453067,47.634524],[-122.45284,47.636087],[-122.452694,47.638749],[-122.452675,47.63911],[-122.452686,47.642348],[-122.452812,47.643798],[-122.453181,47.646248],[-122.453251,47.646713],[-122.453391,47.647654],[-122.454105,47.651119],[-122.454282,47.652018],[-122.454346,47.652662],[-122.454405,47.653253],[-122.455216,47.655316],[-122.456059,47.657707],[-122.456757,47.659683],[-122.457251,47.661335],[-122.458099,47.663906],[-122.458569,47.665605],[-122.459375,47.669161],[-122.45962,47.671118],[-122.459737,47.67212],[-122.459774,47.672418]]]]}`
bounds := `{"type":"MultiPolygon","coordinates":[[[[-114.2399485999843,42.681876499955926],[-114.23997050001262,42.67824680037998],[-114.23627140565759,42.678233981038666],[-114.23504369971833,42.67822970021946],[-114.23503067863831,42.67578671168899],[-114.23543512533203,42.67583999946153],[-114.23594982495554,42.676124423371455],[-114.23672596666609,42.67625624813994],[-114.23685805764039,42.676776002285635],[-114.23663532665391,42.677055424446124],[-114.23671287282251,42.67747314961749],[-114.23681394047848,42.677805126285634],[-114.23706193209075,42.67813127497741],[-114.23784992168157,42.678186635769315],[-114.23838959806322,42.67813118119811],[-114.23875417123647,42.67791953618522],[-114.23912485834349,42.67784524816636],[-114.23952718950476,42.67769791345572],[-114.23999116575574,42.677386626685646],[-114.24048944148089,42.67724527831817],[-114.241314164082,42.67699656963459],[-114.24195248087176,42.676729402854455],[-114.24240805338327,42.67645818447628],[-114.24311814376759,42.67608562786248],[-114.24355505557568,42.67596026910592],[-114.24477528843009,42.67578037408335],[-114.24521195320149,42.675790315723084],[-114.24576310286596,42.67606342521258],[-114.2467516503271,42.676300425443266],[-114.2474970507903,42.676777404382534],[-114.24910805618318,42.67760249691951],[-114.24971203666782,42.67767705336001],[-114.25014930420876,42.67756278302376],[-114.25107740672941,42.677654319638556],[-114.25187256038463,42.677646259180754],[-114.25216885710465,42.677753657678224],[-114.25223329954821,42.678306700105715],[-114.25279040055142,42.678712300300425],[-114.25345425195313,42.678693062516],[-114.25372209992645,42.67868529937817],[-114.25422830058905,42.67839869989619],[-114.25469089972272,42.67851959990614],[-114.25525630026085,42.67839799985663],[-114.2563918004244,42.678740799683624],[-114.25714179936351,42.67950249986307],[-114.25712530000669,42.6819502000424],[-114.25711160069862,42.68397369991884],[-114.25465699999884,42.68442620019711],[-114.25229229999773,42.684861999674204],[-114.24974329893801,42.68533019969429],[-114.2486267002264,42.685511500004914],[-114.24862660051338,42.68554050010786],[-114.24483440027073,42.68552580030558],[-114.24131170000318,42.68551210025312],[-114.24115469964434,42.685511400293755],[-114.2399323000535,42.68459820015348],[-114.2399485999843,42.681876499955926]]],[[[-114.24970880003785,42.69640819992281],[-114.24970389972798,42.692787600018605],[-114.25460269953487,42.69281529997132],[-114.25950169966605,42.69284299991165],[-114.25951680034598,42.69646220021525],[-114.2546128001919,42.69643530009867],[-114.24970880003785,42.69640819992281]]],[[[-122.50865178071805,47.61633533468668],[-122.50746427348945,47.6148250023897],[-122.50762759349631,47.61480254865959],[-122.50778991457659,47.61477700108817],[-122.50795111006781,47.61474837844346],[-122.50811105151087,47.61471670312629],[-122.51010371333871,47.61430140449804],[-122.51016786562644,47.6142883120613],[-122.51041138093365,47.61424362213619],[-122.51040948099681,47.61458176413451],[-122.51040824760994,47.614801121949036],[-122.5104030903819,47.61571858749849],[-122.51039374700463,47.61572085227092],[-122.51038431649077,47.61572294324917],[-122.51037480423024,47.61572485861667],[-122.51036521830783,47.61572659716236],[-122.51026191115182,47.615750784801655],[-122.51015949332798,47.615776646785115],[-122.51007599582063,47.61579915156894],[-122.50999317294806,47.6158227693494],[-122.5099449262308,47.615836900530496],[-122.50989743499666,47.61585215743006],[-122.50985075673788,47.6158685200638],[-122.50980494714995,47.61588596844757],[-122.50976006103016,47.61590448380809],[-122.50971615497232,47.61592404192218],[-122.50967327838381,47.61594461977769],[-122.50963148606186,47.61596619133478],[-122.50959082651548,47.61598873297563],[-122.50955135094863,47.6160122150271],[-122.50951310517539,47.61603661144916],[-122.50947613500989,47.61606189135753],[-122.50944048716445,47.61608802386794],[-122.50940620296163,47.616114978095965],[-122.50939632239182,47.61612695102005],[-122.50938583635751,47.616138685960564],[-122.50937475743511,47.61615016959558],[-122.50936310089598,47.6161613886031],[-122.50935087841822,47.61617232905581],[-122.50933810527319,47.61618297763166],[-122.50932479673226,47.61619332161441],[-122.50931096896512,47.616203350104364],[-122.50929663724307,47.61621305038511],[-122.50928181953245,47.61622241034595],[-122.50926653379958,47.6162314184816],[-122.50925079801074,47.61624006570906],[-122.50923462923394,47.6162483411286],[-122.50921804992707,47.61625623444614],[-122.50920107715808,47.61626373657857],[-122.50918373158828,47.61627083844286],[-122.50916603387886,47.61627753156154],[-122.50914800648772,47.616283808668186],[-122.50912966917784,47.61628966128524],[-122.50911104350872,47.61629508275189],[-122.50909215373491,47.616300066407184],[-122.50907301961938,47.61630460740689],
[-122.50905366631491,47.61630869909014],[-122.50903411627938,47.61631233782372],[-122.50901439107238,47.61631551815777],[-122.50899451584671,47.61631823645919],[-122.5089745139586,47.61632049030575],[-122.50895440966254,47.61632227606429],[-122.50893422541641,47.61632359312931],[-122.50891398637307,47.61632443726198],[-122.50889371678699,47.616324809673436],[-122.50887343911609,47.61632470915263],[-122.50885317941147,47.61632413630507],[-122.50883296102938,47.616323091130724],[-122.508812807326,47.6163215748407],[-122.50879274345411,47.61631958985712],[-122.50877279276996,47.61631713860209],[-122.50875901261351,47.61631791309698],[-122.50874528006777,47.616319003081905],[-122.50873160950579,47.616320408556895],[-122.5087180179955,47.61632212588859],[-122.50870451991005,47.616324155682584],[-122.50869113231737,47.61632649430547],[-122.50867786959051,47.616329139335114],[-122.50866474700086,47.61633208713811],[-122.50865178071805,47.61633533468668]]]]}`
seattleObj := testJSON(t, seattle).(MultiPolygon)
boundsObj := testJSON(t, bounds).(MultiPolygon)
if seattleObj.Intersects(boundsObj) {
t.Fatalf("should not intersect")
}
if boundsObj.Intersects(seattleObj) {
t.Fatalf("should not intersect")
}
}